Skip to main content

Displays vcd files to the command line.

Project description

Sootty

Sootty is a graphical command-line tool for visualizing waveforms from hardware simulations, as a substitute for waveform visualizers like Verdi and GTKWave. It is designed with a focus on being lightweight and easy to use, and takes advantage of modern terminals’ capabilities to provide a clean graphical display. Current features include:

  • Customizable display style
  • Search and highlight events using a simple query language

And here's an example of how sootty can be used directly from the terminal:

Screenshot of sootty in action

Getting Started

  1. Install sootty using pip:
pip install sootty
  1. Display a waveform file to the terminal:
sootty "waveform.vcd" -o > image.svg

Optional arguments include:

  • -s | --start FORMULA Specify the start of the window.
  • -e | --end FORMULA Specify the end of the window.
  • -l | --length N Specify the number of ticks in the window (mutually exclusive with -e).
  • -o | --output Print svg data to stdout rather than display on terminal.
  • -w | --wires LIST Comma-separated list of wires to include in the visualization (default to all wires).
  • -b | --break FORMULA Specify the formula for the points in time to be highlighted.
  • -r | --radix N Display values in radix N (default 10).
  • -S | --save SAVENAME Saves current query for future reuse.
  • -R | --reload SAVENAME Loads a saved query. Requires query name as string.
  • --btable Print the wire value table at breakpoints to stdout (-b is required).

*Note: For more detailed information on the query language, check out syntax.md

Examples

Below are some more examples that take advantage of some of the features sootty has to offer:

  • Display all wires starting at time 4 and ending at wire clk's tenth tick:
sootty "example/example3.vcd" -s "time 4" -e "acc clk == const 10" -w "clk,rst_n,pc,inst"
  • Display wires Data and D1 for 8 units of time starting when Data is equal to 20:
sootty "example/example1.vcd" -l 8 -s "Data == const 20" -w "D1,Data"
  • Saving a query for future use:
sootty "example/example2.vcd" -s "rdata && wdata == const 22" -l 10 -w "rdata, wdata" -S "save.txt"
  • Reloading a saved query:
sootty -R "save.txt"
  • Add breakpoints at time 9, 11, and 16 - 17 and print wire values at breakpoints:
sootty "example/example5.evcd" -b "time 9 || time 11 || after time 15 && before time 18" --btable

Running with python

Sootty can also be run from within a python program:

from sootty import WireTrace, Visualizer, Style
from sootty.utils import evcd2vcd

# Create wiretrace object from vcd file:
wiretrace = WireTrace.from_vcd_file("example/example1.vcd")

# Convert wiretrace to svg:
image = Visualizer(Style.Dark).to_svg(wiretrace, start=0, length=8)

# Display to stdout:
image.display()

# Manually convert EVCD file to VCD file:
with open('myevcd.evcd', 'rb') as evcd_stream:
    vcd_reader = evcd2vcd(evcd_stream)
    with open('myvcd.vcd', 'wb') as vcd_stream:
        vcd_stream.write(vcd_reader.read())

Note: You can view and modify the save files for the queries in the ~/.config/sootty/save directory.

Dependencies

As of the current release, Sootty can only display images in certain terminals with builtin graphics support. This currently includes the following terminal replacements:

The following external dependencies are also needed to properly display images within the terminal:

  • viu

    # From source (rust package manager)
    cargo install viu
    # MacOS
    brew install viu
    # Arch Linux
    pacman -S viu
    
  • rsvg-convert

    # Ubuntu
    apt install librsvg2-bin
    # MacOS
    brew install librsvg
    

Contributing

If you are interested in contributing to this project, feel free to take a look at the existing issues and submit a PR. Beginners are encouraged to focus on issues with the "good first issue" label. This project has also been involved with Google Summer of Code through the FOSSi Foundation. Check out our project idea for GSoC '23: https://www.fossi-foundation.org/gsoc23-ideas#enhancing-the-sootty-terminal-based-graphical-waveform-viewer

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

sootty-1.0.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

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

sootty-1.0-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file sootty-1.0.tar.gz.

File metadata

  • Download URL: sootty-1.0.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.30.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.2

File hashes

Hashes for sootty-1.0.tar.gz
Algorithm Hash digest
SHA256 138a9a220493bf36e6331e6b93f47d45d93d48116809dce6783a5186eb9dc48c
MD5 7dba1a7e430059f5bb23fd2289710c03
BLAKE2b-256 a6f3d3ca5883f22923458b1cbe98bee6fb6c0b75235504c1d9d0f193fb217908

See more details on using hashes here.

File details

Details for the file sootty-1.0-py3-none-any.whl.

File metadata

  • Download URL: sootty-1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.30.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.2

File hashes

Hashes for sootty-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1785773aa031a4a3723f1e728f8ecd44a398b10775332bc33f8c010c00a0785
MD5 739f371329a2f149482395edf3102926
BLAKE2b-256 31b062152522fe23f4c87daeade525820287fc4e5ad234cb67e79a179a9908f4

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