property queue_pop;
int loc;
@(posedge clk2) (1,loc=value_q.pop_back()) ##0 loc;
endproperty
I am still observing compilation issues with the following msg
Tool1 ::
** Error: Queue_pop_as_Seq_Expr.sv(23): The method ‘pop_back’ is not allowed in assertions as it has side effects.
Tool2 ::
Expressions involving real, realtime, string, event and dynamic SystemVerilog types including virtual interface references are not allowed
in local variable assignments in properties and sequences.
I checked SV LRM 2023 for this
16.6 Boolean expressions
Elements of dynamic arrays, queues, and associative arrays that are sampled for assertion expression
evaluation may get removed from the array or the array may get resized before the assertion
expression is evaluated. These specific array elements sampled for assertion expression evaluation
shall continue to exist within the scope of the assertion until the assertion expression evaluation
completes.
Sequence match items with a local variable as the variable_lvalue may use the C assignment,
increment, and decrement operators. Otherwise, evaluation of an expression shall not have any side
effects (e.g., the increment and decrement operators are not allowed).
The following worked with 2 tools, but gave me an error with another one.
module m(input bit valid, clk,
bit[31:0] addr);
// There is a valid,addr protocol similar to AXI.
// I want to write an assumption that last 16 valid addresses(with valid=1) has to be unique .
int mem_aarray[*]; // associative array (AA) to be used by property
//bit [31:0] raadata; // data read from AA
bit mem_aarray_exists; // exists at specified address
// assign mem_aarray_exists = mem_aarray.exists(addr);
function automatic void f0(); mem_aarray.delete; endfunction
function automatic bit f1(int addr);
return mem_aarray.exists(addr);
endfunction
property m_valid_addr;
bit v_err=0;
@(posedge clk) ($rose(valid) , f0()) |->
((valid, v_err=f1(addr)) ##0 !v_err)[*16]; // it should not exist
endproperty
am_valid_addr: assume property(m_valid_addr);
property m_valid_addr2; // line 22
bit v_err=0;
@(posedge clk) ($rose(valid) , f0()) |->
((valid, v_err=mem_aarray.exists(addr)) ##0 !v_err)[*16]; // it should not exist
endproperty
am_valid_addr2: assume property(m_valid_addr2);
endmodule
//Invalid type in local variable assign
testbench.sv, 22
m, "mem_aarray.exists(addr)"
Expressions involving real, realtime, string, event and dynamic
SystemVerilog types including virtual interface references are not allowed
in local variable assignments in properties and sequences.
Note: Using an external user-defined function call worked.
The integration of dynamic data structures, such as queues and associative arrays, into SystemVerilog assertions has sparked ongoing discussion in the hardware verification community. While these constructs enhance assertion capabilities, their support across EDA tools is inconsistent.
This paper addresses the challenges posed by the lack of uniform support for dynamic structures in SVA among tool vendors. It examines the current state of assertion support in major EDA tools, revealing disparities in handling queues and associative arrays. This inconsistency raises questions about the necessity and practicality of these complex structures in assertions.
Despite concerns, the benefits of using queues and associative arrays in specific verification scenarios are significant. The paper explores methods to implement these data structures in assertions, even without direct tool support. It presents techniques for efficient support logic, enabling verification engineers to utilize these structures while maintaining portability and performance.
Additionally, the paper demonstrates these techniques with a simulateable example and explores synthesizable logic as an alternative approach for formal verification environments. This solution aims to bridge the gap between simulation-based and formal verification methodologies.
Activate
Expressions that appear in concurrent assertions shall satisfy the following requirements:
- Expressions shall not reference non-static class properties or methods