icestorm/icebox
Chris Baker a5427d704a icebox_vlog: use proper Verilog-2001 module declarations
Resolves #328
Summary:
- By default emit Verilog-2001 style module declarations with direction
  and signal type defined in the module prototype and not in the body of
  the module
- Add -C option to output Verilog-1995 module declarations for
  compatibility with older toolchains
- Add some comments to the file to assist future maintainers

Background:
Currently, icebox_vlog outputs a mixed-style module declaration in which
it puts the port direction in the module prototype and later declares
the signals as ports or wires.
```verilog
module chip (input pin1, output pin2);

wire pin1;
reg pin2 = 0;
```

The inclusion of the direction in the module prototype is a feature of
newer Verilog-2001 specification.

It seems probable that older versions of Icarus Verilog had some leeway
in handling this mixed-style of declaration. But, it seems that at least
the version included in newer Ubuntu distributions considers this to be
a syntax error.

In this commit, the module declaration above will be emitted as:
```verilog
module chip (input wire pin1, output reg pin2 = 0);
```

Or if you sepcificy the -C option for Verilog-1995 compatibility:
```verilog
module chip (pin1, pin2);
input pin1;
output pin2;

wire pin1;
reg pin2 = 0;
```
2024-04-21 14:33:23 -04:00
..
.gitignore iCE40 Ultra = iCE5LP = u4k port 2019-02-22 22:35:55 +01:00
Makefile Update variable name to PYTHON3 2021-09-06 11:11:52 +02:00
icebox.py icebox: Add PLL ICEGATE function 2023-02-01 11:04:27 +01:00
icebox_asc2hlc.py Support custom PROGRAM_PREFIX 2020-04-10 10:05:17 +02:00
icebox_chipdb.py Support custom PROGRAM_PREFIX 2020-04-10 10:05:17 +02:00
icebox_colbuf.py Support custom PROGRAM_PREFIX 2020-04-10 10:05:17 +02:00
icebox_diff.py Support custom PROGRAM_PREFIX 2020-04-10 10:05:17 +02:00
icebox_explain.py Support custom PROGRAM_PREFIX 2020-04-10 10:05:17 +02:00
icebox_hlc2asc.py Support custom PROGRAM_PREFIX 2020-04-10 10:05:17 +02:00
icebox_hlcsort.py icebox_hlcsort: Adding a tool for canonicalizing HLC files. 2018-06-14 17:54:25 -07:00
icebox_html.py Support custom PROGRAM_PREFIX 2020-04-10 10:05:17 +02:00
icebox_maps.py Support custom PROGRAM_PREFIX 2020-04-10 10:05:17 +02:00
icebox_stat.py Support custom PROGRAM_PREFIX 2020-04-10 10:05:17 +02:00
icebox_vlog.py icebox_vlog: use proper Verilog-2001 module declarations 2024-04-21 14:33:23 -04:00
iceboxdb.py Remove seperate 5k RAM DB and share with 8k instead 2018-01-16 15:17:20 +00:00
tc_logic_xpr.py icebox: Put .hlc converters under ISC license 2017-09-02 14:45:03 +02:00
tc_rxlat_netnames.py icebox: Put .hlc converters under ISC license 2017-09-02 14:45:03 +02:00
tc_xlat_netnames.py icebox: Put .hlc converters under ISC license 2017-09-02 14:45:03 +02:00