# color styles
style_input = GTKWColor.orange
style_output = GTKWColor.yellow
+ style_debug = GTKWColor.red
with open(base_name + ".gtkw", "wt") as gtkw_file:
gtkw = GTKWSave(gtkw_file)
gtkw.comment("Auto-generated by " + loc)
datafmt='dec')
gtkw.trace(dut + "p_valid_i", color=style_input)
gtkw.trace(dut + "p_ready_o", color=style_output)
+ with gtkw.group("debug"):
+ gtkw.blank("Some debug statements")
+ # change the displayed name in the panel
+ gtkw.trace("top.zero", alias='zero delay shift',
+ color=style_debug)
with gtkw.group("internal"):
gtkw.trace(dut + "fsm_state")
gtkw.trace(dut + "count[3:0]")
sim = Simulator(m)
sim.add_clock(1e-6)
+ # demonstrates adding extra debug signal traces
+ # they end up in the top module
+ #
+ zero = Signal() # mark an interesting place
+
def send(data, shift, direction):
# present input data and assert valid_i
yield dut.p.data_i.data.eq(data)
# 3 << 4 = 48
yield from receive(48)
# 21 << 0 = 21
+ # you can look for the rising edge of this signal to quickly
+ # locate this point in the traces
+ yield zero.eq(1)
yield from receive(21)
+ yield zero.eq(0)
sim.add_sync_process(producer)
sim.add_sync_process(consumer)
sim_writer = sim.write_vcd(
"test_shifter.vcd",
+ # include additional signals in the trace dump
+ traces=[zero]
)
with sim_writer:
sim.run()