Splitting Large components into Multi-Unit Parts

Hope this isn’t just a result of bad googling but running into issues with large components, especially creating multi-unit components. (Avid Diptrace user, learning KiCad).

I was convinced to use KiCad for my current design, I need to use a monstrous Xlinx Zynq component (XC7Z020-2CLG484i). Unfortunately it wasn’t part of the included library so I ended up needing to create it myself. I was able to find an autogenerated part which was simply a very large square with the pins in order according to the BGA.

I rearranged the pins assuming there would be a good tool to move them into a multi-unit part. And now that I’ve sorted them into powers, grounds, ports, etc. I need to split them into different units.

When I create a unit directly in the part settings I get an exact duplicate. But when I try and delete or change it in some way it duplicates the change across both units. I have set the units as not interchangeable, but any pin deletions, or moves or even drawing propagates across all units.

I found 1 work around to create a new multi-unit part then just copy the pins over to the new multi-unit part to create a multi-unit version of the part. This sort of worked, I was able to get the pins to copy and split up. Even not propagating between units; however, I still can’t draw anything different in the different units. Given I’ve split it up some units have 70 pins, and others have 4pins. This really creates a mess. Beyond that, the copy seems to have dropped pins seemingly at random. Which is concerning.

Beyond a solution, I’d say a good ERC check would be that all the pins from the footprint are represented in the symbol and to throw a warning if they aren’t. As at this point I’m a little scared to proceed.

Thank you for any help that can be provided.

Which KiCad version do you use?

In the schematic library in a multipart component, you can click to a primitive (pin, rectangle, line, …) and check/uncheck “Common to all units in component” (pin) or “Common to all units in symbol” (other primitive). Is that unchecked?

I use multi part components for all kinds of parts and it always worked for me.

1 Like

Okay, that would be the issue. (Still don’t know why it was dropping pins, that may just be because the part was so large I was having issues selecting them as it wouldn’t let me zoom in on certain areas.

How do I disable that on everything all at once. Cause there are no common components/ pins whatsoever.

I am not sure. When i insert new pins or rectangles, they get the same value as the last inserted pin or rectangle.

I wrote a little python script to assign pins to units based on what is in there name, maybe you can adapt this for your needs? Script is not well tested. It should be obvious that you only work with a copy of your library in case it breaks somewhere:

#!/usr/bin/env python3
"""
Expects a KiCad schematic library file as stdin. 
It changes the units of the pins based on the name of that pin.
Output is written to stdout
"""

import sys

def checkPinLine(array):
  """
  Change Unit of a pin if it matches a category
  """
  categories=\
  [
    #unit 0 means visible on all units
    {"unit":"2", "names":["VCC","VDD", "GND" ] }, #Power pins
    {"unit":"3", "names":["DATA","ADDR"] }, #Data and address pins
  ]
  for c in categories:
    for name in c["names"]:
      if name in array[1]: #The name of the pin is in array[1]
        array[-3]=c["unit"]   #Array[-3] has the current unit where the pin is shown
        return
  return

for line in sys.stdin:
  if len(line)>1 and line[0]=='X': #Pins
    a=line.split(' ')
    checkPinLine(a)
    l=" ".join(a)
    print(l,end="")
  else: #ignore all other lines
    print(line,end="")
1 Like

Thank you,

I’ll give it a go in my off time and maybe try and learn KiCad scripting. I’m going to have to move to something else as I don’t want to potentially run into a weird issue like this down the road part way through the work.

You can still do it by hand, i personally would use a script but i use scripts for all sorts of things.

The script is not a script that is used from within KiCad, because the schematic library does not have a Python interface. The scripts “parses” a schematic file and prints it changed. So it is not really “KiCad scripting”. You could probably do the same it with a good text editor.

I did something similar just a few days ago. We discussed it here with pretty much the same results as you have. I wound up hacking the symbol file. Fortunately, my component was much smaller than yours! See this thread.

ADDED:
By the way, did you download the SamacSys Symbols and Footprints package for your part? It may already have them split for you.

Bob

I just have the standard download.

I think for the time being I’m going to go back to my normal software package as I’ve wasted all the time I can afford on learning the tool figuring out how to fix this issue. I’ll hope to revisit KiCad in a later project which has simpler requirements so I’m less likely to butt up against the usability limits of the software.

For me this works:

  1. Open an existing symbol with many pins and 1 unit.
  2. Open Edit Symbol Properties.
  3. Change the number of units there.
  4. Check the box “All units are not interchangeable”.
  5. OK.
  6. Change the active unit from the toolbar.
  7. Delete some pin.
  8. Change the active unit again.
  9. The pin wasn’t deleted from this unit.
  10. Right click on the graphic rectangle’s edge.
  11. Edit Rectangle Options.
  12. Uncheck common to all units.
  13. Draw new graphics for other units.

Is there something in that exact workflow which doesn’t work for you?

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.