Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yne/vcd

VCD file (Value Change Dump) command line viewer
https://github.com/yne/vcd

cli gtkwave vcd vhdl

Last synced: 2 months ago
JSON representation

VCD file (Value Change Dump) command line viewer

Awesome Lists containing this project

README

        

Value Change Dump (.vcd) command line viewer for Windows, Linux and MacOS

```yml
# SKIP=13 vcd < samples/basic.vcd
global:
zoom: 2
date: Fri Nov 21 16:56:29 2014
total: 43
skip: 13
time:
scale: 1.00
unit: fs
line : "13 23 33 "
channels:
default:
e_clk : "╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔"
e_rst : "▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔"
e_ren : "▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔╲▁▁▁╱▔▔▔╲▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁╱▔▔▔▔▔▔▔"
e_wen : "▁▁▁▁▁▁▁▁▁▁▁▁╱▔▔▔╲▁▁▁╱▔▔▔╲▁▁▁╱▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔"
e_d[3:0] : "3 3 4 4 5 5 Z Z 6 6 Z Z 7 7 Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z "
e_q[3:0] : "Z Z Z Z Z Z Z Z Z Z Z Z Z 3 3 Z Z 4 4 5 5 6 6 7 7 0 0 Z Z Z "
e_empty : "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁╱▔▔▔▔▔▔▔▔▔▔▔▔▔"
e_mid : "▁▁╱▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔╲▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"
e_full : "▁▁▁▁▁▁▁▁▁▁╱▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔╲▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"
fifo1:
clk : "╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔╲▁╱▔"
rst : "▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔"
ren : "▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔╲▁▁▁╱▔▔▔╲▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁╱▔▔▔▔▔▔▔"
wen : "▁▁▁▁▁▁▁▁▁▁▁▁╱▔▔▔╲▁▁▁╱▔▔▔╲▁▁▁╱▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔"
d[3:0] : "3 3 4 4 5 5 Z Z 6 6 Z Z 7 7 Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z "
q[3:0] : "Z Z Z Z Z Z Z Z Z Z Z Z Z 3 3 Z Z 4 4 5 5 6 6 7 7 0 0 Z Z Z "
empty : "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁╱▔▔▔▔▔▔▔▔▔▔▔▔▔"
mid : "▁▁╱▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔╲▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"
full : "▁▁▁▁▁▁▁▁▁▁╱▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔╲▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"
w_adr[1:0] : "2 3 3 0 0 1 1 1 1 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 "
r_adr[1:0] : "1 1 1 1 1 1 1 1 1 2 2 2 2 3 3 3 3 0 0 1 1 2 2 3 3 3 3 3 3 3 "
```

## Installation

### From prebuilt binary

Manually download install a [prebuilt binary](../../releases)

### From sources

```bash
make
sudo make install
```

### From Package Manager

Arch-based distribution:

```bash
yay -S vcd
```

## Usage

```bash
vcd < in.vcd # output to screen
vcd < in.vcd > out.yml # output to file
vcd < in.vcd | less -S # scrollable view
```

## Query

The default `vcd` output is a valid YAML file, so you can process it with many tools like [`yq`](https://github.com/mikefarah/yq) or [`shyaml`](https://github.com/0k/shyaml)

```bash
# print the first 9 sample of the clk channel in the fifo1 scope
vcd < samples/basic.vcd | yq .channels.fifo1.clk[0:9]
vcd < samples/basic.vcd | shyaml -y get-value channels.default.e_clk
```

## Styling

Waveform, position, color can be customized using environment variables.

```bash
# skip the 9 first samples
SKIP=9 vcd < in.vcd | less -S
# Disable RAISE/DROWN transition
RAISE="" DROWN="" vcd < in.vcd
# color the bus value in green using StartTeX/EndTeXt (STX/ETX) variables
STX=$(printf "\x1b[32m") ETX=$(printf "\x1b[0m") vcd < in.vcd
```

## Auto-Refresh

The following snippet endlessly wait for a change on the `in.vcd` file.
Then, when it happen, regenerate the `out.yml` graph and refresh the `less -S out.yml` scrollable display by sending a "R" keypress (for refreshing).

```bash
echo "hi ! please modify 'in.vcd' to refresh me" > out.yml
while inotifywait -q -e modify -e close_write in.vcd ; do
vcd < in.vcd > out.yml # regenerate out.yml
screen -x -r bridge -X stuff R # send Refresh command to foreground less -S
done & # this loop will run in background
screen -S bridge less -S out.yml # the foreground "less -S" display
# don't forget to stop the background loop using `kill %1` or fg + ^C
```