Skip to content

haoiyang/BlockSymbolCreator

Repository files navigation

SVG Symbol Generator

A Python script that generates SVG symbols from pin list files.

Usage

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.

Pin List Format

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: Either input or output
  • type: Either pin or bus
  • polarity: Either positive or negative

Lines starting with # are treated as comments and ignored.

Example

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.

Features

  • 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

Pin List Example

# SRAM pins
clk input pin positive
cen input pin negative
addr input bus positive
din input bus positive
dout output bus positive

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages