Commit 98d2b5c
authored
* Update `output_to_verilog` to inline temporary wires, using `GateGraph`:
- Gates with user-specified names are never inlined.
- Unnamed constant Gates are always inlined, unless they are args to a bit-slice Gate.
- Unnamed non-constant Gates are inlined if:
- The Gate has one user, AND
- The Gate is not a MemBlock read, AND
- The Gate is not an arg to a bit-slice Gate.
This significantly reduces the amount of generated Verilog code.
Existing bugs fixed:
- `output_verilog_testbench` should not re-initialize RomBlocks.
- FastSimulation was not updating `init_menvalues` correctly.
- Specify bitwidths for Verilog initial register and memory values. They were
previously unsized constants, which are implicitly 32-bit signed, which could
cause surprises.
Add tests for these bugs.
Also:
- Improve Verilog identifier naming. Try replacing non-word characters with underscores before giving up and generating a new random name.
- When we mangle names, add a comment with the un-mangled name.
- Use sanitized MemBlock and RomBlock names instead of `mem_{memid}` names.
- Refactor `output_to_verilog` and `output_verilog_testbench` to share more code.
- Update `output_verilog_testbench` to use `GateGraph`.
- Define `GateGraph.__iter__` to make it easier to iterate over all Gates.
- Delete some disabled tests in `test_aes.py`.
1 parent 3deeedd commit 98d2b5c
File tree
13 files changed
+1150
-1203
lines changed- docs
- pyrtl
- tests
- rtllib
13 files changed
+1150
-1203
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
| 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 | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1193 | 1193 | | |
1194 | 1194 | | |
1195 | 1195 | | |
1196 | | - | |
1197 | | - | |
| 1196 | + | |
1198 | 1197 | | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1203 | 1229 | | |
1204 | 1230 | | |
1205 | 1231 | | |
1206 | 1232 | | |
1207 | 1233 | | |
1208 | 1234 | | |
1209 | | - | |
1210 | 1235 | | |
1211 | | - | |
1212 | 1236 | | |
1213 | 1237 | | |
1214 | 1238 | | |
1215 | 1239 | | |
| 1240 | + | |
1216 | 1241 | | |
1217 | | - | |
| 1242 | + | |
| 1243 | + | |
1218 | 1244 | | |
1219 | | - | |
1220 | 1245 | | |
1221 | 1246 | | |
1222 | | - | |
1223 | | - | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1227 | 1252 | | |
1228 | | - | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
1229 | 1257 | | |
1230 | 1258 | | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1243 | 1293 | | |
1244 | 1294 | | |
1245 | 1295 | | |
1246 | 1296 | | |
1247 | 1297 | | |
1248 | | - | |
1249 | | - | |
| 1298 | + | |
| 1299 | + | |
1250 | 1300 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
715 | 718 | | |
716 | 719 | | |
717 | 720 | | |
| |||
1114 | 1117 | | |
1115 | 1118 | | |
1116 | 1119 | | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
0 commit comments