Assertion for statistics

In reply to saritr:


interface tx_in_interface (input bit clk, input bit tx_srstn);
   //dut input
   logic [15:0] xi;   
   logic [15:0] xq;   
   logic [15:0] sin;  
   logic [15:0] cos;  
   int 	chind2;   
   // Add an instance of tx_out <<-----------------------------------------
   tx_out_interface tx_out1(.*);
   typedef logic [15:0] WORD;
   // I want to check that every time sin equal to 1(decimal) y will be xi/sqrt(2), 
   always if(sin==4'H0001) 
         a_sin: assert(tx_out1.y == WORD'(xi/(2 ** 0.5)) ); 
   // see 1800'2012 11.4.3 Arithmetic operators 
 
   //and every time cos equal to 1(dec) y will be xq/sqrt(2) 
   always if(cos==4'H0001) 
          a_cos: assert(tx_out1.y == WORD'(xq /(2 ** 0.5)) ); 
endinterface
 
interface 
   //dut output
   logic [15:0] y;
   int chind2;   
endinterface


Ben systemverilog.us