Git Product home page Git Product logo

undulate's Introduction

Undulate

CircleCI

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.

However, this great tool need either a headless web browser or node.js to generate documentations. Python being mainstream and cross-platform why not leverage its power?

This version is not a mere copy of the original one. The goals are to ensure the compatibility and to add new features. To name a few:

  • long name for nodes for creating edges from one specific point to another
  • metastability wave
  • analogue waveforms (step, capacitive step, slewing, arbitrary waves, overlay up to 4 waves)
  • add annotations (global time compression, vertical/horizontal lines)
  • style overloading (font-size, fill color, stroke color, stroke-width, stroke-dasharray, ...)

The inputs could be either:

  • json
  • WaveJSON (cson)
  • yaml
  • toml

while outputs would be:

  • svg for web pages
  • postscript for latex documentation
  • pdf for pdflatex documentation
  • png for word, libreoffice, ...

Documentation

The complete documentation is available here

License

See LICENSE.

Installation

It is recommended to create a python environment to not pollute the python of your operating system.

⁉️ some OS relies on specific version of python packages. One use a workflow with specific tools. To not break this vital components, the environment boxes in a specific location packages and dependencies.
Tools: pyenv virtualenv lmod

If it's intended, or you do it on purpose, you can skip directly to step #3.

1. create a new environment

With pyenv:

pyenv virtualenv <name-of-the-environment>

with virtualenv package:

python3 -m venv <path where to store the environments>

2. Activate the newly created environment

With pyenv:

pyenv activate <name-of-the-environment>

with virtualenv package:

source <path where to store the environments>/bin/activate

3. Finally, install it

python3 -m pip install git+https://github.com/LudwigCRON/undulate.git

4. Use it!

From now on, in the environment, you can call the script directly wherever you are

cd ${HOME}/projects/my-fancy-thing/documents/
undulate -f cairo-png --dpi 300 -i input.yaml -o output.png

To deactivate your environment call in the terminal

deactivate

undulate's People

Contributors

drom avatar itsayellow avatar ludwigcron avatar martoni avatar maximeborges avatar petermortensen 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

Forkers

mfkiwl

undulate's Issues

Adjust default color based with a css

There is a default color and style for the overall picture.

However, to reflect the color of a given company, almost every single line shall overload color.

An option as

undulate -s `path to css file`
undulate --style `path to css file`

Wavedrom compatibility is broken

Current version on master branch breaks the compatibility with wavedrom. This can be seen on the adcec.jsonml testcase with several signal with the same name in the same group.

In addition to that there is discrepency on nh behaviour.

align ticks with phase

there is regularly dotted vertical grey lines. They usually are aligned witht the rising edge of nNpP blocks. However, when the parameter phase is added, only the signal is phased out.

Ticks should stick to the rising edge of nNpP

Wrong anchor position for edges

With overlay/scale combination the position of the anchor is incorrect
image

and the code generating the image is the following:

spacer:
    wave: ""


Analog:
    VDD50OTP:
        wave: "s....."
        slewing: 128
        analogue:
          - VDDA
        overlay: true
        vscale: 2
        order: 1
    
    VPP:
        wave: "l.......s..."
        node: "........#... vpp_rdy"
        slewing: 20
        vscale: 2
        analogue:
          - VDDA
        order: 3

Ports:
    POWER_UP:
        wave: "l..10..."
        node: "...#.... pwr_up_req"

OTP Shell:
    ms_otp_shell_vpp_mode[1:0]:
        wave: "=.......=..."
        node: "........#... mux_chng"
        data:
          - "0"
          - "1"
    CEB:
        wave: "1.....0......"
        node: "......#...... active"

annotations:
    - shape: "||"
      x: 4.5
      from: 1.0
    - shape: "||"
      x: 6.5
      from: 1.0
    # vpp change origin
    - shape: "~->"
      from: pwr_up_req
      to: mux_chng
    - shape: "-~>"
      from: mux_chng
      to: vpp_rdy
    # ceb change origin
    - shape: "~->"
      from: pwr_up_req
      to: active
    # timing delimitation
    - shape: "|"
      x: 3.2
      stroke: "#DB4140"
      stroke-dasharray: [1,3]
    - shape: "|"
      x: 6.05
      stroke: "#DB4140"
      stroke-dasharray: [1,3]
    - shape: "|"
      x: 8.25
      stroke: "#DB4140"
      stroke-dasharray: [1,3]
    # timing arrows
    - shape: "<->"
      from: (3.2, 0.25)
      to: (6.05, 0.25)
      text: "> 100 ns"
    - shape: "<->"
      from: (3.2, 0.95)
      to: (8.25, 0.95)
      text: "> 1 us"
      dx: 1.25

edges from one group to another group are not drawn

edges are drawn at the group level.

By default, without group, there is at least a group of level 0.
edges are drawn inside the wavegroup which is a recursive function.

Therefore, drawing an arrow from a node in a group 1 to a node in a group 2 is not drawn.

Render cool terminal version of wavedrom output

It would be awesome if undulate could render wavedrom output to console compatible output.

Here Is an example; https://github.com/mithro/i2cslave/blob/ad4335fb1ef5bb46d652e44b813c559f71b37409/i2cslave/targets/i2c_munger.py#L83-L98

             S   0       1       2       3       4       5       6       7       A
sda    ▔▔\▁▁▁▁▁----XXXX----XXXX----XXXX----XXXX----XXXX----XXXX----XXXX----▁▁▁▁▁▁▁▁▁/▔▔▔▔▔▔▔
sda_oe ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔\▁▁▁▁▁▁▁▁/▔▔▔▔▔▔▔
sda_w  ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
sda_r  ▔▔\▁▁▁▁▁1-------0-------1-------0-------0-------0-------0-------0------------/▔▔▔▔▔▔▔
scl_r  ▔▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔▔


             S   0       1       2       3       4       5       6      7
sda    ▔▔\▁▁▁▁▁----XXXX----XXXX----XXXX----XXXX----XXXX----XXXX----XXXX----XXXX----
sda_oe ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔\▁▁▁▁▁▁▁/▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
sda_w  ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
sda_r  ▔▔\▁▁▁▁▁1-------0-------1-------0-------0-------0-------0-------0-------/▔▔▔
scl_r  ▔▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔\▁▁▁/▔▔▔

JSON file incorrect parsed ?

This file:
std_memory_interface_v3.json.gz

is read correctly by wavedrom (npx wavedrom-cli -i std_memory_interface_v3.json -s test.png)

but fails with undulate:
undulate -f cairo-png --dpi 300 -i std_memory_interface_v3.json -o output.png
CRITICAL: Parsing Error detected: Expecting value at line 3

text background crop arrows

the background of the text crop the arrow
image

so either make transparent background
or create a layer management and add text in lower layer

Edge parsing limited

for an edge described as "a RX_DATA" is translated in wavedrom as an arrow with a text just above.

In pywave RX_DATA is considered as a node and not as a text

global hscale and annotations

On experiment is seems global hscale is not considered for the positionning of the annotations.
Therefore it does not consider local hscale too ?

image

annotations:
    - shape: "|"
      x: 2.15
      stroke-dasharray: [1, 3]
      stroke: "#db4141"
    - shape: "|"
      x: 3.0
      stroke-dasharray: [1, 3]
      stroke: "#db4141"
    - shape: "<->"
      from: (2.15, 3)
      to: (3, 3)
      text: "T   "
      dy: -0.2
      dx: -0.2
      fill: "#db4141"
      stroke: "#db4141"
      font-size: 0.4em

config:
    hscale: 0.5

Error message are confusing

For instance

undulate youpi.yaml
usage: undulate [-h] [-i INPUT] [-f FORMAT] [-r] [-d DPI] [-o OUTPUT]
undulate: error: unrecognized arguments: youpi.yaml

Would be better to tell "precise if the file is an input with -i or an output with -o"

improve safety of the application

In the analogue environment, the code use python eval() function.
eval() allows to call import and os functions considered a potential threats.

verilog generation

proposition of enhancement:

From the given input file, the tool can generate a verilog sequence for simulation purpose. This could save time to the designer and ensure it respect the specification.

this need a new inputs from the designer such as:

  • tick period: 20 (equal to #20 ; in verilog for a given timescale)
  • list of signal to be generated
  • list of signal to be asserted

annotation y coordinate system is difficult

jump between 4.99 and 5 of almost half a row and by default mid of the row is strange.
might a y coordinate system would be simplier.

Let's suppose be want to point to the 4th row on the top enter y=4 and to the bottom of the row 4.99. So the middle is y=4.5

Multiline text possibility

It would be nice to have \n support to allows multiline text either on annotations, or in the name of a signal ([signal name]\n[parameter value]), and even in digital data

|. does not propagate the previous signal after the gap

Since the first release, a signal could have a time compression by using |

However, one can consider to have a signal define as x=....|..... which means the signal is kept constant over a long time.

|. break the sequence and you should change for x=.....|=..... and repeat the data twice. It also occurs with others symbols.

Add support of from/to properties for global time compression

in the following toml is accepted.

[[annotations]]
shape = "||"
x = 2.5

However when using groups or spacer to have a blank line, the global time compression is behind possible other annotations. It make diagram difficult to read.

One could add several global time compression for each group such that the blank space is preserved and readability too.

Supporting from/to properties would results in something like below

[[annotations]]
shape = "||"
x = 2.5
from = 3
to = 7

[[annotations]]
shape = "||"
x = 2.5
from = 9
to = 12

Single argument mode

Based on the issues #31 and #32
it would be appealing to call the tool in the following manner

undulate <path to parent folder>/youpi.yaml

it is intended that the default configuration is used and the output file to be the in

  1. the current working directory ?
  2. the directory of the input file ?

The output file should be youpi.

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.