Git Product home page Git Product logo

vcd's Introduction

Linux MacOS Windows NPM version PayPal donate button Coverage Status

EDITOR | TUTORIAL

Introduction

WaveDrom is a Free and Open Source online digital timing diagram (waveform) rendering engine that uses javascript, HTML5 and SVG to convert a WaveJSON input text description into SVG vector graphics.

WaveJSON is an application of the JSON format. The purpose of WaveJSON is to provide a compact exchange format for digital timing diagrams utilized by digital HW / IC engineers.

The engine is using WaveDromSkin skin mechanism to render a complete picture.

Server

svg.wavedrom.com

![Alt](https://svg.wavedrom.com/github/<USER>/<REPO>/<BRANCH>/<PATH>/<FILENAME>.json5)
![signal step4](https://svg.wavedrom.com/github/wavedrom/wavedrom/trunk/test/signal-step4.json5)

signal step4

![reg vl](https://svg.wavedrom.com/github/wavedrom/wavedrom/trunk/test/reg-vl.json5)

reg vl

<img src="https://svg.wavedrom.com/{WAVEDROM SOURCE}/>
<img src="https://svg.wavedrom.com/{signal:[{name:'clk',wave:'p......'},{name:'bus',wave:'x.34.5x',data:'head body tail'},{name:'wire',wave:'0.1..0.'}]}"/>

Web usage

WaveDrom timing diagrams can be embedded into the web pages, blogs, and wikis to be rendered by the most of modern browsers.

HTML pages

There are three steps to insert WaveDrom diagrams directly into your page:

  1. Put the following line into your HTML page <header> or <body>:

From a CDN:

<script src="https://cdnjs.cloudflare.com/ajax/libs/wavedrom/3.1.0/skins/default.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/wavedrom/3.1.0/wavedrom.min.js" type="text/javascript"></script>
  1. Set the onload event for the HTML body.
<body onload="WaveDrom.ProcessAll()">
  1. Insert WaveJSON source inside HTML <body> wrapped with the <script> tag:
<script type="WaveDrom">
{ signal : [
  { name: "clk",  wave: "p......" },
  { name: "bus",  wave: "x.34.5x",   data: "head body tail" },
  { name: "wire", wave: "0.1..0." },
]}
</script>

The script will find all <script type="WaveDrom"> instances and insert a timing diagram at that point.

impress.js

(http://wavedrom.com/impress.html)

Blogs & Wikis

ObservableHQ examples: (https://observablehq.com/collection/@drom/wavedrom)

Blogger integration: (http://wavedrom.blogspot.com/2011/08/wavedrom-digital-timing-diagram-in-your.html)

MediaWiki integration: (https://github.com/Martoni/mediawiki_wavedrom)

Editor

WaveDromEditor is an online real-time editor of digital timing diagrams based on the WaveDrom engine and WaveJSON format.

Standalone WaveDromEditor

Windows

  1. Download latest wavedrom-editor-v2.4.2-win-{ia32|x64}.zip release from here: releases
  2. Unzip it into a working directory.
  3. Run the editor: wavedrom-editor.exe

Linux

  1. Download the latest wavedrom-editor-v2.4.2-linux-{ia32|x64}.tar.gz release from here: releases
  2. unzip-untar the package: tar -xvzf wavedrom-editor-v2.3.2-linux-x64.tar.gz
  3. Run the editor: ./WaveDromEditor/linux64/wavedrom-editor

OS X

  1. Download the latest wavedrom-editor-v2.4.2-osx-x64.zip release from here: releases
  2. Unzip
  3. Run

Community

Please use the WaveDrom user group for discussions, questions, ideas, or whatever.

Contributing

Contributing

License

See LICENSE.

vcd's People

Contributors

drom avatar esromneb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vcd's Issues

Parsing issue in windows files.

Hello!

While I was testing the integration in TerosHDL and I have found this issue.
I have generated an VDC with ghdl for the same test in windows and linux. The linux generated file is correctly rendered, but windows' file not :(
After a quick investigation I think the issue is related with "new line" characters in windows.

I attach the generated VCDs. The results can be easily seen here: https://drom.io/vcd
wave.zip
/

Non stream mode required

I like this stream reader behavior, but it is overkill when the whole file is available. I just want a method, which gives back the fully parsed file, with all of the value changes.

I need a similar behavior to this, (just, that has some bug...)

compressed VCD

Compress while simulating

size ratio time
524949795
zip -9 44136617 11.9 2:03
gzip -9 44136449 11.9 1:54
bzip2 -9 14546929 36.1 0:20
rar -m5 8272469 63.5 0:04
7z -mx9 4680285 112.2 0:48
xz -9 4615656 113.7 1:23
lz -9 4042797 129.8 5:27

Decompress in Browser

References

support for multiple triggers

$.change -- Extend Trigger EventEmitter to manage list of VCD triggers.

  • manage VCD trigger list inside parser via standard EvenEmitter API

proper 4-state parser

https://github.com/wavedrom/vcd/blob/master/vcd_spans.c#L142

Current lazy way of parsing binary values:

int vectorSpan(vcd_parser_t* state, const unsigned char* p, const unsigned char* endp) {
  state->value = strtoul((const char *)p, (char **)&endp, 2);
  state->mask = 0;
  return 0;
}

It will brake on:

  • literals longer then 64-bit
  • literals with x and z in the body (not important for Veriltor, but important for 4-state simulators)
  • real literals (low priority)

Proper parser should encode produce value and mask with data bits encoded the following way:

       0 1 x z
value: 0 1 0 1
mask:  0 0 1 1

use p.code.addMul(...) API

generate random VCD file

Write generator for constraint random VCD file with specific properties:

  • Number of signals
  • Total simulation cycles
  • Change density
  • Random seed

JS script?
C/C++ generator?

compact form for bit vector literals

Verilog allows bit vectors or arbitrary width. Example wire [26:0] state
VCD dump state changes like b101010101010101010101010101
We need a compact binary form of storing such constants.

LEB128 option

MSB --------------------------- LSB
        101010101010101010101010101 27-bit raw binary
       0101010101010101010101010101 Padded to a multiple of 7 bits
 0101010  1010101  0101010  1010101 Split into 7-bit groups
00101010 11010101 10101010 11010101 Add high 1 bits on all but last (most significant) group to form bytes
    0x2A     0xD5     0xAA     0xD5 In hexadecimal
-> D5 AA D5 2A                      Output stream (LSB to MSB)

Verilog / VCD also allows 4-state values like: b10101zzzz01010101xxxx010101

That can be represented as mask value:

       0 1 x z
value: 0 1 0 1
mask:  0 0 1 1

Mask also can be LEB128 encoded.
In the case of a 2-state vector, mask will occupy 1 byte.

vcd2vcd tool

vcd2vcd the tool to filter:

  • only needed signals
  • only specific time range
  • processing based on specific filter function

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.