A Python script that generates SVG symbols from pin list files.
python svg_generator.py --input <pin_list_file> --output <output_svg_file> [--name SYMBOL_NAME]
If --name
is not provided, the symbol will have no title text.
Each line in the pin list file should follow this format:
name direction type polarity
Where:
name
: Pin name (e.g., clk, addr, dout)direction
: Eitherinput
oroutput
type
: Eitherpin
orbus
polarity
: Eitherpositive
ornegative
Lines starting with #
are treated as comments and ignored.
python svg_generator.py --input example_sram.input.txt --output sram_symbol.svg --name "SRAM"
This will generate an SVG symbol for an SRAM using the pin definitions in example_sram.input.txt
. The output file will be automatically placed in the Result/
directory.
- Automatic symbol sizing based on number of pins
- Clock pins get triangle indicators
- Negative polarity pins/buses get circle indicators
- Bus pins get bus notation
- Input pins on the left, output pins on the right
- Clean, professional SVG output
- Automatic output placement in
Result/
directory
# SRAM pins
clk input pin positive
cen input pin negative
addr input bus positive
din input bus positive
dout output bus positive