File: bufifab_tb.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 (31 lines) | stat: -rw-r--r-- 666 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
module main;

   reg [2:0] i;
   wire      out0, out1;
   wire      ref0, ref1;

   bufifab dut(.Out0(out0), .Out1(out1), .I(i[0]), .E(i[1]));

   bufif0 (ref0, i[0], i[1]);
   bufif1 (ref1, i[0], i[1]);
   initial begin
      i = 0;

      for (i = 0 ;  i[2] == 0 ;  i = i+1) begin
	 #1 $display("I=%b, E=%b, Out0=%b, Out1=%b", i[0], i[1], out0, out1);

	 if (out0 !== ref0) begin
	    $display("FAILED -- ref0=%b, out0=%b", ref0, out0);
	    $finish;
	 end

	 if (out1 !== ref1) begin
	    $display("FAILED -- ref1=%b, out1=%b", ref1, out1);
	    $finish;
	 end
      end // for (i = 0 ;  i[2] == 0 ;  i = i+1)

      $display("PASSED");
   end

endmodule // main