Skip to content

Commit a4b5c39

Browse files
committed
Allow only one value
Signed-off-by: Afonso Oliveira <[email protected]>
1 parent 6a81b5d commit a4b5c39

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
61 Bytes
Binary file not shown.

ext/auto-inst/parsing.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,16 @@ def compare_yaml_json_encoding(instr_name, yaml_match, yaml_vars, json_encoding_
7575
return [f"YAML match pattern length is {len(yaml_pattern_str)}, expected {expected_length}. Cannot compare properly."]
7676

7777
def parse_location(loc_str):
78-
high, low = loc_str.split('-')
79-
return int(high), int(low)
78+
# Ensure loc_str is a string
79+
loc_str = str(loc_str).strip()
80+
if '-' in loc_str:
81+
high, low = loc_str.split('-')
82+
return int(high), int(low)
83+
else:
84+
# If no dash, treat it as a single bit field
85+
val = int(loc_str)
86+
return val, val
87+
8088

8189
yaml_var_positions = {}
8290
for var in yaml_vars:

0 commit comments

Comments
 (0)