AndreasLoow / vv

Verilog visualiser

Home Page:https://andreasloow.github.io/vv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Verilog Visualiser (VV)

VV is an interactive simulator for Verilog that visualises Verilog's simulation semantics, in particular, Verilog's stratified event queue, as described by the (System)Verilog standard. The standard is available for free online.

A live demo of the tool is available at andreasloow.github.io/vv (no installation needed). See the dropdown menu (top left) in the demo containing a collection of (commented) Verilog modules illustrating various aspects of Verilog's semantics.

The example modules available in the demo are available as files in the directory examples (such that they can, e.g., be loaded into a traditional Verilog simulator to compare the execution in the simulator with the execution in VV). (EDA playground has a few simulators available online as well.)

Implementation details

VV is implemented in ReScript, an OCaml dialect of JavaScript. The front-end uses React. For parsing Verilog files, Ohm is used (whose error reporting leaves much to be desired). After parsing, some simple checks are done by src/Elaborator.res and the parse tree is compiled to an internal representation by src/Compiler.res; the internal representation is unstructured (gotos) instead of structured (as Verilog: if, etc.), making pausing execution easier. See src/Verilog.res for the core of the simulator. The front-end of the tool is in src/Simulator.res.

When adding new example modules, run examples/compile.hs to generate an updated src/Templates.res file.

The template vitejs-template-react-rescript was used as a basis for the current setup. Some of the following is sometimes useful to remember:

npx degit jihchi/vitejs-template-react-rescript my-vitejs-react-rescript
cd my-vitejs-react-rescript
npm i
npm start

The files for GitHub pages are in the branch "website".

About

Verilog visualiser

https://andreasloow.github.io/vv


Languages

Language:ReScript 74.3%Language:JavaScript 12.6%Language:SystemVerilog 10.4%Language:CSS 0.9%Language:Verilog 0.7%Language:TypeScript 0.5%Language:HTML 0.3%Language:Python 0.3%