Anari Sim Viewer PresentationΒΆ
Anari Sim Viewer
2
ASV - Graph & Waveform
β Graph (1)
β Visualizes the structure of the
gears and the channels
β Exploring the design by
navigating through the gears
β Channels can be picked from
the graph and visualized on
the waveform
β Waveform (2)
β Visualizes a channelβs
dataflow and state changes by
cycles
(1)
(2)
ASV is consisted of 2 main components:
4
ASV - Meaning of wave colors on waveform diagram
5
How to prepare your code for ASV
ASV is expecting JSON format as input, thus itβs needed to convert VCD to JSON
To do that adding line reg['debug/webviewer'] = True in code will do that.
JSON file will be in the same location as VCD file
6
Example of code that will generate JSON
from pygears import gear, reg
from pygears.typing import Uint
from pygears.lib import drv, collect, dreg
from pygears.sim import sim, cosim
#simulation config
reg['debug/trace'] = ['*'] #tracing all interfaces
reg['debug/webviewer'] = True #converting VCD to JSON for ASV
@gear
def add(a: Uint[4], b: Uint[4]):
return a + b | dreg #Register added for fun
def testbench():
res_list = []
drv_a = drv(t=Uint[4], seq=[4, 2])
drv_b = drv(t=Uint[4], seq=[2, 1])
add(drv_a, drv_b) \
| collect(result=res_list)
cosim(top="/add",sim="verilator",outdir="/Users/john/Downloads/add_example/",timeout=10)
sim(resdir="/Users/john/Downloads/add_example/")
testbench()
7