mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-06 22:36:05 +00:00
hierarchy.cc: Raise error on positional interface
Add test to check that it does error.
This commit is contained in:
parent
bbceaa6b5e
commit
7bb0a1913e
3 changed files with 82 additions and 21 deletions
33
tests/svinterfaces/positional_args.ys
Normal file
33
tests/svinterfaces/positional_args.ys
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
read_verilog -sv << EOF
|
||||
interface simple_if;
|
||||
logic receiver;
|
||||
logic driver;
|
||||
endinterface
|
||||
|
||||
module driver_mod(simple_if intf, input in);
|
||||
assign intf.driver = in;
|
||||
endmodule
|
||||
|
||||
module receiver_mod(simple_if intf);
|
||||
assign intf.receiver = intf.driver;
|
||||
endmodule
|
||||
|
||||
module top(
|
||||
input logic [1:0] inputs,
|
||||
output logic [1:0] outputs
|
||||
);
|
||||
simple_if intf0();
|
||||
simple_if intf1();
|
||||
|
||||
driver_mod d0(intf0, inputs[0]);
|
||||
driver_mod d1(intf1, inputs[1]);
|
||||
|
||||
receiver_mod r0(intf0);
|
||||
receiver_mod r1(intf1);
|
||||
|
||||
assign outputs = {intf0.receiver, intf1.receiver};
|
||||
endmodule
|
||||
EOF
|
||||
|
||||
logger -expect error "Unable to connect.* with positional interface" 1
|
||||
hierarchy -top top
|
||||
1
tests/svinterfaces/run-test.sh
Executable file → Normal file
1
tests/svinterfaces/run-test.sh
Executable file → Normal file
|
|
@ -5,3 +5,4 @@
|
|||
|
||||
./run_simple.sh load_and_derive
|
||||
./run_simple.sh resolve_types
|
||||
./run_simple.sh positional_args
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue