devbisme / KiPart

Python package for generating multi-unit schematic symbols for KiCad from a CSV file.
MIT License
170 stars 46 forks source link

adding tool to convert machxo3 lattice csv pinout into kipart readable #40

Closed Martoni closed 5 years ago

Martoni commented 5 years ago

I wrote a little python3 script to convert csv pinout machxo3 files found on Lattice website into csv readable with kipart.

$ python3 machxo3tokipart.py -h
Convert a lattice csv pinout for Kipart

Usage:
python3 machxo3tokipart.py [options]
-h, help                 This usage message
-c, csv=FILENAME         give the filename of lattice csv
-o, outputname=FILENAME  Output filename to write
-p, package=CABGA256     Package to use
-l, list                 list packages available
-n, partname=name        part name (filename in not present)

I'm using this script with machxo36900.csv pinout from here. The csv from lattice has this format :

$ head MachXO36900Pinout.csv 
# Revision 1.0,13-Feb-14,Initial release,,,,,,,,,,
# Revision 1.1,14-May-14,"Added csfBGA256, csfBGA324, caBGA324, caBGA400 packages",,,,,,,,,,
# Revision 1.2,12-Sep-14,New csfBGA pinouts,,,,,,,,,,
,,,,,,,,,,,,
PAD,Pin/Ball Function,Bank,Dual Function,Differential,High Speed,,I/O Grouping,CABGA256,CABGA400,CABGA324,CSFBGA324,CSFBGA256
1,NC,-,-,-,-,,+,-,-,-,-,-
2,PL2A,5,-,True_OF_PL2B,-,,+,-,C4,B1,G12,-
3,GND,-,-,-,-,,-,-,-,-,-,-
4,PL2B,5,-,Comp_OF_PL2A,-,,-,-,C3,C2,C17,-
5,PL2C,5,-,True_OF_PL2D,-,,-,B1,F6,D3,C16,D13

We have to select bga to use with this command options :

$ python3 machxo3tokipart.py -c MachXO36900Pinout.csv -pCABGA256 -nMachXO36900_CABGA256 -o LatticeMachXO3.csv

And the csv result has the following format :

$ head LatticeMachXO3.csv 
MachXO36900_CABGA256

Pin, Unit, Name
B1, BANK5, PL2C_5
C2, BANK5, PL2D_5
D3, BANK5, PL3A_5_L_GPLLT_FB
D1, BANK5, PL3B_5_L_GPLLC_FB
E2, BANK5, PL4A_5_L_GPLLT_IN
E3, BANK5, PL4B_5_L_GPLLC_IN
C1, BANK5, PL4C_5

Then it can be converted in kicad symbol with kipart.

xesscorp commented 5 years ago

Thanks for adding this utility!