diff options
author | Dag Lem <dag@nimrod.no> | 2023-02-13 00:25:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-12 18:25:39 -0500 |
commit | 615adc4253a25fd9053d7893cc1f8120908c9e4a (patch) | |
tree | b5696d95e15e0082ad6a49e32cd9d3c8dbb1ba19 /tests | |
parent | 5ea2c290a58dcc2a2eacacd8b3288d9a1d7037bb (diff) | |
download | yosys-615adc4253a25fd9053d7893cc1f8120908c9e4a.tar.gz yosys-615adc4253a25fd9053d7893cc1f8120908c9e4a.tar.bz2 yosys-615adc4253a25fd9053d7893cc1f8120908c9e4a.zip |
Resolve package types in interfaces (#3658)
* Resolve package types in interfaces
* Added test for resolving of package types in interfaces
Diffstat (limited to 'tests')
-rw-r--r-- | tests/svinterfaces/resolve_types.sv | 24 | ||||
-rw-r--r-- | tests/svinterfaces/resolve_types.ys | 6 | ||||
-rwxr-xr-x | tests/svinterfaces/run-test.sh | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/svinterfaces/resolve_types.sv b/tests/svinterfaces/resolve_types.sv new file mode 100644 index 000000000..3c6644e33 --- /dev/null +++ b/tests/svinterfaces/resolve_types.sv @@ -0,0 +1,24 @@ +// This test checks that types, including package types, are resolved from within an interface. + +typedef logic [7:0] x_t; + +package pkg; + typedef logic [7:0] y_t; +endpackage + +interface iface; + x_t x; + pkg::y_t y; +endinterface + +module dut (input logic [7:0] x, output logic [7:0] y); + iface intf(); + assign intf.x = x; + assign y = intf.y; + + ondemand u(.intf); +endmodule + +module ref (input logic [7:0] x, output logic [7:0] y); + assign y = ~x; +endmodule diff --git a/tests/svinterfaces/resolve_types.ys b/tests/svinterfaces/resolve_types.ys new file mode 100644 index 000000000..a25791f37 --- /dev/null +++ b/tests/svinterfaces/resolve_types.ys @@ -0,0 +1,6 @@ +read_verilog -sv resolve_types.sv +hierarchy -libdir . -check +flatten +equiv_make ref dut equiv +equiv_simple +equiv_status -assert diff --git a/tests/svinterfaces/run-test.sh b/tests/svinterfaces/run-test.sh index 9ef53926c..afa222766 100755 --- a/tests/svinterfaces/run-test.sh +++ b/tests/svinterfaces/run-test.sh @@ -4,3 +4,4 @@ ./runone.sh svinterface_at_top ./run_simple.sh load_and_derive +./run_simple.sh resolve_types |