3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-08 08:51:56 +00:00

Add a test for interfaces on modules loaded on-demand

This commit is contained in:
Rupert Swarbrick 2021-07-14 17:27:13 +01:00 committed by Zachary Snow
parent 7d50b83322
commit 1aab608cff
5 changed files with 48 additions and 2 deletions

View file

@ -0,0 +1,20 @@
// This test checks that we correctly elaborate interfaces in modules, even if they are loaded on
// demand. The "ondemand" module is defined in ondemand.sv in this directory and will be read as
// part of the hierarchy pass.
interface iface;
logic [7:0] x;
logic [7:0] 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