SystemVerilog assertions (SVAs) offer a powerful w...
# adiabatonauts
a
SystemVerilog assertions (SVAs) offer a powerful way to enhance the verification of complex digital designs. One of the most interesting aspects of SVAs is their ability to concisely specify complex temporal behavior. This feature is particularly useful for verifying the timing and sequence of events in a digital system. Full course on SVA - https://vlsideepdive.com/introduction-to-system-verilog-assertions-and-functional-coverage-video-course/ -> Imagine you're designing a communication interface where a data_ready signal must be asserted exactly 3 clock cycles after a start_transfer signal is asserted. This timing is critical for the interface's correct operation. ---------------------------- SVA ------------------------------------ property p_data_ready_after_start; @(posedge clk) start_transfer |-> ##3 data_ready; endproperty; assert property (p_data_ready_after_start) else $error("Data Ready signal was not asserted 3 cycles after Start Transfer!"); ------------------------------------------------------------------------- -> Consider a FIFO buffer where data is written (write_enable) and read (read_enable). It's essential to ensure that when the FIFO is full (fifo_full), no more data is written, preventing data overflow. ---------------------------- SVA ------------------------------------ property p_no_write_when_full; @(posedge clk) fifo_full |-> !write_enable; endproperty; assert property (p_no_write_when_full) else $error("Attempt to write to a full FIFO detected!"); The assertion uses the implication operator (|->) to specify that whenever the FIFO is full (fifo_full), on the next clock cycle, the write_enable signal must not be active. The @(posedge clk) notation means this condition is checked at every positive edge of the clock. If the FIFO is full but a write is attempted, the assertion will fail, triggering an error message. This helps quickly identify and prevent data integrity issues. Slack Conversation