Skip to content

Commit cf3e351

Browse files
davidschrammelRazer6
authored andcommitted
[raclgen] Allow interfaces to be named if there's only one
Signed-off-by: David Schrammel <[email protected]>
1 parent a0a015b commit cf3e351

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

util/raclgen/lib.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,12 @@ def gen_md(block: IpBlock,
283283
module: Dict[str, object],
284284
output: TextIO = sys.stdout):
285285

286-
if_name = racl_mapping['if_name']
287-
if not if_name or if_name == '':
288-
if_name = 'null'
286+
if_name = racl_mapping.get('if_name') or 'null'
289287

290-
assert block.reg_blocks
291-
if len(block.reg_blocks) == 1:
292-
assert not if_name or if_name == '' or if_name == 'null'
288+
# Look up the requested interface. If there is none (so if_name is 'null'),
289+
# this requires there to be exactly one register block.
290+
if if_name == 'null':
291+
assert len(block.reg_blocks) == 1
293292
rb = next(iter(block.reg_blocks.values()))
294293
else:
295294
rb = block.reg_blocks[if_name]

0 commit comments

Comments
 (0)