Skip to content

Commit a7422c8

Browse files
committed
Throw an exception if the user tries to render a trace without stepping the simulation
1 parent 137ff35 commit a7422c8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pyrtl/simulation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,6 +1756,8 @@ def render_trace(
17561756
is not found in the map, the argument ``repr_func`` will be used instead.
17571757
:param segment_size: Traces are broken in the segments of this number of cycles.
17581758
"""
1759+
if len(self) == 0:
1760+
raise PyrtlError("You need to step the simulation at least once to render a trace.")
17591761
if repr_per_name is None:
17601762
repr_per_name = {}
17611763
if _currently_in_jupyter_notebook():

0 commit comments

Comments
 (0)