[chip dv xcelium] Fix macro recursion bug reported by Xcelium
This piece of logic was recently wrapped in `DV_SPINWAIT` loop.
This worked with VCS, but it did not with Xcelium. Xcelium reported
an interesting compile error stating that the first argument of this
macro `WAIT_` itself had a `DV_WAIT` invocation within, resulting in
infinite recursion of macro unpacking.
Looking at the code more, it does not seem like the wrapping is
needed in the first place, since the while loop internall has a
spinwait which will kill the sim if it exceeded our runtime.
Signed-off-by: Srikrishna Iyer <sriyer@google.com>
diff --git a/hw/top_earlgrey/dv/env/seq_lib/chip_sw_base_vseq.sv b/hw/top_earlgrey/dv/env/seq_lib/chip_sw_base_vseq.sv
index b9d64a2..e4e1a2f 100644
--- a/hw/top_earlgrey/dv/env/seq_lib/chip_sw_base_vseq.sv
+++ b/hw/top_earlgrey/dv/env/seq_lib/chip_sw_base_vseq.sv
@@ -241,23 +241,22 @@
`DV_CHECK_EQ_FATAL((sw_byte_q.size % SPI_FRAME_BYTE_SIZE), 0,
"SPI data isn't aligned with frame size")
- `DV_SPINWAIT(
- while (sw_byte_q.size > byte_cnt) begin
- `uvm_create_on(m_spi_host_seq, p_sequencer.spi_sequencer_h)
- for (int i = byte_cnt; i < SPI_FRAME_BYTE_SIZE; i++) begin
- `uvm_info(`gfn, $sformatf("SPI flash data[%0d] = 0x%0x", i, sw_byte_q[i]), UVM_LOW)
- end
- `DV_CHECK_RANDOMIZE_WITH_FATAL(m_spi_host_seq,
- data.size() == SPI_FRAME_BYTE_SIZE;
- foreach (data[i]) {data[i] == sw_byte_q[byte_cnt+i];})
- `uvm_send(m_spi_host_seq)
- `DV_WAIT(string'(cfg.sw_logger_vif.printed_log) ==
- $sformatf("Frame #%0d processed done", num_frame))
- num_frame++;
-
- byte_cnt += SPI_FRAME_BYTE_SIZE;
+ while (sw_byte_q.size > byte_cnt) begin
+ `uvm_create_on(m_spi_host_seq, p_sequencer.spi_sequencer_h)
+ for (int i = byte_cnt; i < SPI_FRAME_BYTE_SIZE; i++) begin
+ `uvm_info(`gfn, $sformatf("SPI flash data[%0d] = 0x%0x", i, sw_byte_q[i]), UVM_LOW)
end
- )
+ `DV_CHECK_RANDOMIZE_WITH_FATAL(m_spi_host_seq,
+ data.size() == SPI_FRAME_BYTE_SIZE;
+ foreach (data[i]) {data[i] == sw_byte_q[byte_cnt+i];})
+ `uvm_send(m_spi_host_seq)
+ `DV_WAIT(string'(cfg.sw_logger_vif.printed_log) ==
+ $sformatf("Frame #%0d processed done", num_frame))
+ num_frame++;
+
+ byte_cnt += SPI_FRAME_BYTE_SIZE;
+ end
+
endtask
virtual function void read_sw_frames(string sw_image, ref byte sw_byte_q[$]);