How can I write this SystemVerilog property without the use of a local variable?

31 Views Asked by At

I have written the following SystemVerilog property to verify that the number of bytes received in a frame equals the Rx_FrameSize signal. This solution is implemented with a local variable.

  /******************************************************************** *
   *  Specification 14                                                  *
   *  Rx FrameSize should equal the number of bytes received in a frame *
   *  (max. 126 bytes = 128 bytes in buffer – 2 FCS bytes).             *
   ******************************************************************** */

  property p14_Rx_FrameSize;
    int num_bytes = 0;
    @(posedge Clk) disable iff (!Rst) $rose(Rx_ValidFrame) ##0 ((##[7:9] $rose(Rx_NewByte), num_bytes++) [*1:128]) 
    ##5 ($rose(Rx_EoF) and
    !Rx_FrameError) |=>
    Rx_FrameSize == (num_bytes - 2); 
  endproperty

My problem is that Siemens OneSpin 360 does not support the use of local variables within properties, which results in the following error:

-E- UnsuppVerilog - assertions_hdlc.sv:129 Unsupported initialization of local variable.

My question is, how can I rewrite this property without the use of the local variable? Alternatively, is there some way to make OneSpin accept local variables within properties?

I have tried different data types, but with no success.

0

There are 0 best solutions below