Skip to content

Minor WaveDrom rendering fixes and improvements#486

Open
fdxmw wants to merge 1 commit into
UCSBarchlab:developmentfrom
fdxmw:wavedrom
Open

Minor WaveDrom rendering fixes and improvements#486
fdxmw wants to merge 1 commit into
UCSBarchlab:developmentfrom
fdxmw:wavedrom

Conversation

@fdxmw

@fdxmw fdxmw commented Jun 15, 2026

Copy link
Copy Markdown
Member
  • Rename trace_to_html to trace_to_json, and generalize the function so it just returns WaveJSON, which can be used by many different tools. Previously, trace_to_html returned HTML-embeddable WaveJSON, which is only useful for building a webpage.
  • Improve documentation for trace_to_json and add a doctest example.
  • Update render_trace to pass repr_func and repr_per_name to trace_to_json, to support custom data formatting in Jupyter notebooks. Many examples rely on these features.
  • Display cycle numbers above traces for consistency with the console renderer.
  • Fix example8's deprecated call to render_trace (pass wire names instead of WireVectors).
  • Use json.dumps in trace_to_json instead of doing JSON string formatting ourselves.
  • Move val_to_str to module-level, so it can be called from trace_to_json. Simplify val_to_str's implementation.
  • Remove renderer-demo from ipynb-examples. The different rendering options only work for the console renderer.

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.0%. Comparing base (3190056) to head (0dc4130).

Files with missing lines Patch % Lines
pyrtl/simulation.py 87.5% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           development    #486     +/-   ##
=============================================
+ Coverage         92.0%   92.0%   +0.1%     
=============================================
  Files               30      30             
  Lines             7439    7428     -11     
=============================================
- Hits              6837    6828      -9     
+ Misses             602     600      -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

* Rename `trace_to_html` to `trace_to_json`, and generalize the function so it
  just returns WaveJSON, which can be used by many different tools. Previously,
  `trace_to_html` returned HTML-embeddable WaveJSON, which is only useful for
  building a webpage.
* Improve documentation for `trace_to_json` and add a doctest example.
* Update `render_trace` to pass `repr_func` and `repr_per_name` to
  `trace_to_json`, to support custom data formatting in Jupyter notebooks. Many
  examples rely on these features.
* Display cycle numbers above traces for consistency with the console renderer.
* Fix example8's deprecated call to `render_trace` (pass wire names instead of
  `WireVector`s).
* Use `json.dumps` in `trace_to_json` instead of doing JSON string formatting
  ourselves.
* Move `val_to_str` to module-level, so it can be called from `trace_to_json`.
  Simplify `val_to_str`'s implementation.
* Remove `renderer-demo` from `ipynb-examples`. The different rendering options
  only work for the console renderer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant