Namaste FPGA Technologies reposted this
Most common valid signal SV assertion checks for AXI DUTs. AXI is one of the bus protocols that everyone encounters at some point in their learning journey. Let us analyze the most common assertion checks related to the VALID signal that are included in almost all AXI DUTs. The first check ensures that all data and control signals have known values when VALID is asserted. We can use $isunknown to make sure all signals are valid whenever VALID is high. Instead of using individual $isunknown calls for each signal, we can concatenate all relevant signals into a single vector and check that none of its bits are unknown. This check is performed only when VALID is asserted, so VALID acts as the antecedent. We begin checking in the same clock tick using an overlapping implication operator (|->): aw_valid |-> !$isunknown({aw_addr, aw_id, aw_len, aw_size, aw_burst}); The second rule ensures that all control and data signals remain stable when VALID is high and READY has not yet been asserted by the slave. Again, we concatenate all signals inside $stable to confirm that the concatenated vector value remains unchanged compared to the previous clock tick. The antecedent checks that VALID is high while READY is low; once that evaluates to true, we need to verify that values stay stable using $stable. Since $stable compares values across two clock cycles, we use a non-overlapping implication operator (|=>) so that the check starts on the next clock tick. This guarantees that control and data signals stay constant while VALID is asserted and READY is low. aw_valid && !aw_ready |=> $stable({aw_addr, aw_len, aw_size, aw_burst}); The third rule ensures that VALID is not withdrawn abruptly in the middle of a handshake. Once VALID is asserted, it must remain high until READY is asserted. Deasserting VALID before READY is a protocol violation. The antecedent is when VALID is high and READY is low, and we ensure that VALID remains high in the next clock tick. aw_valid && !aw_ready |=> aw_valid; The fourth rule ensures that VALID remains deasserted while reset is active. Reset acts as the antecedent, and we perform the check in the same clock cycle to verify that VALID stays low when reset is asserted. !rst_n |-> !valid; Learn more about fundamentals of SV assertions from scratch here : https://lnkd.in/gm8r7eXh