File: t_math_equal.v

package info (click to toggle)
verilator 5.038-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 162,552 kB
  • sloc: cpp: 139,204; python: 20,931; ansic: 10,222; yacc: 6,000; lex: 1,925; makefile: 1,260; sh: 494; perl: 282; fortran: 22
file content (74 lines) | stat: -rw-r--r-- 2,078 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2003 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0

module t (/*AUTOARG*/
   // Inputs
   clk
   );

   input clk;

   integer _mode;

   reg         _guard1;
   reg [127:0] r_wide0;
   reg         _guard2;
   wire [63:0] r_wide1;
   reg         _guard3;
   reg         _guard4;
   reg         _guard5;
   reg         _guard6;

   assign      r_wide1 = r_wide0[127:64];

   // surefire lint_off STMINI
   initial _mode = 0;

   always @ (posedge clk) begin
      if (_mode==0) begin
         $write("[%0t] t_equal: Running\n", $time);
         _guard1 <= 0;
         _guard2 <= 0;
         _guard3 <= 0;
         _guard4 <= 0;
         _guard5 <= 0;
         _guard6 <= 0;

         _mode<=1;
         r_wide0 <= {32'h aa111111,32'hbb222222,32'hcc333333,32'hdd444444};
      end
      else if (_mode==1) begin
         _mode<=2;
         //
         if (5'd10 != 5'b1010) $stop;
         if (5'd10 != 5'd10) $stop;
         if (5'd10 != 5'd1_0) $stop;
         if (5'd10 != 5'ha) $stop;
         if (5'd10 != 5'o12) $stop;
         if (5'd10 != 5'o1_2) $stop;
         if (5'd10 != 5'B 1010) $stop;
         if (5'd10 != 5'B 10_10) $stop;
         if (5'd10 != 5'D10) $stop;
         if (5'd10 != 5'H a) $stop;
         if (5'd10 != 5 'O 12) $stop;
         if (24'h29cbb8 != 24'o12345670) $stop;
         if (24'h29__cbb8 != 24'o123456__70) $stop;
         if (6'b111xxx !== 6'o7x) $stop;
         if (6'b111??? !== 6'o7?) $stop;
         if (6'b111zzz !== 6'o7z) $stop;
         //
         if (r_wide0 !== {32'haa111111,32'hbb222222,32'hcc333333,32'hdd444444}) $stop;
         if (r_wide1 !== {32'haa111111,32'hbb222222}) $stop;
         if (|{_guard1,_guard2,_guard3,_guard4,_guard5,_guard6}) begin
            $write("Guard error %x %x %x %x %x\n",_guard1,_guard2,_guard3,_guard4,_guard5);
            $stop;
         end
         $write("*-* All Finished *-*\n");
         $finish;
      end
   end

endmodule