mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-11 21:50:54 +00:00
SystemVerilog support for implicit named port connections
This is the `foo foo(.port1, .port2);` SystemVerilog syntax introduced in IEEE1800-2005.
This commit is contained in:
parent
1332051f33
commit
88f5977093
5 changed files with 59 additions and 12 deletions
19
tests/various/implicit_ports.sv
Normal file
19
tests/various/implicit_ports.sv
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Test implicit port connections
|
||||
module alu (input [2:0] a, input [2:0] b, input cin, output cout, output [2:0] result);
|
||||
assign cout = cin;
|
||||
assign result = a + b;
|
||||
endmodule
|
||||
|
||||
module named_ports(output [2:0] alu_result, output cout);
|
||||
wire [2:0] a = 3'b010, b = 3'b100;
|
||||
wire cin = 1;
|
||||
|
||||
alu alu (
|
||||
.a(a),
|
||||
.b, // Implicit connection is equivalent to .b(b)
|
||||
.cin(), // Explicitely unconnected
|
||||
.cout(cout),
|
||||
.result(alu_result)
|
||||
);
|
||||
endmodule
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue