diff --git a/bench/servant_tb.cpp b/bench/servant_tb.cpp index f779b23..6afaa19 100644 --- a/bench/servant_tb.cpp +++ b/bench/servant_tb.cpp @@ -117,12 +117,21 @@ int main(int argc, char **argv, char **env) if (arg_timeout[0]) timeout = atoi(arg_timeout+9); + vluint64_t vcd_start = 0; + const char *arg_vcd_start = Verilated::commandArgsPlusMatch("vcd_start="); + if (arg_vcd_start[0]) + vcd_start = atoi(arg_vcd_start+11); + + bool dump = false; top->wb_clk = 1; bool q = top->q; while (!(done || Verilated::gotFinish())) { + if (tfp && !dump && (main_time > vcd_start)) { + dump = true; + } top->wb_rst = main_time < 100; top->eval(); - if (tfp) + if (dump) tfp->dump(main_time); if (baud_rate) do_uart(&uart_context, top->q); diff --git a/servant.core b/servant.core index 5d55d3b..5f441f1 100644 --- a/servant.core +++ b/servant.core @@ -102,7 +102,15 @@ targets: verilator_tb: default_tool: verilator filesets : [soc, verilator_tb] - parameters : [RISCV_FORMAL, firmware, memsize, signature, timeout, uart_baudrate, vcd] + parameters : + - RISCV_FORMAL + - firmware + - memsize + - signature + - timeout + - uart_baudrate + - vcd + - vcd_start tools: verilator: verilator_options : [--trace] @@ -155,6 +163,11 @@ parameters: datatype : bool paramtype : plusarg + vcd_start: + datatype : int + description : Delay start of VCD dumping until the specified time + paramtype : plusarg + generate: icebreaker_pll: generator: icepll