Verilog 时序仿真:+notimingcheck 与 +no_notifier

Verilog Timing Simulation: +notimingcheck versus +no_notifier

对于已使用 SDF 文件注释的门级仿真,当触发器上存在 setup/hold 违规时,默认情况下会发生以下情况:

但是,+notimingcheck+no_notifier 的效果是什么?你能同时使用这两个 Verilog 编译标志吗?

下面是我的猜测:(这是正确的还是完全错误的?)

对还是错?或者几乎正确?

首先,这两个选项不属于 Verilog 的 IEEE 标准(例如 1800-2017)。这意味着它们的行为是由模拟器定义的,并不是所有的模拟器都保证支持它们。我使用的 Cadence 和 Synopsys 的模拟器恰好支持它们。

其次,通知器行为取决于它们在 Verilog 代码中的使用方式,并且它们是可选的。请参阅 IEEE Std 1800-2017,第 31.6 节 通知程序:用户定义的对时序违规的响应。大多数标准单元库都会使用它们,但您需要查看 Verilog 代码以了解它们是如何在您的案例中实现的。当通知程序更改值时,您的 FF 可能会将输出设置为 X,但对于时序检查,通常情况并非如此。

这是我手边的一些代码,可以演示它们的用法:

module tb;
    reg  [3:0] addr;
    wire [3:0] addr2 = addr;
    reg ntfy_reg_p;
    reg ntfy_reg_n;

    specify
        $width(posedge addr2, 50, 30, ntfy_reg_p);
        $width(negedge addr2, 50, 30, ntfy_reg_n);
    endspecify

    always @(ntfy_reg_p or ntfy_reg_n) begin
        $display("Error: width violation at %0t", $time);
    end

    initial begin
        $monitor("addr2 = %b, %0t", addr2, $time);
        #100 addr = 4'b0000;
        #40  addr = 4'b0100;    // get violation here
        #100 addr = 4'b0000;
        #100 addr = 4'b1111;
        #10 $finish;
    end
endmodule

当我 运行 一个没有打开 Cadence 开关的模拟时,我收到一个 模拟器特定的 警告消息,我看到我的 user-已定义 通知程序Error 消息:

addr2 = xxxx, 0
addr2 = 0000, 100

Warning!  Timing violation
           $width( negedge addr2[2]:100 NS,  : 140 NS,  50 : 50 NS );
            File: ./tb.sv, line = 9
           Scope: tb
            Time: 140 NS

Error: width violation at 140
addr2 = 0100, 140
addr2 = 0000, 240
addr2 = 1111, 340

当我 运行 仅 +no_notifier 时,我收到警告,但没有收到错误。这意味着通知程序被忽略:

addr2 = xxxx, 0
addr2 = 0000, 100

Warning!  Timing violation
           $width( negedge addr2[2]:100 NS,  : 140 NS,  50 : 50 NS );
            File: ./tb.sv, line = 9
           Scope: tb
            Time: 140 NS

addr2 = 0100, 140
addr2 = 0000, 240
addr2 = 1111, 340

当我 运行 仅 +notimingchecks 时,我既没有收到警告也没有收到错误:

addr2 = xxxx, 0
addr2 = 0000, 100
addr2 = 0100, 140
addr2 = 0000, 240
addr2 = 1111, 340

当我 运行 同时使用两者 (+notimingchecks +no_notifier) 时,我既没有收到警告也没有收到错误,如上所述。

所有这些都与我的这些选项的模拟器文档一致。