Skip to content

Commit

Permalink
[topgen] Only add LPG if there is already a LPG defined
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Schilling <[email protected]>
  • Loading branch information
Razer6 authored and a-will committed Feb 15, 2025
1 parent 724e142 commit 6f6ef32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util/topgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ def _get_alert_handler_params(top: Dict[str, object]) -> Dict[str, object]:
# They are added after the merge pass, so the ip_block won't have them.
n_alerts = sum(
[int(x["width"]) if "width" in x else 1 for x in top["alert"]])
n_lpgs = len(top.get("alert_lpgs", []))
n_lpgs_int = len(top.get("alert_lpgs", []))
n_lpgs = n_lpgs_int
n_lpgs_incoming_offset = n_lpgs
# Add incoming alerts and their LPGs
for alerts in top['incoming_alert'].values():
Expand All @@ -274,7 +275,7 @@ def _get_alert_handler_params(top: Dict[str, object]) -> Dict[str, object]:
for alert in top["alert"]:
for _ in range(alert["width"]):
async_on.append(async_on_format.format(int(alert["async"])))
if n_lpgs:
if n_lpgs_int:
lpg_map.append(lpg_idx_format.format(int(alert["lpg_idx"])))

if "incoming_alert" in top:
Expand Down

0 comments on commit 6f6ef32

Please sign in to comment.