<@U01819B63HP> When creating a symbol from an exis...
# xschem
m
@Stefan Schippers When creating a symbol from an existing schematic in xschem, it looks like the input pins are aligned on the left side of the symbol and the output and inout pins are aligned on the right side of the symbol. The top-to-bottom pin order seems to follow the actual top-to-bottom pin order in the schematic. 1. Is there a painless way to create the symbols with ports in alphabetical order? Maybe a global property on the schematic for symbol pin placement order,
schematic
vs
alphabetical
. Maybe a global property for minimum shape, and whether to center pins or justify them from top/bottom, left/right. 2. Is there a way to override the default placement of input/output/io pins? For example, I’d like non-global power pins at the top, ground pins at the bottom, and occasionally want some inputs on the right and outputs on the left. Maybe add a property to the schematic pins for placement (need to consider how to handle duplicate pins with different settings)?
Would it be possible to automatically create symbols like these? When 2 symbols have both mutual input and outputs, it’s a lot cleaner (less wiring) if both sets of inputs and output can face each other. 1. Port lists are center justified 2. Port lists are in alphabetical order. 3. Input/Output ports can appear on any side. Input ports have arrow into symbol, output ports have arrow away from symbol. 4. When the port direction changes on a side, leave a blank space.
s
Usually symbols are created automatically by xschem from schematics. input pins on the left, outputs and inouts on the right, vertical position of pins in the schematic determines the sequence of pins on the symbol. see picture
There is also an interesting symbol generator, symgen.awk that creates a symbol from a simple textual description: https://xschem.sourceforge.io/stefan/xschem_man/tutorial_symgen.html
adding small arrows on symbol pins to indicate direction is easy. Will add that
for the automatic generation with your specification, how do you specify the side for a group of pins? some metadata in the schematic?
m
What do you think of these specifications? Pin locations: Default: Input:
left
, Output:
right
, I/O:
right
Can be overridden by property on each schematic pin.
symbol_pin_location=top|bottom|right|left
Pin order: Default: same as
schematic
(top to bottom) Can be overridden by global property on schematic.
symbol_pin_order=alphabetic|schematic
Pin grouping: Default: `packed`: one pin per pitch. Can be overridden by global property on schematic per side.
symbol_top_pin_grouping=packed|spaced|packed_by_type
`spaced`: proportionally spaced on grid across specified side. `packed_by_type`: one pin per pitch but skip a space when pin type changes. Pin alignment: Default: `top`|`left`. Can be overridden by global property on schematic per side:
symbol_top_pin_alignment=top|left|center|right|bottom
Symbol size: Default: automatically calculated according to pin placement. Can be overridden by global property on schematic:
symbol_size=50x200