0

我有以下接口:

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;   
endinterface



interface tx_out_interface (input bit clk, input bit tx_srstn);
   //dut output
   logic [15:0] y;
   int chind2;   
endinterface

我想检查每次 sin 等于 1(dec) y 将是xi/sqrt(2),并且每次 cos 等于 1(dec) y 将是xq/sqrt(2)

我可以使用特定类型的 systemVerilog 断言(不使用记分板或覆盖范围)来做到这一点吗?

4

2 回答 2

1

是的,我认为您可以简单地编写以下 2 个属性。

property sin_check;
  (sin == 'd1) |-> y == (xi/sqrt(2));
endproperty

property cos_check;
  (cos == 'd1) |-> y == (xq/sqrt(2));
endproperty
于 2017-02-28T06:41:41.143 回答
0

以下 2 个断言可以验证您指定的条件:

//Creating instances of interface 
tx_in_interface tx_i; 
tx_out_interface tx_o;

//Checking conditions 
assert property (@posedge tx_i.clk) (tx_i.sin == 1) |-> tx_o.y == (tx_i.xi/sqrt(2)); 
else $error("Sine output error!");

assert property (@posedge tx_o.clk) (tx_i.cos == 1) |-> tx_o.y == (xq/sqrt(2)); 
else $error("Cos output error!");

Duolos 的SystemVerilog 断言教程是一个极好的资源。

于 2018-03-18T03:16:24.437 回答