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