-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #775 from diffblue/typename
Verilog: `$typename`
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CORE | ||
typename1.sv | ||
--module main --bound 0 | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module main; | ||
|
||
bit some_bit; | ||
bit [31:0] vector1; | ||
bit [0:31] vector2; | ||
bit signed [31:0] vector3; | ||
|
||
assert final ($typename(some_bit)=="bit"); | ||
assert final ($typename(vector1)=="bit[31:0]"); | ||
assert final ($typename(vector2)=="bit[0:31]"); | ||
assert final ($typename(vector3)=="bit signed[31:0]"); | ||
|
||
// $typename yields an elaboration-time constant | ||
parameter P = $typename(some_bit); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters