From a7422c8b178dcb2673252352458162e746e2f85e Mon Sep 17 00:00:00 2001 From: Gabor Szita Date: Sun, 7 Sep 2025 23:04:31 +0200 Subject: [PATCH] Throw an exception if the user tries to render a trace without stepping the simulation --- pyrtl/simulation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyrtl/simulation.py b/pyrtl/simulation.py index 6c783533..cb58bc8f 100644 --- a/pyrtl/simulation.py +++ b/pyrtl/simulation.py @@ -1756,6 +1756,8 @@ def render_trace( is not found in the map, the argument ``repr_func`` will be used instead. :param segment_size: Traces are broken in the segments of this number of cycles. """ + if len(self) == 0: + raise PyrtlError("You need to step the simulation at least once to render a trace.") if repr_per_name is None: repr_per_name = {} if _currently_in_jupyter_notebook():