File: blocking.v

package info (click to toggle)
iverilog 12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,148 kB
  • sloc: cpp: 109,972; ansic: 62,713; yacc: 10,216; sh: 3,470; vhdl: 3,246; perl: 1,814; makefile: 1,774; python: 78; csh: 2
file content (38 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module testbench();
  reg [3:0] a, b;

  initial begin
    a = 1;
    b = 2;
    #1;
    a = a + b;
    b = a + b;
    if (a !== 3)
      begin
        $display("FAILED -- a !== 3");
        $finish;
      end
    if (b !== 5)
      begin
        $display("FAILED -- b !== 5");
        $finish;
      end
    #2;
    $display("PASSED");
  end // initial begin

  initial begin
    #2;
    if (a !== 3)
      begin
        $display("FAILED -- a (signal) !== 3");
        $finish;
      end
    if (b !== 5)
      begin
        $display("FAILED -- b (signal) !== 5");
        $finish;
      end
  end

endmodule // testbench