High pincount schematic symbols

Creating high pincount schematic symbols, especially for things like FPGAs, is a real pain. I built a script called KiPart for generating multi-unit KiCad symbols from pin lists stored in CSV files. You can read more about it here, download the source here, and install it like this:

pip install kipart

I used the script to generate a library of schematic symbols for all the Xilinx 7-Series FPGAs (Zynq, Artix, Kintex, and Virtex) from the CSV files stored here. They should be correct if the pin information in the Xilinx CSV files is.

If anyone has some tabular pin data for other high pincount devices, Iā€™d be happy to try KiPart on them.

5 Likes

Cool! I like this a lot.

One suggestion, though: I see that when set to stack identical power pins, it marks most of them hidden. You donā€™t want to do that. Hidden+PowerIn pins are automatically, implicitly connected to the net of the same name, which is probably undesirable. I recommend making the extra pins ā€œlessā€ visible by setting the pin number text size to zero, instead.

Oh, I didnā€™t know that!

Good idea. Iā€™ll make the change.

Itā€™s one of KiCadā€™s silliest ā€œfeaturesā€. Itā€™s used to implement power ports, but also the ghastly hidden pins on ICs (like in the 7400 lib) that are implicitly connectedā€¦

I made the change, tested it (seems to work), updated the repo and bumped the version number on pypi. Thanks for the tip!

There have been issues in the past with things set to zero size not rendering properly in eeschema - but I use that so often that if there are any more issues with it, Iā€™ll just fix them myself in eeschemaā€¦

If that becomes a problem, I can always bump the ā€œinvisibleā€ pin number size up to 1 mil. Thatā€™s still a better solution than having to redo a board spin.

Or just report a bug on the tracker and Iā€™ll pounce on it :wink:

Does Kipart need any specific version of the Python installed? I just tried it with Python 3.4 on Win7 64bit, install via pip went ok, but any call to kipart.exe results in this:

I developed it with Python 2.7.6. That print statement would have to be turned into a print function call for it to run on Python 3.

Thanks! Works fine with 2.7.6. Perhaps adding that info somewhere on the page would help to avoid confusion among less experienced users.

Considering that the function call syntax is equally valid in 2.7 as long as youā€™re not using the optional features (omitting EOL or printing to a different file), perhaps you should consider using that syntax. There are a lot of simple Python scripts that would be both 2- and 3-compatible if the developers would just put parens in their print statements.

ā€“In fact, I tend to define something like this at the top of my scripts so I can use the rest of the features too

def Print(text, end='\n', file=sys.stdout):
    """Python 2+3-compatible Print"""
    file.write(text)
    file.write(end)
    file.flush()

As a companion to print, if you use it:

try:
    raw_input
except NameError:
    raw_input = input

Or, if you prefer to call it input:

try:
    raw_input
except NameError:
    pass
else:
    input = raw_input

Iā€™m working on the port to Python 3. Iā€™ve used ā€˜futurizeā€™ to do the conversion. Itā€™s mostly working, but there are a few issues that arenā€™t as simple as converting the print built-in to a function.

I got it ported over to Python 3 in case you want to dump Python 2.7 from your system.

Would it be possible to add support for pin coordinates in mils (e.g. ā€œXā€ and ā€œYā€ columns in CSV)?

Sorry, I donā€™t understand what these pin coordinates would be for.

Iā€™m talking about symbol pin coordinates as they defined in the KiCad symbol format. That would allow to define gaps between pin groups (for more complex symbols) in the CSV itself instead of rearranging pins in the symbol editor afterwards.

So you donā€™t really want (X,Y) coordinates. You want something like a ā€œgapā€ pin thatā€™s listed in the CSV file but doesnā€™t turn into an actual pin in the symbol and leaves a space instead. Possibly this could be specified by placing an asterisk in the pin number column.

That would do the trick too, thank!

OK, I added the ability to insert ā€œgapā€ pins. Just insert a row with a pin number that is a ā€˜*ā€™ (or starts with one) and that will create a non-existent pin that inserts a gap in the sequence of pins on the symbol.

This only works if youā€™re using KiPart with the -s row option. (Using the -s name or -s num options will sort the pins by their names or pin numbers and that makes it impossible to tell where the gap pins should be placed.)

If youā€™re building a multi-unit symbol or using multiple sides of the symbol, remember to also specify the unit and side for the gap pin.

1 Like