Skip to content

Commit 373ef46

Browse files
committed
Addding WARNING in alias/short modules
1 parent ce7aff3 commit 373ef46

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

lambdalib/iolib/rtl/la_ioshort.v

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
/*****************************************************************************
2-
* Function: Inout Port Short
2+
* Function: Simulation Friendly IO Alias Module
33
* Copyright: Lambda Project Authors. All rights Reserved.
44
* License: MIT (see LICENSE file in Lambda repository)
55
*
66
* Docs:
77
*
8-
* Workaround for unsupported tran, alias, and port aliasing in Verilator.
8+
* Instantiates the la_pt inout alias module and adds a loop breaking
9+
* logic for some tools that don's support tran, alias,and port aliasing.
910
*
10-
* Useful for making connections between ports without hard coding the
11-
* connection in RTL.
11+
* WARNING: The port list alias features is in the verilog standard,
12+
* but not well supported by open source tools. Not recommended for
13+
* portable designs.
1214
*
1315
****************************************************************************/
1416
module la_ioshort (inout a,
@@ -17,16 +19,12 @@ module la_ioshort (inout a,
1719
);
1820

1921
`ifdef VERILATOR
20-
// Using direction to break the loop
21-
assign a = ~a2b ? b : 1'bz;
22-
assign b = a2b ? a : 1'bz;
22+
// Using direction to break the loop
23+
assign a = ~a2b ? b : 1'bz;
24+
assign b = a2b ? a : 1'bz;
2325
`else
24-
// single port pass through short/hack
2526
// verilog_lint: waive-start module-port
26-
la_pt la_pt (
27-
a,
28-
b
29-
);
27+
la_pt la_pt (a,b);
3028
// verilog_lint: waive-end module-port
3129
`endif
3230

lambdalib/iolib/rtl/la_pt.v

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11

2-
//Solution to the short was found at the end of a conversation thread at this
3-
// link:
4-
// https://groups.google.com/g/comp.lang.verilog/c/b3-6XMA8KA4
2+
/**************************************************************************
3+
* Function: IO Alias Module
4+
* Copyright: Lambda Project Authors. All rights Reserved.
5+
* License: MIT (see LICENSE file in Lambda repository)
6+
*
7+
* Docs:
8+
*
9+
* Signal renaming and concatenation of wires doesn't work for
10+
* directly connected I/O ports. One solution is to hard code the
11+
* connections in the design. Another option is to pass through the
12+
* name translation module shown below.
13+
*
14+
* WARNING: The port list alias features is in the verilog standard,
15+
* but not well supported by open source tools. Not recommended for
16+
* portable designs.
17+
*
18+
*************************************************************************/
519

620
module la_pt (.io1(a),
7-
.io2(a)
8-
);
21+
.io2(a));
922

1023
inout wire a;
24+
1125
endmodule

0 commit comments

Comments
 (0)