aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-04-14 12:40:00 +0000
committerGitHub <noreply@github.com>2020-04-14 12:40:00 +0000
commitf41c7ccfff4bf104c646ca4b85e079a0f91c9151 (patch)
treeeb15a12b1d4cbb0656740f86f7da824777ed0678 /tests
parent0e1beb6f308da18b952e562b85504258d20ffcc7 (diff)
parent249876b61405a83ed19a9cc20fcffbf9313f2619 (diff)
downloadyosys-f41c7ccfff4bf104c646ca4b85e079a0f91c9151.tar.gz
yosys-f41c7ccfff4bf104c646ca4b85e079a0f91c9151.tar.bz2
yosys-f41c7ccfff4bf104c646ca4b85e079a0f91c9151.zip
Merge pull request #1879 from jjj11x/jjj11x/package_decl
support using previously declared types/localparams/parameters in package
Diffstat (limited to 'tests')
-rw-r--r--tests/svtypes/typedef_package.sv11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/svtypes/typedef_package.sv b/tests/svtypes/typedef_package.sv
index 57a78c53a..2d83742c5 100644
--- a/tests/svtypes/typedef_package.sv
+++ b/tests/svtypes/typedef_package.sv
@@ -1,6 +1,9 @@
package pkg;
typedef logic [7:0] uint8_t;
- typedef enum logic [7:0] {bb=8'hBB} enum8_t;
+ typedef enum logic [7:0] {bb=8'hBB, cc=8'hCC} enum8_t;
+
+ localparam uint8_t PCONST = cc;
+ parameter uint8_t PCONST_COPY = PCONST;
endpackage
module top;
@@ -8,7 +11,9 @@ module top;
(* keep *) pkg::uint8_t a = 8'hAA;
(* keep *) pkg::enum8_t b_enum = pkg::bb;
- always @* assert(a == 8'hAA);
- always @* assert(b_enum == 8'hBB);
+ always_comb assert(a == 8'hAA);
+ always_comb assert(b_enum == 8'hBB);
+ always_comb assert(pkg::PCONST == pkg::cc);
+ always_comb assert(pkg::PCONST_COPY == pkg::cc);
endmodule