Add missing snapshots (batch 23/24)

#32
This view is limited to 50 files because it contains too many changes. See the raw diff here.
Files changed (50) hide show
  1. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_timing1.v +39 -0
  2. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_a.v +83 -0
  3. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_b.v +29 -0
  4. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_cc.cpp +95 -0
  5. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dump_cc.out +128 -0
  6. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dump_cc.py +40 -0
  7. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dump_sc.out +123 -0
  8. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dump_sc.py +42 -0
  9. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dumpfst_cc.out +136 -0
  10. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dumpfst_cc.py +40 -0
  11. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdr_cc.out +126 -0
  12. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdr_cc.py +40 -0
  13. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdr_sc.out +124 -0
  14. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdr_sc.py +42 -0
  15. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdrfst_cc.out +133 -0
  16. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdrfst_cc.py +40 -0
  17. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_port_cc.out +128 -0
  18. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_port_cc.py +40 -0
  19. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_port_sc.out +123 -0
  20. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_port_sc.py +43 -0
  21. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_portfst_cc.out +136 -0
  22. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_portfst_cc.py +40 -0
  23. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_sc.cpp +70 -0
  24. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_ub_misaligned_address.out +1 -0
  25. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_ub_misaligned_address.py +22 -0
  26. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_ub_misaligned_address.v +92 -0
  27. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_wide_struct.py +16 -0
  28. snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_wide_struct.v +23 -0
  29. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_and_eqcase.out +8 -0
  30. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_and_eqcase.py +16 -0
  31. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_and_eqcase.v +17 -0
  32. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array.out +10 -0
  33. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array.py +19 -0
  34. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array.v +70 -0
  35. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array_bufif.py +18 -0
  36. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array_bufif.v +118 -0
  37. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array_pull.py +18 -0
  38. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array_pull.v +44 -0
  39. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_compass_bad.out +6 -0
  40. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_compass_bad.py +16 -0
  41. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_compass_bad.v +21 -0
  42. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_cond_eqcase_with_1.py +18 -0
  43. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_cond_eqcase_with_1.v +21 -0
  44. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_dangle.py +18 -0
  45. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_dangle.v +35 -0
  46. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_eqcase.py +18 -0
  47. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_eqcase.v +129 -0
  48. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_eqcase_input.py +18 -0
  49. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_eqcase_input.v +20 -0
  50. snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_gate.cpp +56 -0
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_timing1.v ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2022 by Wilson Snyder.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ `define STRINGIFY(x) `"x`"
8
+
9
+ module t;
10
+
11
+ localparam CLOCK_CYCLE = 10;
12
+
13
+ logic rst;
14
+ logic clk;
15
+
16
+ initial begin
17
+ $dumpfile(`STRINGIFY(`TEST_DUMPFILE));
18
+ $dumpvars;
19
+ end
20
+
21
+ always #(CLOCK_CYCLE/2) clk = ~clk;
22
+
23
+ always begin
24
+ rst = 1;
25
+ clk = 0;
26
+ $display("[%0t] rst: %d, rst: %d", $time, rst, rst);
27
+
28
+ #CLOCK_CYCLE;
29
+ rst = 0;
30
+ $display("[%0t] rst: %d, rst: %d", $time, rst, rst);
31
+
32
+ #CLOCK_CYCLE;
33
+ $display("[%0t] rst: %d, rst: %d", $time, rst, rst);
34
+
35
+ $write("*-* All Finished *-*\n");
36
+ $finish;
37
+ end
38
+
39
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_a.v ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2020 by Wilson Snyder.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ `define CONCAT(a, b) a``b
8
+ `define STRINGIFY(x) `"x`"
9
+
10
+ module t (/*AUTOARG*/
11
+ // Inputs
12
+ clk
13
+ );
14
+
15
+ input clk;
16
+
17
+ integer cyc; initial cyc=1;
18
+ integer c_trace_on;
19
+
20
+ sub sub ();
21
+
22
+ // verilator tracing_off
23
+ string filename;
24
+ // verilator tracing_on
25
+
26
+ initial begin
27
+ `ifdef TEST_FST
28
+ filename = {`STRINGIFY(`TEST_OBJ_DIR), "/simx.fst"};
29
+ `else
30
+ filename = {`STRINGIFY(`TEST_OBJ_DIR), "/simx.vcd"};
31
+ `endif
32
+
33
+ `ifdef TEST_DUMP
34
+ $dumpfile(filename);
35
+ $dumpvars(0); // Intentionally no ", top" for parsing coverage with just (expr)
36
+ $dumpvars(1, top); // Intentionally checking parsing coverage
37
+ $dumpvars(1, top, top); // Intentionally checking parsing coverage
38
+ $dumplimit(10 * 1024 * 1024);
39
+ `elsif TEST_DUMPPORTS
40
+ $dumpports(top, filename);
41
+ $dumpportslimit(10 * 1024 * 1024, filename);
42
+ `endif
43
+ end
44
+
45
+ always @ (posedge clk) begin
46
+ if (cyc != 0) begin
47
+ cyc <= cyc + 1;
48
+ c_trace_on <= cyc + 2;
49
+ if (cyc == 3) begin
50
+ `ifdef TEST_DUMP
51
+ $dumpoff;
52
+ `elsif TEST_DUMPPORTS
53
+ $dumpportsoff(filename);
54
+ `endif
55
+ end
56
+ else if (cyc == 5) begin
57
+ `ifdef TEST_DUMP
58
+ $dumpall;
59
+ $dumpflush;
60
+ `elsif TEST_DUMPPORTS
61
+ $dumpportsall(filename);
62
+ $dumpportsflush(filename);
63
+ `endif
64
+ end
65
+ else if (cyc == 7) begin
66
+ `ifdef TEST_DUMP
67
+ $dumpon;
68
+ `elsif TEST_DUMPPORTS
69
+ $dumpportson(filename);
70
+ `endif
71
+ end
72
+ else if (cyc == 10) begin
73
+ $write("*-* All Finished *-*\n");
74
+ $finish;
75
+ end
76
+ end
77
+ end
78
+
79
+ endmodule
80
+
81
+ module sub;
82
+ integer inside_sub_a = 1;
83
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_b.v ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2020 by Wilson Snyder.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t (/*AUTOARG*/
8
+ // Inputs
9
+ clk
10
+ );
11
+
12
+ input clk;
13
+
14
+ integer cyc; initial cyc=1;
15
+ integer c_trace_on;
16
+ real r;
17
+
18
+ sub sub ();
19
+
20
+ always @ (posedge clk) begin
21
+ if (cyc != 0) begin
22
+ r <= r + 0.1;
23
+ end
24
+ end
25
+ endmodule
26
+
27
+ module sub;
28
+ integer inside_sub_a = 2;
29
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_cc.cpp ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test
2
+ //
3
+ // Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
4
+ // redistribute it and/or modify it under the terms of either the GNU
5
+ // Lesser General Public License Version 3 or the Perl Artistic License
6
+ // Version 2.0.
7
+ // SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
8
+
9
+ // clang-format off
10
+ #include "verilatedos.h"
11
+ #include VM_PREFIX_INCLUDE
12
+ #include "Vt_trace_two_b.h"
13
+ #include "verilated.h"
14
+ #ifdef TEST_HDR_TRACE
15
+ # ifdef TEST_FST
16
+ # include "verilated_fst_c.h"
17
+ # else
18
+ # include "verilated_vcd_c.h"
19
+ # endif
20
+ #endif
21
+ // clang-format on
22
+
23
+ // Compile in place
24
+ #include "Vt_trace_two_b__ALL.cpp"
25
+
26
+ VM_PREFIX* ap;
27
+ Vt_trace_two_b* bp;
28
+
29
+ int main(int argc, char** argv) {
30
+ const std::unique_ptr<VerilatedContext> contextp{new VerilatedContext};
31
+
32
+ uint64_t sim_time = 1100;
33
+ contextp->debug(0);
34
+ contextp->commandArgs(argc, argv);
35
+ contextp->traceEverOn(true);
36
+ srand48(5);
37
+ ap = new VM_PREFIX{contextp.get(), "topa"};
38
+ bp = new Vt_trace_two_b{contextp.get(), "topb"};
39
+
40
+ // clang-format off
41
+ #ifdef TEST_HDR_TRACE
42
+ contextp->traceEverOn(true);
43
+ # ifdef TEST_FST
44
+ VerilatedFstC* tfp = new VerilatedFstC;
45
+ ap->trace(tfp, 99);
46
+ bp->trace(tfp, 99);
47
+ tfp->open(VL_STRINGIFY(TEST_OBJ_DIR) "/simx.fst");
48
+ # else
49
+ VerilatedVcdC* tfp = new VerilatedVcdC;
50
+ ap->trace(tfp, 99);
51
+ bp->trace(tfp, 99);
52
+ tfp->open(VL_STRINGIFY(TEST_OBJ_DIR) "/simx.vcd");
53
+ # endif
54
+ #endif
55
+ // clang-format on
56
+
57
+ #ifdef TEST_HDR_TRACE
58
+ ap->eval_step();
59
+ bp->eval_step();
60
+ ap->eval_end_step();
61
+ bp->eval_end_step();
62
+ if (tfp) tfp->dump(contextp->time());
63
+ #endif
64
+
65
+ {
66
+ ap->clk = false;
67
+ contextp->timeInc(10);
68
+ }
69
+ while (contextp->time() < sim_time && !contextp->gotFinish()) {
70
+ ap->clk = !ap->clk;
71
+ bp->clk = ap->clk;
72
+ ap->eval_step();
73
+ bp->eval_step();
74
+ ap->eval_end_step();
75
+ bp->eval_end_step();
76
+ #ifdef TEST_HDR_TRACE
77
+ if (tfp) tfp->dump(contextp->time());
78
+ #endif
79
+ contextp->timeInc(5);
80
+ }
81
+ if (!contextp->gotFinish()) {
82
+ vl_fatal(__FILE__, __LINE__, "main", "%Error: Timeout; never got a $finish");
83
+ }
84
+ ap->final();
85
+ bp->final();
86
+
87
+ #ifdef TEST_HDR_TRACE
88
+ if (tfp) tfp->close();
89
+ VL_DO_DANGLING(delete tfp, tfp);
90
+ #endif
91
+
92
+ VL_DO_DANGLING(delete ap, ap);
93
+ VL_DO_DANGLING(delete bp, bp);
94
+ return 0;
95
+ }
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dump_cc.out ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $version Generated by VerilatedVcd $end
2
+ $timescale 1ps $end
3
+ $scope module topa $end
4
+ $var wire 1 # clk $end
5
+ $scope module t $end
6
+ $var wire 1 # clk $end
7
+ $var wire 32 $ cyc [31:0] $end
8
+ $var wire 32 % c_trace_on [31:0] $end
9
+ $scope module sub $end
10
+ $var wire 32 & inside_sub_a [31:0] $end
11
+ $upscope $end
12
+ $upscope $end
13
+ $upscope $end
14
+ $scope module topb $end
15
+ $var wire 1 ( clk $end
16
+ $scope module t $end
17
+ $var wire 1 ( clk $end
18
+ $var wire 32 + cyc [31:0] $end
19
+ $var wire 32 , c_trace_on [31:0] $end
20
+ $var real 64 ) r $end
21
+ $scope module sub $end
22
+ $var wire 32 - inside_sub_a [31:0] $end
23
+ $upscope $end
24
+ $upscope $end
25
+ $upscope $end
26
+ $enddefinitions $end
27
+
28
+
29
+ #10
30
+ 1#
31
+ b00000000000000000000000000000001 $
32
+ b00000000000000000000000000000000 %
33
+ 1(
34
+ r0 )
35
+ b00000000000000000000000000000001 &
36
+ b00000000000000000000000000000001 +
37
+ b00000000000000000000000000000000 ,
38
+ b00000000000000000000000000000010 -
39
+ #15
40
+ 0#
41
+ 0(
42
+ #20
43
+ 1#
44
+ b00000000000000000000000000000010 $
45
+ b00000000000000000000000000000011 %
46
+ 1(
47
+ r0.1 )
48
+ #25
49
+ 0#
50
+ 0(
51
+ #30
52
+ 1#
53
+ b00000000000000000000000000000011 $
54
+ b00000000000000000000000000000100 %
55
+ 1(
56
+ r0.2 )
57
+ #35
58
+ 0#
59
+ 0(
60
+ #40
61
+ 1#
62
+ b00000000000000000000000000000100 $
63
+ b00000000000000000000000000000101 %
64
+ 1(
65
+ r0.3 )
66
+ #45
67
+ 0#
68
+ 0(
69
+ #50
70
+ 1#
71
+ b00000000000000000000000000000101 $
72
+ b00000000000000000000000000000110 %
73
+ 1(
74
+ r0.4 )
75
+ #55
76
+ 0#
77
+ 0(
78
+ #60
79
+ 1#
80
+ b00000000000000000000000000000110 $
81
+ b00000000000000000000000000000111 %
82
+ 1(
83
+ r0.5 )
84
+ #65
85
+ 0#
86
+ 0(
87
+ #70
88
+ 1#
89
+ b00000000000000000000000000000111 $
90
+ b00000000000000000000000000001000 %
91
+ 1(
92
+ r0.6 )
93
+ #75
94
+ 0#
95
+ 0(
96
+ #80
97
+ 1#
98
+ b00000000000000000000000000001000 $
99
+ b00000000000000000000000000001001 %
100
+ 1(
101
+ r0.7 )
102
+ #85
103
+ 0#
104
+ 0(
105
+ #90
106
+ 1#
107
+ b00000000000000000000000000001001 $
108
+ b00000000000000000000000000001010 %
109
+ 1(
110
+ r0.7999999999999999 )
111
+ #95
112
+ 0#
113
+ 0(
114
+ #100
115
+ 1#
116
+ b00000000000000000000000000001010 $
117
+ b00000000000000000000000000001011 %
118
+ 1(
119
+ r0.8999999999999999 )
120
+ #105
121
+ 0#
122
+ 0(
123
+ #110
124
+ 1#
125
+ b00000000000000000000000000001011 $
126
+ b00000000000000000000000000001100 %
127
+ 1(
128
+ r0.9999999999999999 )
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dump_cc.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ # Test tracing with two models instanced
11
+ import vltest_bootstrap
12
+
13
+ test.scenarios('vlt_all')
14
+ test.top_filename = "t_trace_two_a.v"
15
+ test.pli_filename = "t/t_trace_two_cc.cpp"
16
+
17
+ test.compile(make_main=False,
18
+ verilator_make_gmake=False,
19
+ top_filename='t_trace_two_b.v',
20
+ vm_prefix='Vt_trace_two_b',
21
+ verilator_flags2=['-trace'])
22
+
23
+ test.run(logfile=test.obj_dir + "/make_first_ALL.log",
24
+ cmd=[
25
+ os.environ["MAKE"], "-C", "" + test.obj_dir, "-f", "Vt_trace_two_b.mk",
26
+ "Vt_trace_two_b__ALL.cpp"
27
+ ])
28
+
29
+ test.compile(make_main=False,
30
+ top_filename='t_trace_two_a.v',
31
+ verilator_flags2=['-exe', '-trace', test.pli_filename],
32
+ v_flags2=['+define+TEST_DUMP'])
33
+
34
+ test.execute()
35
+
36
+ if test.vlt_all:
37
+ test.file_grep(test.trace_filename, r'\$enddefinitions')
38
+ test.vcd_identical(test.trace_filename, test.golden_filename)
39
+
40
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dump_sc.out ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $version Generated by VerilatedVcd $end
2
+ $timescale 1ps $end
3
+ $scope module topa $end
4
+ $scope module t $end
5
+ $var wire 1 # clk $end
6
+ $var wire 32 $ cyc [31:0] $end
7
+ $var wire 32 % c_trace_on [31:0] $end
8
+ $scope module sub $end
9
+ $var wire 32 & inside_sub_a [31:0] $end
10
+ $upscope $end
11
+ $upscope $end
12
+ $upscope $end
13
+ $scope module topb $end
14
+ $scope module t $end
15
+ $var wire 1 ( clk $end
16
+ $var wire 32 + cyc [31:0] $end
17
+ $var wire 32 , c_trace_on [31:0] $end
18
+ $var real 64 ) r $end
19
+ $scope module sub $end
20
+ $var wire 32 - inside_sub_a [31:0] $end
21
+ $upscope $end
22
+ $upscope $end
23
+ $upscope $end
24
+ $enddefinitions $end
25
+
26
+
27
+ #0
28
+ 0#
29
+ b00000000000000000000000000000001 $
30
+ b00000000000000000000000000000000 %
31
+ 0(
32
+ r0 )
33
+ b00000000000000000000000000000001 &
34
+ b00000000000000000000000000000001 +
35
+ b00000000000000000000000000000000 ,
36
+ b00000000000000000000000000000010 -
37
+ #10000
38
+ 1#
39
+ b00000000000000000000000000000010 $
40
+ b00000000000000000000000000000011 %
41
+ 1(
42
+ r0.1 )
43
+ #15000
44
+ 0#
45
+ 0(
46
+ #20000
47
+ 1#
48
+ b00000000000000000000000000000011 $
49
+ b00000000000000000000000000000100 %
50
+ 1(
51
+ r0.2 )
52
+ #25000
53
+ 0#
54
+ 0(
55
+ #30000
56
+ 1#
57
+ b00000000000000000000000000000100 $
58
+ b00000000000000000000000000000101 %
59
+ 1(
60
+ r0.3 )
61
+ #35000
62
+ 0#
63
+ 0(
64
+ #40000
65
+ 1#
66
+ b00000000000000000000000000000101 $
67
+ b00000000000000000000000000000110 %
68
+ 1(
69
+ r0.4 )
70
+ #45000
71
+ 0#
72
+ 0(
73
+ #50000
74
+ 1#
75
+ b00000000000000000000000000000110 $
76
+ b00000000000000000000000000000111 %
77
+ 1(
78
+ r0.5 )
79
+ #55000
80
+ 0#
81
+ 0(
82
+ #60000
83
+ 1#
84
+ b00000000000000000000000000000111 $
85
+ b00000000000000000000000000001000 %
86
+ 1(
87
+ r0.6 )
88
+ #65000
89
+ 0#
90
+ 0(
91
+ #70000
92
+ 1#
93
+ b00000000000000000000000000001000 $
94
+ b00000000000000000000000000001001 %
95
+ 1(
96
+ r0.7 )
97
+ #75000
98
+ 0#
99
+ 0(
100
+ #80000
101
+ 1#
102
+ b00000000000000000000000000001001 $
103
+ b00000000000000000000000000001010 %
104
+ 1(
105
+ r0.7999999999999999 )
106
+ #85000
107
+ 0#
108
+ 0(
109
+ #90000
110
+ 1#
111
+ b00000000000000000000000000001010 $
112
+ b00000000000000000000000000001011 %
113
+ 1(
114
+ r0.8999999999999999 )
115
+ #95000
116
+ 0#
117
+ 0(
118
+ #100000
119
+ 1#
120
+ b00000000000000000000000000001011 $
121
+ b00000000000000000000000000001100 %
122
+ 1(
123
+ r0.9999999999999999 )
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dump_sc.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+ test.top_filename = "t_trace_two_a.v"
14
+ test.pli_filename = "t/t_trace_two_sc.cpp"
15
+
16
+ if not test.have_sc:
17
+ test.skip("No SystemC installed")
18
+
19
+ test.compile(make_main=False,
20
+ verilator_make_gmake=False,
21
+ top_filename='t_trace_two_b.v',
22
+ vm_prefix='Vt_trace_two_b',
23
+ verilator_flags2=['-sc -trace'])
24
+
25
+ test.run(logfile=test.obj_dir + "/make_first_ALL.log",
26
+ cmd=[
27
+ os.environ["MAKE"], "-C", test.obj_dir, "-f", "Vt_trace_two_b.mk",
28
+ "Vt_trace_two_b__ALL.cpp"
29
+ ])
30
+
31
+ test.compile(make_main=False,
32
+ top_filename='t_trace_two_a.v',
33
+ verilator_flags2=['-sc', '-exe', '-trace', test.pli_filename],
34
+ v_flags2=['+define+TEST_DUMP'])
35
+
36
+ test.execute()
37
+
38
+ if test.vlt_all:
39
+ test.file_grep(test.trace_filename, r'\$enddefinitions')
40
+ test.vcd_identical(test.trace_filename, test.golden_filename)
41
+
42
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dumpfst_cc.out ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $date
2
+ Sat Mar 30 14:01:55 2024
3
+
4
+ $end
5
+ $version
6
+ fstWriter
7
+ $end
8
+ $timescale
9
+ 1ps
10
+ $end
11
+ $scope module topa $end
12
+ $var wire 1 ! clk $end
13
+ $scope module t $end
14
+ $var wire 1 ! clk $end
15
+ $var integer 32 " cyc [31:0] $end
16
+ $var integer 32 # c_trace_on [31:0] $end
17
+ $scope module sub $end
18
+ $var integer 32 $ inside_sub_a [31:0] $end
19
+ $upscope $end
20
+ $upscope $end
21
+ $upscope $end
22
+ $scope module topb $end
23
+ $var wire 1 % clk $end
24
+ $scope module t $end
25
+ $var wire 1 % clk $end
26
+ $var integer 32 & cyc [31:0] $end
27
+ $var integer 32 ' c_trace_on [31:0] $end
28
+ $var real 64 ( r $end
29
+ $scope module sub $end
30
+ $var integer 32 ) inside_sub_a [31:0] $end
31
+ $upscope $end
32
+ $upscope $end
33
+ $upscope $end
34
+ $enddefinitions $end
35
+ #10
36
+ $dumpvars
37
+ b00000000000000000000000000000010 )
38
+ r0 (
39
+ b00000000000000000000000000000000 '
40
+ b00000000000000000000000000000001 &
41
+ 1%
42
+ b00000000000000000000000000000001 $
43
+ b00000000000000000000000000000000 #
44
+ b00000000000000000000000000000001 "
45
+ 1!
46
+ $end
47
+ #15
48
+ 0!
49
+ 0%
50
+ #20
51
+ 1%
52
+ 1!
53
+ b00000000000000000000000000000010 "
54
+ b00000000000000000000000000000011 #
55
+ r0.1 (
56
+ #25
57
+ 0!
58
+ 0%
59
+ #30
60
+ 1%
61
+ 1!
62
+ r0.2 (
63
+ b00000000000000000000000000000100 #
64
+ b00000000000000000000000000000011 "
65
+ #35
66
+ 0!
67
+ 0%
68
+ #40
69
+ 1%
70
+ 1!
71
+ b00000000000000000000000000000100 "
72
+ b00000000000000000000000000000101 #
73
+ r0.3 (
74
+ #45
75
+ 0!
76
+ 0%
77
+ #50
78
+ 1%
79
+ 1!
80
+ r0.4 (
81
+ b00000000000000000000000000000110 #
82
+ b00000000000000000000000000000101 "
83
+ #55
84
+ 0!
85
+ 0%
86
+ #60
87
+ 1%
88
+ 1!
89
+ b00000000000000000000000000000110 "
90
+ b00000000000000000000000000000111 #
91
+ r0.5 (
92
+ #65
93
+ 0!
94
+ 0%
95
+ #70
96
+ 1%
97
+ 1!
98
+ r0.6 (
99
+ b00000000000000000000000000001000 #
100
+ b00000000000000000000000000000111 "
101
+ #75
102
+ 0!
103
+ 0%
104
+ #80
105
+ 1%
106
+ 1!
107
+ b00000000000000000000000000001000 "
108
+ b00000000000000000000000000001001 #
109
+ r0.7 (
110
+ #85
111
+ 0!
112
+ 0%
113
+ #90
114
+ 1%
115
+ 1!
116
+ r0.7999999999999999 (
117
+ b00000000000000000000000000001010 #
118
+ b00000000000000000000000000001001 "
119
+ #95
120
+ 0!
121
+ 0%
122
+ #100
123
+ 1%
124
+ 1!
125
+ b00000000000000000000000000001010 "
126
+ b00000000000000000000000000001011 #
127
+ r0.8999999999999999 (
128
+ #105
129
+ 0!
130
+ 0%
131
+ #110
132
+ 1%
133
+ 1!
134
+ r0.9999999999999999 (
135
+ b00000000000000000000000000001100 #
136
+ b00000000000000000000000000001011 "
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_dumpfst_cc.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ # Test tracing with two models instanced
11
+ import vltest_bootstrap
12
+
13
+ test.scenarios('vlt_all')
14
+ test.top_filename = "t_trace_two_a.v"
15
+ test.pli_filename = "t/t_trace_two_cc.cpp"
16
+
17
+ test.compile(make_main=False,
18
+ verilator_make_gmake=False,
19
+ top_filename='t_trace_two_b.v',
20
+ vm_prefix='Vt_trace_two_b',
21
+ verilator_flags2=['--trace-fst --trace-threads 1 -DTEST_FST'])
22
+
23
+ test.run(logfile=test.obj_dir + "/make_first_ALL.log",
24
+ cmd=[
25
+ os.environ["MAKE"], "-C", test.obj_dir, "-f", "Vt_trace_two_b.mk",
26
+ "Vt_trace_two_b__ALL.cpp"
27
+ ])
28
+
29
+ test.compile(
30
+ make_main=False,
31
+ top_filename='t_trace_two_a.v',
32
+ verilator_flags2=['-exe', '--trace-fst --trace-threads 1', '-DTEST_FST', test.pli_filename],
33
+ v_flags2=['+define+TEST_DUMP'])
34
+
35
+ test.execute()
36
+
37
+ if test.vlt_all:
38
+ test.fst_identical(test.trace_filename, test.golden_filename)
39
+
40
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdr_cc.out ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $version Generated by VerilatedVcd $end
2
+ $timescale 1ps $end
3
+
4
+ $scope module topa $end
5
+ $var wire 1 # clk $end
6
+ $scope module t $end
7
+ $var wire 1 # clk $end
8
+ $var wire 32 $ cyc [31:0] $end
9
+ $var wire 32 % c_trace_on [31:0] $end
10
+ $scope module sub $end
11
+ $var wire 32 & inside_sub_a [31:0] $end
12
+ $upscope $end
13
+ $upscope $end
14
+ $upscope $end
15
+ $scope module topb $end
16
+ $var wire 1 ( clk $end
17
+ $scope module t $end
18
+ $var wire 1 ( clk $end
19
+ $var wire 32 + cyc [31:0] $end
20
+ $var wire 32 , c_trace_on [31:0] $end
21
+ $var real 64 ) r $end
22
+ $scope module sub $end
23
+ $var wire 32 - inside_sub_a [31:0] $end
24
+ $upscope $end
25
+ $upscope $end
26
+ $upscope $end
27
+ $enddefinitions $end
28
+
29
+
30
+ #0
31
+ 0#
32
+ b00000000000000000000000000000001 $
33
+ b00000000000000000000000000000000 %
34
+ 0(
35
+ r0 )
36
+ b00000000000000000000000000000001 &
37
+ b00000000000000000000000000000001 +
38
+ b00000000000000000000000000000000 ,
39
+ b00000000000000000000000000000010 -
40
+ #10
41
+ 1#
42
+ b00000000000000000000000000000010 $
43
+ b00000000000000000000000000000011 %
44
+ 1(
45
+ r0.1 )
46
+ #15
47
+ 0#
48
+ 0(
49
+ #20
50
+ 1#
51
+ b00000000000000000000000000000011 $
52
+ b00000000000000000000000000000100 %
53
+ 1(
54
+ r0.2 )
55
+ #25
56
+ 0#
57
+ 0(
58
+ #30
59
+ 1#
60
+ b00000000000000000000000000000100 $
61
+ b00000000000000000000000000000101 %
62
+ 1(
63
+ r0.3 )
64
+ #35
65
+ 0#
66
+ 0(
67
+ #40
68
+ 1#
69
+ b00000000000000000000000000000101 $
70
+ b00000000000000000000000000000110 %
71
+ 1(
72
+ r0.4 )
73
+ #45
74
+ 0#
75
+ 0(
76
+ #50
77
+ 1#
78
+ b00000000000000000000000000000110 $
79
+ b00000000000000000000000000000111 %
80
+ 1(
81
+ r0.5 )
82
+ #55
83
+ 0#
84
+ 0(
85
+ #60
86
+ 1#
87
+ b00000000000000000000000000000111 $
88
+ b00000000000000000000000000001000 %
89
+ 1(
90
+ r0.6 )
91
+ #65
92
+ 0#
93
+ 0(
94
+ #70
95
+ 1#
96
+ b00000000000000000000000000001000 $
97
+ b00000000000000000000000000001001 %
98
+ 1(
99
+ r0.7 )
100
+ #75
101
+ 0#
102
+ 0(
103
+ #80
104
+ 1#
105
+ b00000000000000000000000000001001 $
106
+ b00000000000000000000000000001010 %
107
+ 1(
108
+ r0.7999999999999999 )
109
+ #85
110
+ 0#
111
+ 0(
112
+ #90
113
+ 1#
114
+ b00000000000000000000000000001010 $
115
+ b00000000000000000000000000001011 %
116
+ 1(
117
+ r0.8999999999999999 )
118
+ #95
119
+ 0#
120
+ 0(
121
+ #100
122
+ 1#
123
+ b00000000000000000000000000001011 $
124
+ b00000000000000000000000000001100 %
125
+ 1(
126
+ r0.9999999999999999 )
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdr_cc.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ # Test tracing with two models instanced
11
+ import vltest_bootstrap
12
+
13
+ test.scenarios('vlt_all')
14
+ test.top_filename = "t_trace_two_a.v"
15
+ test.pli_filename = "t/t_trace_two_cc.cpp"
16
+
17
+ test.compile(make_main=False,
18
+ verilator_make_gmake=False,
19
+ top_filename='t_trace_two_b.v',
20
+ vm_prefix='Vt_trace_two_b',
21
+ verilator_flags2=['-trace'])
22
+
23
+ test.run(logfile=test.obj_dir + "/make_first_ALL.log",
24
+ cmd=[
25
+ os.environ["MAKE"], "-C", test.obj_dir, "-f", "Vt_trace_two_b.mk",
26
+ "Vt_trace_two_b__ALL.cpp"
27
+ ])
28
+
29
+ test.compile(make_main=False,
30
+ top_filename='t_trace_two_a.v',
31
+ make_flags=['CPPFLAGS_ADD=-DTEST_HDR_TRACE=1'],
32
+ verilator_flags2=['-exe', '-trace', test.pli_filename])
33
+
34
+ test.execute()
35
+
36
+ if test.vlt_all:
37
+ test.file_grep(test.trace_filename, r'\$enddefinitions')
38
+ test.vcd_identical(test.trace_filename, test.golden_filename)
39
+
40
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdr_sc.out ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $version Generated by VerilatedVcd $end
2
+ $timescale 1ps $end
3
+
4
+ $scope module topa $end
5
+ $scope module t $end
6
+ $var wire 1 # clk $end
7
+ $var wire 32 $ cyc [31:0] $end
8
+ $var wire 32 % c_trace_on [31:0] $end
9
+ $scope module sub $end
10
+ $var wire 32 & inside_sub_a [31:0] $end
11
+ $upscope $end
12
+ $upscope $end
13
+ $upscope $end
14
+ $scope module topb $end
15
+ $scope module t $end
16
+ $var wire 1 ( clk $end
17
+ $var wire 32 + cyc [31:0] $end
18
+ $var wire 32 , c_trace_on [31:0] $end
19
+ $var real 64 ) r $end
20
+ $scope module sub $end
21
+ $var wire 32 - inside_sub_a [31:0] $end
22
+ $upscope $end
23
+ $upscope $end
24
+ $upscope $end
25
+ $enddefinitions $end
26
+
27
+
28
+ #0
29
+ 0#
30
+ b00000000000000000000000000000001 $
31
+ b00000000000000000000000000000000 %
32
+ 0(
33
+ r0 )
34
+ b00000000000000000000000000000001 &
35
+ b00000000000000000000000000000001 +
36
+ b00000000000000000000000000000000 ,
37
+ b00000000000000000000000000000010 -
38
+ #10000
39
+ 1#
40
+ b00000000000000000000000000000010 $
41
+ b00000000000000000000000000000011 %
42
+ 1(
43
+ r0.1 )
44
+ #15000
45
+ 0#
46
+ 0(
47
+ #20000
48
+ 1#
49
+ b00000000000000000000000000000011 $
50
+ b00000000000000000000000000000100 %
51
+ 1(
52
+ r0.2 )
53
+ #25000
54
+ 0#
55
+ 0(
56
+ #30000
57
+ 1#
58
+ b00000000000000000000000000000100 $
59
+ b00000000000000000000000000000101 %
60
+ 1(
61
+ r0.3 )
62
+ #35000
63
+ 0#
64
+ 0(
65
+ #40000
66
+ 1#
67
+ b00000000000000000000000000000101 $
68
+ b00000000000000000000000000000110 %
69
+ 1(
70
+ r0.4 )
71
+ #45000
72
+ 0#
73
+ 0(
74
+ #50000
75
+ 1#
76
+ b00000000000000000000000000000110 $
77
+ b00000000000000000000000000000111 %
78
+ 1(
79
+ r0.5 )
80
+ #55000
81
+ 0#
82
+ 0(
83
+ #60000
84
+ 1#
85
+ b00000000000000000000000000000111 $
86
+ b00000000000000000000000000001000 %
87
+ 1(
88
+ r0.6 )
89
+ #65000
90
+ 0#
91
+ 0(
92
+ #70000
93
+ 1#
94
+ b00000000000000000000000000001000 $
95
+ b00000000000000000000000000001001 %
96
+ 1(
97
+ r0.7 )
98
+ #75000
99
+ 0#
100
+ 0(
101
+ #80000
102
+ 1#
103
+ b00000000000000000000000000001001 $
104
+ b00000000000000000000000000001010 %
105
+ 1(
106
+ r0.7999999999999999 )
107
+ #85000
108
+ 0#
109
+ 0(
110
+ #90000
111
+ 1#
112
+ b00000000000000000000000000001010 $
113
+ b00000000000000000000000000001011 %
114
+ 1(
115
+ r0.8999999999999999 )
116
+ #95000
117
+ 0#
118
+ 0(
119
+ #100000
120
+ 1#
121
+ b00000000000000000000000000001011 $
122
+ b00000000000000000000000000001100 %
123
+ 1(
124
+ r0.9999999999999999 )
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdr_sc.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+ test.top_filename = "t_trace_two_a.v"
14
+ test.pli_filename = "t/t_trace_two_sc.cpp"
15
+
16
+ if not test.have_sc:
17
+ test.skip("No SystemC installed")
18
+
19
+ test.compile(make_main=False,
20
+ verilator_make_gmake=False,
21
+ top_filename='t_trace_two_b.v',
22
+ vm_prefix='Vt_trace_two_b',
23
+ verilator_flags2=['-sc -trace'])
24
+
25
+ test.run(logfile=test.obj_dir + "/make_first_ALL.log",
26
+ cmd=[
27
+ os.environ["MAKE"], "-C", test.obj_dir, "-f", "Vt_trace_two_b.mk",
28
+ "Vt_trace_two_b__ALL.cpp"
29
+ ])
30
+
31
+ test.compile(make_main=False,
32
+ top_filename='t_trace_two_a.v',
33
+ make_flags=['CPPFLAGS_ADD=-DTEST_HDR_TRACE'],
34
+ verilator_flags2=['-sc', '-exe', '-trace', test.pli_filename])
35
+
36
+ test.execute()
37
+
38
+ if test.vlt_all:
39
+ test.file_grep(test.trace_filename, r'\$enddefinitions')
40
+ test.vcd_identical(test.trace_filename, test.golden_filename)
41
+
42
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdrfst_cc.out ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $date
2
+ Wed Feb 23 00:03:39 2022
3
+
4
+ $end
5
+ $version
6
+ fstWriter
7
+ $end
8
+ $timescale
9
+ 1ps
10
+ $end
11
+ $scope module topa $end
12
+ $var wire 1 ! clk $end
13
+ $scope module t $end
14
+ $var wire 1 ! clk $end
15
+ $var integer 32 " cyc [31:0] $end
16
+ $var integer 32 # c_trace_on [31:0] $end
17
+ $scope module sub $end
18
+ $var integer 32 $ inside_sub_a [31:0] $end
19
+ $upscope $end
20
+ $upscope $end
21
+ $upscope $end
22
+ $scope module topb $end
23
+ $var wire 1 % clk $end
24
+ $scope module t $end
25
+ $var wire 1 % clk $end
26
+ $var integer 32 & cyc [31:0] $end
27
+ $var integer 32 ' c_trace_on [31:0] $end
28
+ $var real 64 ( r $end
29
+ $scope module sub $end
30
+ $var integer 32 ) inside_sub_a [31:0] $end
31
+ $upscope $end
32
+ $upscope $end
33
+ $upscope $end
34
+ $enddefinitions $end
35
+ #0
36
+ $dumpvars
37
+ b00000000000000000000000000000010 )
38
+ r0 (
39
+ b00000000000000000000000000000000 '
40
+ b00000000000000000000000000000001 &
41
+ 0%
42
+ b00000000000000000000000000000001 $
43
+ b00000000000000000000000000000000 #
44
+ b00000000000000000000000000000001 "
45
+ 0!
46
+ $end
47
+ #10
48
+ 1!
49
+ b00000000000000000000000000000010 "
50
+ b00000000000000000000000000000011 #
51
+ 1%
52
+ r0.1 (
53
+ #15
54
+ 0%
55
+ 0!
56
+ #20
57
+ 1!
58
+ 1%
59
+ r0.2 (
60
+ b00000000000000000000000000000100 #
61
+ b00000000000000000000000000000011 "
62
+ #25
63
+ 0%
64
+ 0!
65
+ #30
66
+ 1!
67
+ 1%
68
+ b00000000000000000000000000000100 "
69
+ b00000000000000000000000000000101 #
70
+ r0.3 (
71
+ #35
72
+ 0%
73
+ 0!
74
+ #40
75
+ 1!
76
+ 1%
77
+ r0.4 (
78
+ b00000000000000000000000000000110 #
79
+ b00000000000000000000000000000101 "
80
+ #45
81
+ 0%
82
+ 0!
83
+ #50
84
+ 1!
85
+ 1%
86
+ b00000000000000000000000000000110 "
87
+ b00000000000000000000000000000111 #
88
+ r0.5 (
89
+ #55
90
+ 0%
91
+ 0!
92
+ #60
93
+ 1!
94
+ 1%
95
+ r0.6 (
96
+ b00000000000000000000000000001000 #
97
+ b00000000000000000000000000000111 "
98
+ #65
99
+ 0%
100
+ 0!
101
+ #70
102
+ 1!
103
+ 1%
104
+ b00000000000000000000000000001000 "
105
+ b00000000000000000000000000001001 #
106
+ r0.7 (
107
+ #75
108
+ 0%
109
+ 0!
110
+ #80
111
+ 1!
112
+ 1%
113
+ r0.7999999999999999 (
114
+ b00000000000000000000000000001010 #
115
+ b00000000000000000000000000001001 "
116
+ #85
117
+ 0%
118
+ 0!
119
+ #90
120
+ 1!
121
+ 1%
122
+ b00000000000000000000000000001010 "
123
+ b00000000000000000000000000001011 #
124
+ r0.8999999999999999 (
125
+ #95
126
+ 0%
127
+ 0!
128
+ #100
129
+ 1!
130
+ 1%
131
+ r0.9999999999999999 (
132
+ b00000000000000000000000000001100 #
133
+ b00000000000000000000000000001011 "
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_hdrfst_cc.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ # Test tracing with two models instanced
11
+ import vltest_bootstrap
12
+
13
+ test.scenarios('vlt_all')
14
+ test.top_filename = "t_trace_two_a.v"
15
+ test.pli_filename = "t/t_trace_two_cc.cpp"
16
+
17
+ test.compile(make_main=False,
18
+ verilator_make_gmake=False,
19
+ top_filename='t_trace_two_b.v',
20
+ vm_prefix='Vt_trace_two_b',
21
+ verilator_flags2=['--trace-fst --trace-threads 1'])
22
+
23
+ test.run(logfile=test.obj_dir + "/make_first_ALL.log",
24
+ cmd=[
25
+ os.environ["MAKE"], "-C", "" + test.obj_dir, "-f", "Vt_trace_two_b.mk",
26
+ "Vt_trace_two_b__ALL.cpp"
27
+ ])
28
+
29
+ test.compile(
30
+ make_main=False,
31
+ top_filename='t_trace_two_a.v',
32
+ make_flags=['CPPFLAGS_ADD="-DTEST_HDR_TRACE=1 -DTEST_FST=1"'],
33
+ verilator_flags2=['-exe', '--trace-fst --trace-threads 1', '-DTEST_FST', test.pli_filename])
34
+
35
+ test.execute()
36
+
37
+ if test.vlt_all:
38
+ test.fst_identical(test.trace_filename, test.golden_filename)
39
+
40
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_port_cc.out ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $version Generated by VerilatedVcd $end
2
+ $timescale 1ps $end
3
+ $scope module topa $end
4
+ $var wire 1 # clk $end
5
+ $scope module t $end
6
+ $var wire 1 # clk $end
7
+ $var wire 32 $ cyc [31:0] $end
8
+ $var wire 32 % c_trace_on [31:0] $end
9
+ $scope module sub $end
10
+ $var wire 32 & inside_sub_a [31:0] $end
11
+ $upscope $end
12
+ $upscope $end
13
+ $upscope $end
14
+ $scope module topb $end
15
+ $var wire 1 ( clk $end
16
+ $scope module t $end
17
+ $var wire 1 ( clk $end
18
+ $var wire 32 + cyc [31:0] $end
19
+ $var wire 32 , c_trace_on [31:0] $end
20
+ $var real 64 ) r $end
21
+ $scope module sub $end
22
+ $var wire 32 - inside_sub_a [31:0] $end
23
+ $upscope $end
24
+ $upscope $end
25
+ $upscope $end
26
+ $enddefinitions $end
27
+
28
+
29
+ #10
30
+ 1#
31
+ b00000000000000000000000000000001 $
32
+ b00000000000000000000000000000000 %
33
+ 1(
34
+ r0 )
35
+ b00000000000000000000000000000001 &
36
+ b00000000000000000000000000000001 +
37
+ b00000000000000000000000000000000 ,
38
+ b00000000000000000000000000000010 -
39
+ #15
40
+ 0#
41
+ 0(
42
+ #20
43
+ 1#
44
+ b00000000000000000000000000000010 $
45
+ b00000000000000000000000000000011 %
46
+ 1(
47
+ r0.1 )
48
+ #25
49
+ 0#
50
+ 0(
51
+ #30
52
+ 1#
53
+ b00000000000000000000000000000011 $
54
+ b00000000000000000000000000000100 %
55
+ 1(
56
+ r0.2 )
57
+ #35
58
+ 0#
59
+ 0(
60
+ #40
61
+ 1#
62
+ b00000000000000000000000000000100 $
63
+ b00000000000000000000000000000101 %
64
+ 1(
65
+ r0.3 )
66
+ #45
67
+ 0#
68
+ 0(
69
+ #50
70
+ 1#
71
+ b00000000000000000000000000000101 $
72
+ b00000000000000000000000000000110 %
73
+ 1(
74
+ r0.4 )
75
+ #55
76
+ 0#
77
+ 0(
78
+ #60
79
+ 1#
80
+ b00000000000000000000000000000110 $
81
+ b00000000000000000000000000000111 %
82
+ 1(
83
+ r0.5 )
84
+ #65
85
+ 0#
86
+ 0(
87
+ #70
88
+ 1#
89
+ b00000000000000000000000000000111 $
90
+ b00000000000000000000000000001000 %
91
+ 1(
92
+ r0.6 )
93
+ #75
94
+ 0#
95
+ 0(
96
+ #80
97
+ 1#
98
+ b00000000000000000000000000001000 $
99
+ b00000000000000000000000000001001 %
100
+ 1(
101
+ r0.7 )
102
+ #85
103
+ 0#
104
+ 0(
105
+ #90
106
+ 1#
107
+ b00000000000000000000000000001001 $
108
+ b00000000000000000000000000001010 %
109
+ 1(
110
+ r0.7999999999999999 )
111
+ #95
112
+ 0#
113
+ 0(
114
+ #100
115
+ 1#
116
+ b00000000000000000000000000001010 $
117
+ b00000000000000000000000000001011 %
118
+ 1(
119
+ r0.8999999999999999 )
120
+ #105
121
+ 0#
122
+ 0(
123
+ #110
124
+ 1#
125
+ b00000000000000000000000000001011 $
126
+ b00000000000000000000000000001100 %
127
+ 1(
128
+ r0.9999999999999999 )
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_port_cc.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ # Test tracing with two models instanced
11
+ import vltest_bootstrap
12
+
13
+ test.scenarios('vlt_all')
14
+ test.top_filename = "t_trace_two_a.v"
15
+ test.pli_filename = "t/t_trace_two_cc.cpp"
16
+
17
+ test.compile(make_main=False,
18
+ verilator_make_gmake=False,
19
+ top_filename='t_trace_two_b.v',
20
+ vm_prefix='Vt_trace_two_b',
21
+ verilator_flags2=['-trace'])
22
+
23
+ test.run(logfile=test.obj_dir + "/make_first_ALL.log",
24
+ cmd=[
25
+ os.environ["MAKE"], "-C", test.obj_dir, "-f", "Vt_trace_two_b.mk",
26
+ "Vt_trace_two_b__ALL.cpp"
27
+ ])
28
+
29
+ test.compile(make_main=False,
30
+ top_filename='t_trace_two_a.v',
31
+ verilator_flags2=['-exe', '-trace', test.pli_filename],
32
+ v_flags2=['+define+TEST_DUMPPORTS'])
33
+
34
+ test.execute()
35
+
36
+ if test.vlt_all:
37
+ test.file_grep(test.trace_filename, r'\$enddefinitions')
38
+ test.vcd_identical(test.trace_filename, test.golden_filename)
39
+
40
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_port_sc.out ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $version Generated by VerilatedVcd $end
2
+ $timescale 1ps $end
3
+ $scope module topa $end
4
+ $scope module t $end
5
+ $var wire 1 # clk $end
6
+ $var wire 32 $ cyc [31:0] $end
7
+ $var wire 32 % c_trace_on [31:0] $end
8
+ $scope module sub $end
9
+ $var wire 32 & inside_sub_a [31:0] $end
10
+ $upscope $end
11
+ $upscope $end
12
+ $upscope $end
13
+ $scope module topb $end
14
+ $scope module t $end
15
+ $var wire 1 ( clk $end
16
+ $var wire 32 + cyc [31:0] $end
17
+ $var wire 32 , c_trace_on [31:0] $end
18
+ $var real 64 ) r $end
19
+ $scope module sub $end
20
+ $var wire 32 - inside_sub_a [31:0] $end
21
+ $upscope $end
22
+ $upscope $end
23
+ $upscope $end
24
+ $enddefinitions $end
25
+
26
+
27
+ #0
28
+ 0#
29
+ b00000000000000000000000000000001 $
30
+ b00000000000000000000000000000000 %
31
+ 0(
32
+ r0 )
33
+ b00000000000000000000000000000001 &
34
+ b00000000000000000000000000000001 +
35
+ b00000000000000000000000000000000 ,
36
+ b00000000000000000000000000000010 -
37
+ #10000
38
+ 1#
39
+ b00000000000000000000000000000010 $
40
+ b00000000000000000000000000000011 %
41
+ 1(
42
+ r0.1 )
43
+ #15000
44
+ 0#
45
+ 0(
46
+ #20000
47
+ 1#
48
+ b00000000000000000000000000000011 $
49
+ b00000000000000000000000000000100 %
50
+ 1(
51
+ r0.2 )
52
+ #25000
53
+ 0#
54
+ 0(
55
+ #30000
56
+ 1#
57
+ b00000000000000000000000000000100 $
58
+ b00000000000000000000000000000101 %
59
+ 1(
60
+ r0.3 )
61
+ #35000
62
+ 0#
63
+ 0(
64
+ #40000
65
+ 1#
66
+ b00000000000000000000000000000101 $
67
+ b00000000000000000000000000000110 %
68
+ 1(
69
+ r0.4 )
70
+ #45000
71
+ 0#
72
+ 0(
73
+ #50000
74
+ 1#
75
+ b00000000000000000000000000000110 $
76
+ b00000000000000000000000000000111 %
77
+ 1(
78
+ r0.5 )
79
+ #55000
80
+ 0#
81
+ 0(
82
+ #60000
83
+ 1#
84
+ b00000000000000000000000000000111 $
85
+ b00000000000000000000000000001000 %
86
+ 1(
87
+ r0.6 )
88
+ #65000
89
+ 0#
90
+ 0(
91
+ #70000
92
+ 1#
93
+ b00000000000000000000000000001000 $
94
+ b00000000000000000000000000001001 %
95
+ 1(
96
+ r0.7 )
97
+ #75000
98
+ 0#
99
+ 0(
100
+ #80000
101
+ 1#
102
+ b00000000000000000000000000001001 $
103
+ b00000000000000000000000000001010 %
104
+ 1(
105
+ r0.7999999999999999 )
106
+ #85000
107
+ 0#
108
+ 0(
109
+ #90000
110
+ 1#
111
+ b00000000000000000000000000001010 $
112
+ b00000000000000000000000000001011 %
113
+ 1(
114
+ r0.8999999999999999 )
115
+ #95000
116
+ 0#
117
+ 0(
118
+ #100000
119
+ 1#
120
+ b00000000000000000000000000001011 $
121
+ b00000000000000000000000000001100 %
122
+ 1(
123
+ r0.9999999999999999 )
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_port_sc.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+
14
+ if not test.have_sc:
15
+ test.skip("No SystemC installed")
16
+
17
+ top_filename = "t_trace_two_a.v"
18
+ test.pli_filename = "t/t_trace_two_sc.cpp"
19
+
20
+ test.compile(make_main=False,
21
+ verilator_make_gmake=False,
22
+ top_filename='t_trace_two_b.v',
23
+ vm_prefix='Vt_trace_two_b',
24
+ verilator_flags2=['-sc -trace'])
25
+
26
+ test.run(logfile=test.obj_dir + "/make_first_ALL.log",
27
+ cmd=[
28
+ os.environ["MAKE"], "-C", test.obj_dir, "-f", "Vt_trace_two_b.mk",
29
+ "Vt_trace_two_b__ALL.cpp"
30
+ ])
31
+
32
+ test.compile(make_main=False,
33
+ top_filename='t_trace_two_a.v',
34
+ verilator_flags2=['-sc', '-exe', '-trace', test.pli_filename],
35
+ v_flags2=['+define+TEST_DUMPPORTS'])
36
+
37
+ test.execute()
38
+
39
+ if test.vlt_all:
40
+ test.file_grep(test.trace_filename, r'\$enddefinitions')
41
+ test.vcd_identical(test.trace_filename, test.golden_filename)
42
+
43
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_portfst_cc.out ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $date
2
+ Sat Mar 30 14:08:31 2024
3
+
4
+ $end
5
+ $version
6
+ fstWriter
7
+ $end
8
+ $timescale
9
+ 1ps
10
+ $end
11
+ $scope module topa $end
12
+ $var wire 1 ! clk $end
13
+ $scope module t $end
14
+ $var wire 1 ! clk $end
15
+ $var integer 32 " cyc [31:0] $end
16
+ $var integer 32 # c_trace_on [31:0] $end
17
+ $scope module sub $end
18
+ $var integer 32 $ inside_sub_a [31:0] $end
19
+ $upscope $end
20
+ $upscope $end
21
+ $upscope $end
22
+ $scope module topb $end
23
+ $var wire 1 % clk $end
24
+ $scope module t $end
25
+ $var wire 1 % clk $end
26
+ $var integer 32 & cyc [31:0] $end
27
+ $var integer 32 ' c_trace_on [31:0] $end
28
+ $var real 64 ( r $end
29
+ $scope module sub $end
30
+ $var integer 32 ) inside_sub_a [31:0] $end
31
+ $upscope $end
32
+ $upscope $end
33
+ $upscope $end
34
+ $enddefinitions $end
35
+ #10
36
+ $dumpvars
37
+ b00000000000000000000000000000010 )
38
+ r0 (
39
+ b00000000000000000000000000000000 '
40
+ b00000000000000000000000000000001 &
41
+ 1%
42
+ b00000000000000000000000000000001 $
43
+ b00000000000000000000000000000000 #
44
+ b00000000000000000000000000000001 "
45
+ 1!
46
+ $end
47
+ #15
48
+ 0!
49
+ 0%
50
+ #20
51
+ 1%
52
+ 1!
53
+ b00000000000000000000000000000010 "
54
+ b00000000000000000000000000000011 #
55
+ r0.1 (
56
+ #25
57
+ 0!
58
+ 0%
59
+ #30
60
+ 1%
61
+ 1!
62
+ r0.2 (
63
+ b00000000000000000000000000000100 #
64
+ b00000000000000000000000000000011 "
65
+ #35
66
+ 0!
67
+ 0%
68
+ #40
69
+ 1%
70
+ 1!
71
+ b00000000000000000000000000000100 "
72
+ b00000000000000000000000000000101 #
73
+ r0.3 (
74
+ #45
75
+ 0!
76
+ 0%
77
+ #50
78
+ 1%
79
+ 1!
80
+ r0.4 (
81
+ b00000000000000000000000000000110 #
82
+ b00000000000000000000000000000101 "
83
+ #55
84
+ 0!
85
+ 0%
86
+ #60
87
+ 1%
88
+ 1!
89
+ b00000000000000000000000000000110 "
90
+ b00000000000000000000000000000111 #
91
+ r0.5 (
92
+ #65
93
+ 0!
94
+ 0%
95
+ #70
96
+ 1%
97
+ 1!
98
+ r0.6 (
99
+ b00000000000000000000000000001000 #
100
+ b00000000000000000000000000000111 "
101
+ #75
102
+ 0!
103
+ 0%
104
+ #80
105
+ 1%
106
+ 1!
107
+ b00000000000000000000000000001000 "
108
+ b00000000000000000000000000001001 #
109
+ r0.7 (
110
+ #85
111
+ 0!
112
+ 0%
113
+ #90
114
+ 1%
115
+ 1!
116
+ r0.7999999999999999 (
117
+ b00000000000000000000000000001010 #
118
+ b00000000000000000000000000001001 "
119
+ #95
120
+ 0!
121
+ 0%
122
+ #100
123
+ 1%
124
+ 1!
125
+ b00000000000000000000000000001010 "
126
+ b00000000000000000000000000001011 #
127
+ r0.8999999999999999 (
128
+ #105
129
+ 0!
130
+ 0%
131
+ #110
132
+ 1%
133
+ 1!
134
+ r0.9999999999999999 (
135
+ b00000000000000000000000000001100 #
136
+ b00000000000000000000000000001011 "
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_portfst_cc.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ # Test tracing with two models instanced
11
+ import vltest_bootstrap
12
+
13
+ test.scenarios('vlt_all')
14
+ test.top_filename = "t_trace_two_a.v"
15
+ test.pli_filename = "t/t_trace_two_cc.cpp"
16
+
17
+ test.compile(make_main=False,
18
+ verilator_make_gmake=False,
19
+ top_filename='t_trace_two_b.v',
20
+ vm_prefix='Vt_trace_two_b',
21
+ verilator_flags2=['--trace-fst --trace-threads 1'])
22
+
23
+ test.run(logfile=test.obj_dir + "/make_first_ALL.log",
24
+ cmd=[
25
+ os.environ["MAKE"], "-C", "" + test.obj_dir, "-f", "Vt_trace_two_b.mk",
26
+ "Vt_trace_two_b__ALL.cpp"
27
+ ])
28
+
29
+ test.compile(
30
+ make_main=False,
31
+ top_filename='t_trace_two_a.v',
32
+ verilator_flags2=['-exe', '--trace-fst --trace-threads 1', '-DTEST_FST', test.pli_filename],
33
+ v_flags2=['+define+TEST_DUMPPORTS'])
34
+
35
+ test.execute()
36
+
37
+ if test.vlt_all:
38
+ test.fst_identical(test.trace_filename, test.golden_filename)
39
+
40
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_two_sc.cpp ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test
2
+ //
3
+ // Copyright 2003-2020 by Wilson Snyder. This program is free software; you can
4
+ // redistribute it and/or modify it under the terms of either the GNU
5
+ // Lesser General Public License Version 3 or the Perl Artistic License
6
+ // Version 2.0.
7
+ // SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
8
+
9
+ // clang-format off
10
+ #include "verilatedos.h"
11
+ #include VM_PREFIX_INCLUDE
12
+ #include "Vt_trace_two_b.h"
13
+ #include "verilated.h"
14
+ #ifdef TEST_HDR_TRACE
15
+ # include "verilated_vcd_sc.h"
16
+ #endif
17
+ // clang-format on
18
+
19
+ // Compile in place
20
+ #include "Vt_trace_two_b__ALL.cpp"
21
+
22
+ // General headers
23
+ #include "verilated.h"
24
+
25
+ #include "systemc.h"
26
+
27
+ VM_PREFIX* ap;
28
+ Vt_trace_two_b* bp;
29
+
30
+ int sc_main(int argc, char** argv) {
31
+ Verilated::debug(0);
32
+ Verilated::traceEverOn(true);
33
+ Verilated::commandArgs(argc, argv);
34
+
35
+ sc_signal<bool> clk;
36
+ sc_time sim_time(1100, SC_NS);
37
+ srand48(5);
38
+ ap = new VM_PREFIX{"topa"};
39
+ bp = new Vt_trace_two_b{"topb"};
40
+ ap->clk(clk);
41
+ bp->clk(clk);
42
+
43
+ #ifdef TEST_HDR_TRACE
44
+ VerilatedVcdSc* tfp = new VerilatedVcdSc;
45
+ sc_core::sc_start(sc_core::SC_ZERO_TIME);
46
+ ap->trace(tfp, 99);
47
+ bp->trace(tfp, 99);
48
+ tfp->open(VL_STRINGIFY(TEST_OBJ_DIR) "/simx.vcd");
49
+ #endif
50
+ {
51
+ clk = false;
52
+ sc_start(10, SC_NS);
53
+ }
54
+ while (sc_time_stamp() < sim_time && !Verilated::gotFinish()) {
55
+ clk = !clk;
56
+ sc_start(5, SC_NS);
57
+ }
58
+ if (!Verilated::gotFinish()) {
59
+ vl_fatal(__FILE__, __LINE__, "main", "%Error: Timeout; never got a $finish");
60
+ }
61
+ ap->final();
62
+ bp->final();
63
+ #ifdef TEST_HDR_TRACE
64
+ if (tfp) tfp->close();
65
+ #endif
66
+
67
+ VL_DO_DANGLING(delete ap, ap);
68
+ VL_DO_DANGLING(delete bp, bp);
69
+ return 0;
70
+ }
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_ub_misaligned_address.out ADDED
@@ -0,0 +1 @@
 
 
1
+ *-* All Finished *-*
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_ub_misaligned_address.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+ test.top_filename = "t/t_trace_ub_misaligned_address.v"
14
+
15
+ test.compile(verilator_flags2=["--binary --trace-vcd", "--runtime-debug"])
16
+
17
+ test.execute(aslr_off=True)
18
+
19
+ # Make sure that there are no additional messages (such as runtime messages
20
+ # regarding undefined behavior).test.files_identical(test.obj_dir + "/vlt_sim.log", test.golden_filename, "logfile")
21
+
22
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_ub_misaligned_address.v ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // When compiled using -fsanitize=address,undefined this triggered:
4
+ //
5
+ // verilated_trace_imp.h:875:5: runtime error: store to misaligned address ...
6
+ // verilated_trace.h:450:31: runtime error: load of misaligned address ...
7
+ //
8
+ // due to 32 bit aligned addresses being used for types which require
9
+ // stricter alignment.
10
+ //
11
+ // This file ONLY is placed under the Creative Commons Public Domain, for
12
+ // any use, without warranty, 2023 by John Wehle.
13
+ // SPDX-License-Identifier: CC0-1.0
14
+
15
+ `define STRINGIFY(x) `"x`"
16
+
17
+ module t;
18
+
19
+ wire [2:0] out;
20
+ reg in;
21
+ reg [39:0] p;
22
+ reg rst;
23
+ reg clk;
24
+
25
+ initial begin
26
+ $dumpfile(`STRINGIFY(`TEST_DUMPFILE));
27
+ $dumpvars(0, test);
28
+
29
+ clk = 0;
30
+ rst = 0;
31
+
32
+ for (int i = 0; i < 2; i++)
33
+ begin
34
+ #10 rst = 1;
35
+ #10 rst = 0;
36
+
37
+ p = 40'b0000000000111111111111111111110000000000;
38
+
39
+ in = i[0];
40
+
41
+ for (int k = 0; k < 31; k++)
42
+ begin
43
+ in = p[39 - k] ^ i[0];
44
+ #1;
45
+ end
46
+
47
+ end
48
+
49
+ #30 $write("*-* All Finished *-*\n");
50
+ $finish;
51
+ end
52
+
53
+ always begin
54
+ #10 clk <= !clk;
55
+ end
56
+
57
+ Test test(.out(out), .in(in),
58
+ .clk(clk), .rst(rst));
59
+ endmodule
60
+
61
+
62
+ module Test(/*AUTOARG*/
63
+ // Outputs
64
+ out,
65
+ // Inputs
66
+ clk, in, rst
67
+ );
68
+
69
+ input clk;
70
+ input in;
71
+ input rst;
72
+ output wire [2:0] out;
73
+
74
+ reg [2:0] s;
75
+ reg sin;
76
+
77
+ assign out = s;
78
+
79
+ always @(posedge clk, posedge rst)
80
+ begin
81
+ s[0] <= s[2];
82
+ s[2] <= in;
83
+ s[1] <= sin;
84
+ end
85
+
86
+ always @(negedge clk, posedge rst)
87
+ if (rst)
88
+ sin <= 1'b0;
89
+ else
90
+ sin <= in;
91
+
92
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_wide_struct.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+
14
+ test.compile(verilator_flags2=['--trace-vcd --trace-structs'])
15
+
16
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_trace_wide_struct.v ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2011 by Wilson Snyder.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t (/*AUTOARG*/
8
+ // Inputs
9
+ clk
10
+ );
11
+ input clk;
12
+
13
+ typedef struct {
14
+ logic [64:0] long_signal;
15
+ } mystruct_t;
16
+
17
+ mystruct_t mystruct;
18
+
19
+ initial begin
20
+ $finish;
21
+ end
22
+
23
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_and_eqcase.out ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ %Error-UNSUPPORTED: t/t_tri_and_eqcase.v:9:29: Unsupported tristate construct: AND in function getEnExprBasedOnOriginalp
2
+ 9 | logic b = 1'bz === (clk1 & clk2);
3
+ | ^
4
+ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
5
+ %Error: Internal Error: t/t_tri_and_eqcase.v:9:19: ../V3Ast.cpp:#: Null item passed to setOp2p
6
+ 9 | logic b = 1'bz === (clk1 & clk2);
7
+ | ^~~
8
+ ... This fatal error may be caused by the earlier error(s); resolve those first.
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_and_eqcase.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('vlt')
13
+
14
+ test.lint(fails=test.vlt_all, expect_filename=test.golden_filename)
15
+
16
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_and_eqcase.v ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2022 by Antmicro Ltd.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t (clk1, clk2);
8
+ input wire clk1, clk2;
9
+ logic b = 1'bz === (clk1 & clk2);
10
+
11
+ always begin
12
+ if (!b) begin
13
+ $write("*-* All Finished *-*\n");
14
+ $finish;
15
+ end
16
+ end
17
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array.out ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ %Error-UNSUPPORTED: t/t_tri_array.v:25:25: Unsupported LHS tristate construct: ARRAYSEL
2
+ : ... note: In instance 't'
3
+ 25 | Pad pad1 (.pad(pad[g]),
4
+ | ^
5
+ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
6
+ %Error-UNSUPPORTED: t/t_tri_array.v:28:25: Unsupported LHS tristate construct: ARRAYSEL
7
+ : ... note: In instance 't'
8
+ 28 | Pad pad0 (.pad(pad[g]),
9
+ | ^
10
+ %Error: Exiting due to
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator_st')
13
+
14
+ test.compile(fails=test.vlt_all, expect_filename=test.golden_filename)
15
+
16
+ if not test.vlt_all:
17
+ test.execute()
18
+
19
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array.v ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2014 by Wilson Snyder.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t (/*AUTOARG*/
8
+ // Inputs
9
+ clk
10
+ );
11
+ input clk;
12
+
13
+ integer cyc = 0;
14
+ reg [63:0] crc;
15
+ reg [63:0] sum;
16
+
17
+ parameter NPAD = 4;
18
+
19
+ tri pad [NPAD-1:0]; // Array
20
+ wire [NPAD-1:0] data0 = crc[0 +: 4];
21
+ wire [NPAD-1:0] data1 = crc[8 +: 4];
22
+ wire [NPAD-1:0] en = crc[16 +: 4];
23
+
24
+ for (genvar g=0; g<NPAD; ++g) begin : gpad
25
+ Pad pad1 (.pad(pad[g]),
26
+ .ena(en[g]),
27
+ .data(data1[g]));
28
+ Pad pad0 (.pad(pad[g]),
29
+ .ena(!en[g]),
30
+ .data(data0[g]));
31
+ end
32
+
33
+ // Test loop
34
+ always @ (posedge clk) begin
35
+ `ifdef TEST_VERBOSE
36
+ $write("[%0t] cyc==%0d crc=%x result=%x\n", $time, cyc, crc, result);
37
+ `endif
38
+ cyc <= cyc + 1;
39
+ crc <= {crc[62:0], crc[63] ^ crc[2] ^ crc[0]};
40
+ sum <= {60'h0, pad[3], pad[2], pad[1], pad[0]}
41
+ ^ {sum[62:0], sum[63] ^ sum[2] ^ sum[0]};
42
+ if (cyc==0) begin
43
+ // Setup
44
+ crc <= 64'h5aef0c8d_d70a4497;
45
+ sum <= 64'h0;
46
+ end
47
+ else if (cyc<10) begin
48
+ sum <= 64'h0;
49
+ end
50
+ else if (cyc<90) begin
51
+ end
52
+ else if (cyc==99) begin
53
+ $write("[%0t] cyc==%0d crc=%x sum=%x\n", $time, cyc, crc, sum);
54
+ if (crc !== 64'hc77bb9b3784ea091) $stop;
55
+ // What checksum will we end up with (above print should match)
56
+ `define EXPECTED_SUM 64'he09fe6f2dfd7a302
57
+ if (sum !== `EXPECTED_SUM) $stop;
58
+ $write("*-* All Finished *-*\n");
59
+ $finish;
60
+ end
61
+ end
62
+
63
+ endmodule
64
+
65
+ module Pad
66
+ (inout pad,
67
+ input ena,
68
+ input data);
69
+ assign pad = ena ? data : 1'bz;
70
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array_bufif.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+
14
+ test.compile()
15
+
16
+ test.execute()
17
+
18
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array_bufif.v ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2011 by Wilson Snyder.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t (/*AUTOARG*/
8
+ // Inputs
9
+ clk
10
+ );
11
+ input clk;
12
+
13
+ integer cyc = 0;
14
+ reg [63:0] crc;
15
+ reg [63:0] sum;
16
+
17
+ parameter DW = 4;
18
+ wire [3:0] drv_a = crc[3:0];
19
+ wire [3:0] drv_b = crc[7:4];
20
+ wire [3:0] drv_e = crc[19:16];
21
+
22
+ /*AUTOWIRE*/
23
+ // Beginning of automatic wires (for undeclared instantiated-module outputs)
24
+ wire [DW-1:0] drv; // To/From test1 of Test1.v
25
+ wire [DW-1:0] drv2; // From test2 of Test2.v
26
+ // End of automatics
27
+
28
+ Test1 test1 (/*AUTOINST*/
29
+ // Inouts
30
+ .drv (drv[DW-1:0]),
31
+ // Inputs
32
+ .drv_a (drv_a[DW-1:0]),
33
+ .drv_b (drv_b[DW-1:0]),
34
+ .drv_e (drv_e[DW-1:0]));
35
+ Test2 test2 (/*AUTOINST*/
36
+ // Outputs
37
+ .drv2 (drv2[DW-1:0]),
38
+ // Inputs
39
+ .drv_a (drv_a[DW-1:0]),
40
+ .drv_b (drv_b[DW-1:0]),
41
+ .drv_e (drv_e[DW-1:0]));
42
+
43
+ // Aggregate outputs into a single result vector
44
+ wire [63:0] result = {60'h0, drv};
45
+
46
+ // Test loop
47
+ always @ (posedge clk) begin
48
+ `ifdef TEST_VERBOSE
49
+ $write("[%0t] cyc==%0d crc=%x drv=%x %x (%b??%b:%b)\n", $time, cyc, crc, drv, drv2, drv_e,drv_a,drv_b);
50
+ `endif
51
+ cyc <= cyc + 1;
52
+ crc <= {crc[62:0], crc[63] ^ crc[2] ^ crc[0]};
53
+ sum <= result ^ {sum[62:0], sum[63] ^ sum[2] ^ sum[0]};
54
+ if (cyc==0) begin
55
+ // Setup
56
+ crc <= 64'h5aef0c8d_d70a4497;
57
+ sum <= 64'h0;
58
+ end
59
+ else if (cyc<10) begin
60
+ sum <= 64'h0;
61
+ end
62
+ else if (cyc<90) begin
63
+ if (drv2 != drv) $stop;
64
+ end
65
+ else if (cyc==99) begin
66
+ $write("[%0t] cyc==%0d crc=%x sum=%x\n", $time, cyc, crc, sum);
67
+ if (crc !== 64'hc77bb9b3784ea091) $stop;
68
+ // What checksum will we end up with (above print should match)
69
+ `define EXPECTED_SUM 64'hd95d216c5a2945d0
70
+ if (sum !== `EXPECTED_SUM) $stop;
71
+ $write("*-* All Finished *-*\n");
72
+ $finish;
73
+ end
74
+ end
75
+
76
+ endmodule
77
+
78
+ module Test1 #(
79
+ parameter DW = 4
80
+ )(
81
+ input wire [DW-1:0] drv_a,
82
+ input wire [DW-1:0] drv_b,
83
+ input wire [DW-1:0] drv_e,
84
+ inout wire [DW-1:0] drv
85
+ );
86
+
87
+ wire drv_0, drv_1, drv_2, drv_3;
88
+ bufif1 bufa0 (drv_0, drv_a[0], drv_e[0]);
89
+ bufif1 bufb0 (drv_0, drv_b[0], ~drv_e[0]);
90
+ bufif1 bufa1 (drv_1, drv_a[1], drv_e[1]);
91
+ bufif1 bufb1 (drv_1, drv_b[1], ~drv_e[1]);
92
+ bufif1 bufa2 (drv_2, drv_a[2], drv_e[2]);
93
+ bufif1 bufb2 (drv_2, drv_b[2], ~drv_e[2]);
94
+ bufif1
95
+ bufa3 (drv_3, drv_a[3], drv_e[3]),
96
+ bufb3 (drv_3, drv_b[3], ~drv_e[3]);
97
+ assign drv = {drv_3,drv_2,drv_1,drv_0};
98
+
99
+ endmodule
100
+
101
+ module Test2 #(
102
+ parameter DW = 4
103
+ )(
104
+ input wire [DW-1:0] drv_a,
105
+ input wire [DW-1:0] drv_b,
106
+ input wire [DW-1:0] drv_e,
107
+ inout wire [DW-1:0] drv2
108
+ );
109
+
110
+ wire [DW-1:0] drv_all;
111
+ bufif1 bufa [DW-1:0] (drv_all, drv_a, drv_e);
112
+ // Below ~= bufif1 bufb [DW-1:0] (drv_all, drv_b, ~drv_e);
113
+ bufif1 bufb [DW-1:0] ({drv_all[3], drv_all[2], drv_all[1], drv_all[0]},
114
+ {drv_b[3], drv_b[2], drv_b[1], drv_b[0]},
115
+ {~drv_e[3], ~drv_e[2], ~drv_e[1], ~drv_e[0]});
116
+ assign drv2 = drv_all;
117
+
118
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array_pull.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+
14
+ test.compile()
15
+
16
+ test.execute()
17
+
18
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_array_pull.v ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed into the Public Domain, for any use,
4
+ // without warranty, 2018 by Rod Steward.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module IOBUF ( input T, input I, output O, inout IO );
8
+ assign O = IO;
9
+ assign IO = T ? 1'bz : I;
10
+ endmodule
11
+
12
+ module t
13
+ (
14
+ input [7:0] inlines,
15
+ output [7:0] outlines,
16
+ inout [7:0] iolines,
17
+
18
+ input inctrl
19
+ );
20
+
21
+ generate for (genvar i = 4; i < 8; i = i+1) begin: Gen_D
22
+ IOBUF d ( .T(inctrl), .I(inlines[i]), .O(outlines[i]), .IO(iolines[i]) );
23
+ pullup d_pup (iolines[i]);
24
+ end
25
+ endgenerate
26
+
27
+ IOBUF d_0 ( .T(inctrl), .I(inlines[0]), .O(outlines[0]), .IO(iolines[0]) );
28
+ pullup d_0_pup (iolines[0]);
29
+
30
+ IOBUF d_1 ( .T(inctrl), .I(inlines[1]), .O(outlines[1]), .IO(iolines[1]) );
31
+ pullup d_1_pup (iolines[1]);
32
+
33
+ IOBUF d_2 ( .T(inctrl), .I(inlines[2]), .O(outlines[2]), .IO(iolines[2]) );
34
+ pullup d_2_pup (iolines[2]);
35
+
36
+ IOBUF d_3 ( .T(inctrl), .I(inlines[3]), .O(outlines[3]), .IO(iolines[3]) );
37
+ pullup d_3_pup (iolines[3]);
38
+
39
+ initial begin
40
+ $write("*-* All Finished *-*\n");
41
+ $finish;
42
+ end
43
+
44
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_compass_bad.out ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ %Error-UNSUPPORTED: t/t_tri_compass_bad.v:16:12: Unsupported: tristate in top-level IO: '__pinNumber1'
2
+ : ... note: In instance 't'
3
+ 16 | sub sub(i, o);
4
+ | ^
5
+ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
6
+ %Error: Exiting due to
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_compass_bad.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('vlt')
13
+
14
+ test.lint(fails=True, expect_filename=test.golden_filename)
15
+
16
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_compass_bad.v ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2020 by Wilson Snyder.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t(/*AUTOARG*/
8
+ // Outputs
9
+ o,
10
+ // Inputs
11
+ i
12
+ );
13
+
14
+ input i;
15
+ output o;
16
+ sub sub(i, o);
17
+ endmodule
18
+
19
+ module sub(input i, output o);
20
+ assign o = (i===1'bz) ? 1'b0 : i;
21
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_cond_eqcase_with_1.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+
14
+ test.compile()
15
+
16
+ test.execute()
17
+
18
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_cond_eqcase_with_1.v ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2022 by Antmicro Ltd.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t (/*AUTOARG*/
8
+ // Inputs
9
+ clk
10
+ );
11
+ input clk;
12
+ wire a;
13
+ assign a = 1 === (clk ? 1 : 1'bz);
14
+
15
+ always begin
16
+ if (!a) begin
17
+ $write("*-* All Finished *-*\n");
18
+ $finish;
19
+ end
20
+ end
21
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_dangle.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+
14
+ test.compile()
15
+
16
+ test.execute(all_run_flags=['+verilator+rand+reset+0'])
17
+
18
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_dangle.v ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2011 by Wilson Snyder.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t (/*AUTOARG*/
8
+ // Inouts
9
+ AVDD, AVSS
10
+ );
11
+ inout AVDD;
12
+ inout AVSS;
13
+
14
+ sub sub (/*AUTOINST*/
15
+ // Inouts
16
+ .AVDD (AVDD),
17
+ .AVSS (AVSS));
18
+
19
+ initial begin
20
+ $write("*-* All Finished *-*\n");
21
+ $finish;
22
+ end
23
+ endmodule
24
+
25
+ module sub (/*AUTOARG*/
26
+ // Inouts
27
+ AVDD, AVSS
28
+ );
29
+ // verilator no_inline_module
30
+ inout AVDD;
31
+ inout AVSS;
32
+ tri NON_IO;
33
+ // +verilator+rand+reset+0 so z will read as zero
34
+ initial if (NON_IO !== 'z) $stop;
35
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_eqcase.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+
14
+ test.compile()
15
+
16
+ test.execute()
17
+
18
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_eqcase.v ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2011 by Wilson Snyder.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t (/*AUTOARG*/
8
+ // Inputs
9
+ clk
10
+ );
11
+ input clk;
12
+
13
+ integer cyc = 0;
14
+ reg [63:0] crc;
15
+ reg [63:0] sum;
16
+
17
+ wire [3:0] drv_a = crc[3:0];
18
+ wire [3:0] drv_b = crc[7:4];
19
+ wire [3:0] drv_e = crc[19:16];
20
+
21
+ /*AUTOWIRE*/
22
+ // Beginning of automatic wires (for undeclared instantiated-module outputs)
23
+ wire [8:0] match1; // From test1 of Test1.v
24
+ wire [8:0] match2; // From test2 of Test2.v
25
+ // End of automatics
26
+
27
+ Test1 test1 (/*AUTOINST*/
28
+ // Outputs
29
+ .match1 (match1[8:0]),
30
+ // Inputs
31
+ .drv_a (drv_a[3:0]),
32
+ .drv_e (drv_e[3:0]));
33
+ Test2 test2 (/*AUTOINST*/
34
+ // Outputs
35
+ .match2 (match2[8:0]),
36
+ // Inputs
37
+ .drv_a (drv_a[3:0]),
38
+ .drv_e (drv_e[3:0]));
39
+
40
+ // Aggregate outputs into a single result vector
41
+ wire [63:0] result = {39'h0, match2, 7'h0, match1};
42
+
43
+ // Test loop
44
+ always @ (posedge clk) begin
45
+ `ifdef TEST_VERBOSE
46
+ $write("[%0t] cyc==%0d crc=%x m1=%x m2=%x (%b??%b:%b)\n", $time, cyc, crc, match1, match2, drv_e,drv_a,drv_b);
47
+ `endif
48
+ cyc <= cyc + 1;
49
+ crc <= {crc[62:0], crc[63] ^ crc[2] ^ crc[0]};
50
+ sum <= result ^ {sum[62:0], sum[63] ^ sum[2] ^ sum[0]};
51
+ if (cyc==0) begin
52
+ // Setup
53
+ crc <= 64'h5aef0c8d_d70a4497;
54
+ sum <= 64'h0;
55
+ end
56
+ else if (cyc<10) begin
57
+ sum <= 64'h0;
58
+ end
59
+ else if (cyc<90) begin
60
+ end
61
+ else if (cyc==99) begin
62
+ $write("[%0t] cyc==%0d crc=%x sum=%x\n", $time, cyc, crc, sum);
63
+ if (crc !== 64'hc77bb9b3784ea091) $stop;
64
+ // What checksum will we end up with (above print should match)
65
+ `define EXPECTED_SUM 64'hc0c4a2b9aea7c4b4
66
+ if (sum !== `EXPECTED_SUM) $stop;
67
+ $write("*-* All Finished *-*\n");
68
+ $finish;
69
+ end
70
+ end
71
+
72
+ endmodule
73
+
74
+ module Test1
75
+ (
76
+ input wire [3:0] drv_a,
77
+ input wire [3:0] drv_e,
78
+ output wire [8:0] match1
79
+ );
80
+
81
+ wire [2:1] drv_all;
82
+ bufif1 bufa [2:1] (drv_all, drv_a[2:1], drv_e[2:1]);
83
+
84
+ `ifdef VERILATOR
85
+ // At present Verilator only allows comparisons with Zs
86
+ assign match1[0] = (drv_a[2:1]== 2'b00 && drv_e[2:1]==2'b11);
87
+ assign match1[1] = (drv_a[2:1]== 2'b01 && drv_e[2:1]==2'b11);
88
+ assign match1[2] = (drv_a[2:1]== 2'b10 && drv_e[2:1]==2'b11);
89
+ assign match1[3] = (drv_a[2:1]== 2'b11 && drv_e[2:1]==2'b11);
90
+ `else
91
+ assign match1[0] = drv_all === 2'b00;
92
+ assign match1[1] = drv_all === 2'b01;
93
+ assign match1[2] = drv_all === 2'b10;
94
+ assign match1[3] = drv_all === 2'b11;
95
+ `endif
96
+ assign match1[4] = drv_all === 2'bz0;
97
+ assign match1[5] = drv_all === 2'bz1;
98
+ assign match1[6] = drv_all === 2'bzz;
99
+ assign match1[7] = drv_all === 2'b0z;
100
+ assign match1[8] = drv_all === 2'b1z;
101
+ endmodule
102
+
103
+ module Test2
104
+ (
105
+ input wire [3:0] drv_a,
106
+ input wire [3:0] drv_e,
107
+ output wire [8:0] match2
108
+ );
109
+
110
+ wire [2:1] drv_all;
111
+ bufif1 bufa [2:1] (drv_all, drv_a[2:1], drv_e[2:1]);
112
+
113
+ `ifdef VERILATOR
114
+ assign match2[0] = (drv_all !== 2'b00 || drv_e[2:1]!=2'b11);
115
+ assign match2[1] = (drv_all !== 2'b01 || drv_e[2:1]!=2'b11);
116
+ assign match2[2] = (drv_all !== 2'b10 || drv_e[2:1]!=2'b11);
117
+ assign match2[3] = (drv_all !== 2'b11 || drv_e[2:1]!=2'b11);
118
+ `else
119
+ assign match2[0] = drv_all !== 2'b00;
120
+ assign match2[1] = drv_all !== 2'b01;
121
+ assign match2[2] = drv_all !== 2'b10;
122
+ assign match2[3] = drv_all !== 2'b11;
123
+ `endif
124
+ assign match2[4] = drv_all !== 2'bz0;
125
+ assign match2[5] = drv_all !== 2'bz1;
126
+ assign match2[6] = drv_all !== 2'bzz;
127
+ assign match2[7] = drv_all !== 2'b0z;
128
+ assign match2[8] = drv_all !== 2'b1z;
129
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_eqcase_input.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # DESCRIPTION: Verilator: Verilog Test driver/expect definition
3
+ #
4
+ # Copyright 2024 by Wilson Snyder. This program is free software; you
5
+ # can redistribute it and/or modify it under the terms of either the GNU
6
+ # Lesser General Public License Version 3 or the Perl Artistic License
7
+ # Version 2.0.
8
+ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
9
+
10
+ import vltest_bootstrap
11
+
12
+ test.scenarios('simulator')
13
+
14
+ test.compile()
15
+
16
+ test.execute()
17
+
18
+ test.passes()
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_eqcase_input.v ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DESCRIPTION: Verilator: Verilog Test module
2
+ //
3
+ // This file ONLY is placed under the Creative Commons Public Domain, for
4
+ // any use, without warranty, 2022 by Antmicro Ltd.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ module t (/*AUTOARG*/
8
+ // Inputs
9
+ clk
10
+ );
11
+ input clk;
12
+ wire a = 1'bz === clk;
13
+
14
+ always begin
15
+ if (a) begin
16
+ $write("*-* All Finished *-*\n");
17
+ $finish;
18
+ end
19
+ end
20
+ endmodule
snapshots/verilator_verilator_pr6870/test_regress/t/t_tri_gate.cpp ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // -*- mode: C++; c-file-style: "cc-mode" -*-
2
+ //
3
+ // This file ONLY is placed into the Public Domain, for any use,
4
+ // without warranty, 2008 by Lane Brooks.
5
+ // SPDX-License-Identifier: CC0-1.0
6
+
7
+ #include VM_PREFIX_INCLUDE
8
+
9
+ VM_PREFIX* tb = nullptr;
10
+
11
+ bool check() {
12
+ bool pass;
13
+ int c = (tb->A >> tb->SEL) & 0x1;
14
+ #ifdef TEST_VERBOSE
15
+ bool verbose = true;
16
+ #else
17
+ bool verbose = false;
18
+ #endif
19
+
20
+ if (tb->W == c && tb->X == c && tb->Y == c && tb->Z == c) {
21
+ pass = true;
22
+ if (verbose) printf("- pass: ");
23
+ } else {
24
+ pass = false;
25
+ verbose = true;
26
+ printf("%%E-FAIL: ");
27
+ }
28
+ if (verbose) {
29
+ printf("SEL=%d A=%d got: W=%d X=%d Y=%d Z=%d exp: WXYZ=%d\n", tb->SEL, tb->A, tb->W,
30
+ tb->X, tb->Y, tb->Z, c);
31
+ }
32
+ return pass;
33
+ }
34
+
35
+ int main() {
36
+ Verilated::debug(0);
37
+ tb = new VM_PREFIX{"tb"};
38
+
39
+ // loop through every possibility and check the result
40
+ bool pass = true;
41
+ for (tb->SEL = 0; tb->SEL < 2; tb->SEL++) {
42
+ for (tb->A = 0; tb->A < 4; tb->A++) {
43
+ tb->eval();
44
+ if (!check()) pass = false;
45
+ }
46
+ }
47
+
48
+ if (pass) {
49
+ VL_PRINTF("*-* All Finished *-*\n");
50
+ tb->final();
51
+ } else {
52
+ vl_fatal(__FILE__, __LINE__, "top", "Unexpected results from tristate test\n");
53
+ }
54
+ VL_DO_DANGLING(delete tb, tb);
55
+ return 0;
56
+ }