Add test for packed arrays of types from other scopes

Extend the array_packed test to check declaring a packed array of a type
from another scope that is addressed via a scoped identifier.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-01-15 21:13:52 +01:00
parent c670170ac0
commit 38c4c20cbc
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,10 @@
// Check that packed arrays of all sorts get elaborated without an error and
// that the resulting type has the right packed width.
package p;
typedef logic [2:0] vector;
endpackage
module test;
typedef bit bit2;
@ -8,6 +12,7 @@ typedef logic [1:0] vector;
bit2 [1:0] b;
vector [2:0] l;
p::vector [3:0] scoped_pa;
typedef enum logic [7:0] {
A
@ -68,6 +73,7 @@ initial begin
// Packed arrays of basic types
failed |= $bits(b) !== 2;
failed |= $bits(l) !== 2 * 3;
failed |= $bits(scoped_pa) !== 3 * 4;
// Packed arrays of enums
failed |= $bits(e) !== 8;