systemverilog bind

Edit code - EDA Playground

// Code your testbench here
// or browse Examples

module dut(clk,rst_n,vld,rdy,data);
  input clk;
  input rst_n;
  input vld;
  output reg rdy;
  output reg[31:0] data; // 注意要写reg这个数据类型哦,wire,line18会报错
  
  bit[31:0] count;
  
  always @(posedge clk) begin
    if(rst_n == 0)begin
    end
    else begin
      count ++;
      data <= count; //line 18
      //$display("dut data is %d",data);
      if(count == 150)begin
        $finish;
      end
    end
  end
endmodule

module dut_assert(clk_sva,rst_n_sva,vld_sva,rdy_sva,data_sva);
  input clk_sva,rst_n_sva,vld_sva;
  input rdy_sva;
  input reg[31:0] data_sva; //注意是input哦,不要写成output了,结合bind,要写成input。
  
  //initial begin // 注意一开始一直没办法输出数据,只能输出一个x态,data sva is x,发现initial 用错了,initial只会被调用一次࿰
  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
There are some simple tricks that every design engineer should know to facilitate the usage of SystemVerilog Assertions. Although this paper is not intended to be a comprehensive tutorial on SystemVerilog Assertions, it is worthwhile to give a simplified definition of a property and the concurrent assertion of a property. 1.1 What is an assertion? An assertion is basically a "statement of fact" or "claim of truth" made about a design by a design or verification engineer. An engineer will assert or "claim" that certain conditions are always true or never true about a design. If that claim can ever be proven false, then the assertion fails (the "claim" was false). Assertions essentially become active design comments, and one important methodology treats them exactly like active design comments. More on this in Section 2. A trusted colleague and formal analysis expert[1] reports that for formal analysis, describing what should never happen using "not sequence" assertions is even more important than using assertions to describe always true conditions. 1.2 What is a property? A property is basically a rule that will be asserted (enabled) to passively test a design. The property can be a simple Boolean test regarding conditions that should always hold true about the design, or it can be a sampled sequence of signals that should follow a legal and prescribed protocol. For formal analysis, a property describes the environment of the block under verification, i.e. what is legal behavior of the inputs. 1.3 Two types of SystemVerilog assertions SystemVerilog has two types of assertions: (1) Immediate assertions (2) Concurrent assertions Immediate assertions execute once and are placed inline with the code. Immediate assertions are not exceptionally useful except in a few places, which are detailed in Section 3.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值