Skip to content

Commit cf85b07

Browse files
committed
Tests: Add t_trace_enum_fst
1 parent 1d61998 commit cf85b07

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
CI_OS_NAME: linux
2121
CI_RUNS_ON: ubuntu-22.04
2222
CI_COMMIT: ${{ github.sha }}
23-
CI_M32: 0
2423
CCACHE_COMPRESS: 1
2524
CCACHE_DIR: ${{ github.workspace }}/.ccache
2625
CCACHE_MAXSIZE: 4Gi

t/t_trace_enum.v

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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, 2009 by Wilson Snyder.
5+
// SPDX-License-Identifier: CC0-1.0
6+
7+
`define STRINGIFY(x) `"x`"
8+
9+
typedef enum logic [1:0] {VAL_A, VAL_B, VAL_C, VAL_D} state_t;
10+
11+
interface MyIntf;
12+
state_t state;
13+
endinterface
14+
15+
module t;
16+
logic clk;
17+
initial forever begin
18+
clk = 1;
19+
#5;
20+
clk = 0;
21+
#5;
22+
end
23+
24+
MyIntf #() sink ();
25+
state_t v_enumed;
26+
27+
typedef enum logic [1:0] {VAL_X, VAL_Y, VAL_Z} other_state_t;
28+
other_state_t v_other_enumed;
29+
30+
initial begin
31+
$dumpfile(`STRINGIFY(`TEST_DUMPFILE));
32+
$dumpvars();
33+
#100;
34+
$write("*-* All Finished *-*\n");
35+
$finish;
36+
end
37+
38+
endmodule

t/t_trace_enum_fst.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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_enum.v"
14+
15+
test.compile(verilator_flags2=['--binary --trace-fst'])
16+
17+
test.execute()
18+
19+
test.file_grep(test.obj_dir + "/simx.fst", r'.')
20+
21+
test.passes()

0 commit comments

Comments
 (0)