Commit 7be57c8
committed
Improve Verilog identifier naming, fix two bugs, add tests, refactor duplicated
code:
Update `_NameSanitizer` to try cleaning up an invalid name before giving up and
auto-generating a new name. The cleaning process just replaces non-word
characters `[A-Za-z0-9_]` with underscores, and also tries adding a prefix
underscore. This makes the generated Verilog output easier to read, especially
when using `wire_struct` or `wire_matrix`, which both add non-word characters
to wire names.
Remove `_NameSanitizer`'s `map_valid_vals` and `allow_duplicates` options,
which don't seem to be used.
Bugs fixed:
- `output_verilog_testbench` should not re-initialize RomBlocks. This appears
to be an existing bug.
- Consts inputs to bit-slices must be declared.
Add tests for these bugs.
Also move the Verilog export code to a new `class _VerilogOutputter`. This lets
`output_to_verilog` and `output_verilog_testbench` share more code.
Also remove `OutputToVerilog`. It is deprecated, and the forwarding function
was broken, so it's pretty clear nobody uses this.1 parent c94b341 commit 7be57c8
4 files changed
Lines changed: 655 additions & 653 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
| |||
242 | 241 | | |
243 | 242 | | |
244 | 243 | | |
245 | | - | |
246 | 244 | | |
247 | 245 | | |
248 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1206 | 1206 | | |
1207 | 1207 | | |
1208 | 1208 | | |
1209 | | - | |
1210 | 1209 | | |
1211 | | - | |
1212 | 1210 | | |
1213 | 1211 | | |
1214 | 1212 | | |
1215 | 1213 | | |
1216 | 1214 | | |
1217 | | - | |
1218 | 1215 | | |
1219 | | - | |
1220 | 1216 | | |
1221 | 1217 | | |
1222 | 1218 | | |
1223 | 1219 | | |
1224 | | - | |
1225 | | - | |
1226 | 1220 | | |
1227 | 1221 | | |
1228 | 1222 | | |
1229 | 1223 | | |
1230 | 1224 | | |
1231 | 1225 | | |
1232 | 1226 | | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
| 1227 | + | |
1241 | 1228 | | |
1242 | | - | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
1243 | 1246 | | |
1244 | 1247 | | |
1245 | 1248 | | |
| |||
0 commit comments