forked from YosysHQ/yosys
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve package types in interfaces (YosysHQ#3658)
* Resolve package types in interfaces * Added test for resolving of package types in interfaces
- Loading branch information
Showing
4 changed files
with
34 additions
and
3 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
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,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 |
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,6 @@ | ||
read_verilog -sv resolve_types.sv | ||
hierarchy -libdir . -check | ||
flatten | ||
equiv_make ref dut equiv | ||
equiv_simple | ||
equiv_status -assert |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
./runone.sh svinterface_at_top | ||
|
||
./run_simple.sh load_and_derive | ||
./run_simple.sh resolve_types |