CocotbExt Wavedrom diagram generator
Project description
Cocotb Waves
Table of Contents
Introduction
This repository contains wavedrom svg generator for cocotb sims.
Installation
Installation from pip (release version, stable):
$ pip install cocotbext-waves
Usage
Example sampling AHB signals using cocotbext-ahb
.
from cocotbext.waves import waveform
...
waves = waveform(
clk=dut.hclk, name="ahb_test", hscale=3, debug=True
)
waves.add_signal(
[
dut.hsel,
dut.haddr,
dut.hburst,
dut.hsize,
dut.htrans,
dut.hwdata,
dut.hwrite,
dut.hready_in,
],
group="MOSI",
)
waves.add_signal(
[
dut.hrdata,
dut.hready,
dut.hresp,
],
group="MISO",
)
waves.start()
...
<Running sim, issuing txns>
...
waves.save()
waves.save_txt()
Output:
Classes & Methods
Class waveform
class waveform:
def __init__(
self,
clk,
name,
hscale: int = 2,
is_posedge: bool = True,
debug: bool = False,
start: bool = True
) -> None:
- clk: Synchronous clock used as the sample the signals
- name: Defines the object / filename, also part of the diagram header
- hscale: Horizontal scale for the SVG
- is_posedge: Defines clock model
- debug: Enable some debug messages
- start: Starts the signal monitoring
.start()/.stop()
Optional start/stop the sampling to create the diagram.y
.add_trigger(handle, val)
Adds a trigger to start sampling the signal, starts when handle.value == val.
.add_signal(color, is_clock, is_posedge_clock, clock_period, group)
Adds a signal to be monitored in the diagram. If it is a clock, other arguments can be populated, please note that signals from the same group have to be declared in a single method call.
.set_head/foot(text, tick, every)
Set header/foot propertries of the diagram, more info on wavedrom website.
.save_svg()
Stops the sampling and convert into SVG the final diagram.
.save_txt()
Stops the sampling and convert into .txt fmt the json.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cocotbext_waves-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9053c00ea6aba6d05142e5dd3a67a912e2b8b78296877fdd6d5fcd5ab4615822 |
|
MD5 | fc5afbda830ad28bfbe4f4d21e0e0ca1 |
|
BLAKE2b-256 | 0337a9881d91d5265ee35ca8364b61995e70f0ebb4c419e238e657ce74d2c5d9 |