V9 Symbol Generator - how to specify the Unit names

Hi, I’m writing a Symbol Generator for the Altera Agilex 5 Family using the python Kicad_sym library. I’m quite successful, but I’m failing to add the unit names to the different units. So far I see e.g. UnitA to UnitL- But I didn’t find a way to change the unit names to more valuable information, like PWR, HPS…

new_symbol = KicadSymbol.new(symbolname+“-”+footprint[“Footprint”],libname)

I can add Pins, rect… all with the given unit, but how to provide the name of the unit?
new_symbol.rectangles.append(Rectangle(mil_to_mm(-symwidth+250),mil_to_mm(100),mil_to_mm(symwidth-250+extendsymwidth),mil_to_mm(-100*(pin_max+1)),stroke_width=mil_to_mm(10),unit=symnum))

please let me know how to add the unit name to the libraries.

Many thanks, Rolf

AFAIK, you can’t. The A, B, C… suffixes are fixed.
The best you can do is add the unit name as text within each unit.

Hi ML9104, I can change the Unit names in the Symbol Editor GUI, so is this feature missing in the Python interface?

Symbol Editor:
Edit / Set Unit display names

image

In the library the unit_name is mentioned directly below the symbol:
(symbol “A5EC008B-B23A_2_0”
(unit_name “IOB3AT”)

You triggered a memory of a previous topic:

It doesn’t seem to be much use so maybe that’s why no Python interface to it was provided.

Thanks for the link, I added a comment to the other threat.

I guess it might be very easy to add this unit name topic into the python interface.
I just run into another issue on footprint properties - I did not find any way to get e.g. the datasheet added to a footprint. Will have a further look into the forum…

Never mind the forum, check the Kicad footprint Properties:

I think the OP wants to do it programmatically :wink:

3 Likes

Oh, fair enough.

I know I’m just a silly old fart, but that seems like re-inventing the wheel, to me. Anyway, to each their own. :slightly_smiling_face:

1 Like

This is probably not an option in KiCad. The Units become a part of the RefDes, and these can only be limited number of suffixes. See: Schematic Editor / File / Schematic Setup / General / Formatting / Annotations / Symbol unit notation

But you also wrote:

However, the scheenshot you posted has the title: Set Unit Display Name. To me that suggests this is a string that is stored in a separate entity, and not the unit “name” itself.

Euhm no.

Quite a lot of KiCad’s symbols are already generated by scripts, but these are not installed with KiCad. But you can find them on gitlab.

Not a silly old fart or not reinventing the wheel?

Sorry, Paul, I just haaavvvve to ask. :wink:

Yes, I only want to change the Unit Display name - sorry not precise enough…

I will see, if I can find any symbol generator on gitlab… I had a look into other FPGA Libraries and they also have just the UnitA - UnitX names in the symbols…

I’m guessing this Set Unit Display Name is new in KiCad V9, and as a result, it’s quite possible it’s not being used very much yet.

Yes.

I did not find any way to add the unit names, so i added a text on each Unit:

so for the selection it is still “A” to “AA” but at least in the schematic the Unit and IOBank information is visible.

1 Like

You wouldn’t have been able to display the Unit Display Name in the schematic anyway. As investigation in the other topic showed it’s only for the dropdowns, at the moment anyway.

good news!! the unit name object was just added to the library utility!! So I added this feature :slight_smile:

Related: kicad_sym Give split units nice unit names (!680) · Merge requests · KiCad / KiCad Libraries / KiCad Library utilities · GitLab