Skip to content

Commit

Permalink
[topgen] Only create alert_handler if there an instance
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Schilling <[email protected]>
  • Loading branch information
Razer6 committed Nov 29, 2024
1 parent 269751c commit d3abbca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions util/topgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,11 +797,12 @@ def _process_top(
# generating the Alert Handler
create_alert_lpgs(topcfg, name_to_block)

# Generate Alert Handler
# Generate Alert Handler if there is an instance
if not args.xbar_only:
generate_alert_handler(completecfg, out_path)
if args.alert_handler_only:
sys.exit()
if lib.find_module(completecfg['module'], 'alert_handler'):
generate_alert_handler(completecfg, out_path)
if args.alert_handler_only:
sys.exit()

# Generate Pinmux
if lib.find_module(completecfg['module'], 'pinmux'):
Expand Down
5 changes: 4 additions & 1 deletion util/topgen/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,10 @@ def __init__(self, top_info, name_to_block: Dict[str, IpBlock], enum_type, array

self._init_plic_targets()
self._init_plic_mapping()
self._init_alert_mapping()

# Only generate alert_handler and mappings if there is an alert_handler
if find_module(self.top['module'], 'alert_handler'):
self._init_alert_mapping()
# Only generate pinmux and pad mappings if there is a pinmux
if find_module(self.top['module'], 'pinmux'):
self._init_pinmux_mapping()
Expand Down

0 comments on commit d3abbca

Please sign in to comment.