Skip to main content

Generate symbol schematics for hardware IP cores.

Project description

SiliconSuite-SymbolGenerator

Generate symbol schematics for hardware IP cores.

Installation

To install the package using pip, run the following command:

pip install siliconsuite-symbol-generator

Example

The tool takes a symbol descriptor file in a custom format as input. The first line is the title, it should be the human readable name of the component. The second line is the subtitle, it should be the programming name of the component. All the other lines describe ports.

Each port has a label (without spaces) and is characterized by an arrow. The arrow comes before the label for the ports on the left side, and the opposite for the right side. The arrow direction indicates the direction of the port (input or output), and the line indicates the bus type (- for a single bit and = for multi-bit). An optional secondary label can be added on the port line by specifying it within square brackets [...] between two line characters, this is expected to indicate the width of the signal. On each line of the file, there can be ports on either sides, both, or neither to jump a line.

Here is an example of a simple symbol descriptor file named simple_buffer.sss :

Simple Buffer
valid_ready_simple_buffer
-----------> clock
-----------> resetn
==[WIDTH]==> write_data     read_data ==[WIDTH]==>
-----------> write_valid   read_valid ----------->
<----------- write_ready   read_ready <-----------
<----------- empty               full ----------->

To generate the symbol schematic from this descriptor file, run the following command in your terminal. Note that you can use the --scale argument to apply a scaling factor to the whole schematic. A scaling factor of 2 to 4 is recommended for most usecases.

symbol-generator simple_buffer.sss --scale 2

This will create the following SVG file named simple_buffer.svg :

simple_buffer.svg

Note that if you view this readme in a website or application that doesn't support dark mode correctly (such as PyPI), the example diagram might not be visible. Dark mode support can be disabled when generating the diagram (see section below).

If multiple files are provided (with a list or a wildcard pattern), each descriptor will be processed individually and rendered in the corresponding location.

The tool also generates a DrawIO symbol that differs slightly from the SVG :

simple_buffer.drawio.svg

Theme

The visual appearance of the generated symbol (e.g., padding, font sizes, arrow dimensions, colors) can be customized through a YAML theme file. The tool comes with a default theme (default_theme.yaml) located within the package.

You can create your own theme file and specify only the settings you want to change. Any settings omitted from your custom theme file will retain their values from the default theme. Use the --theme or -t command-line argument to specify your custom theme file:

symbol-generator input.sss --theme path/to/your/theme.yaml

The theme file can also contain target specific attributes that overwrite the root ones by putting them in a svg: or drawio: section.

Refer to the default_theme.yaml file in the package source for the available options and their structure.

Dark mode

By default, the SVG symbol will be generated with a CSS style that automatically inverts the luminance of all colors when the SVG is viewed in dark mode. This can be disabled by passing the command-line argument --no-dark-mode.

Transparent background

For certain applications, it is desirable that the background of the box be transparent. The command-line argument --no-background overrides the theme and sets the box background to transparent.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

siliconsuite_symbol_generator-1.5.0.tar.gz (93.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

siliconsuite_symbol_generator-1.5.0-py3-none-any.whl (122.3 kB view details)

Uploaded Python 3

File details

Details for the file siliconsuite_symbol_generator-1.5.0.tar.gz.

File metadata

File hashes

Hashes for siliconsuite_symbol_generator-1.5.0.tar.gz
Algorithm Hash digest
SHA256 ec988dd4d2baa04bdbb5429e8f741d326e6611cb93671717a9a0135bde827439
MD5 fa5b4546a218f58ccaa284e1e66c7c21
BLAKE2b-256 2746163bbdf13f61822d511bd7ad6d6a2d62c3c5bdec0df24fef622088da9610

See more details on using hashes here.

File details

Details for the file siliconsuite_symbol_generator-1.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for siliconsuite_symbol_generator-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b74d69cbec69dee4f73821d9f3519f11415eb6b1205cb529acea1e69ffca2e9
MD5 46a3764d97d9c7b9b3e0e53875e175c1
BLAKE2b-256 3029ca09d458aa82835ae9710dcaeaa057bcee274e2560dc754a5aec7e4e5e64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page