Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Zk extension String Causes 'String Index Out of Range' Error #191

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions riscv_config/isa_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,19 @@ def get_extension_list(isa):
for i in range(len(zext_list)-1):
a1 = zext_list[i][1].upper()
a2 = zext_list[i+1][1].upper()
a3 = zext_list[i][2]
a4 = zext_list[i+1][2]
if order_index[a1] > order_index[a2]:
err = True
err_list.append( f"Z extension {zext_list[i]} must occur after {zext_list[i+1]}")
elif a1 == a2 and a3 > a4:
err = True
err_list.append( f"Within the Z{a1.lower()} category extension {zext_list[i]} must occur after {zext_list[i+1]}")
elif a1 == a2:
if (len(zext_list[i]) > 2) and (len(zext_list[i]) == 2):
err = True
err_list.append( f"Within the Z{a1.lower()} category extension {zext_list[i]} must occur after {zext_list[i+1]}")
elif (len(zext_list[i]) > 2) and (len(zext_list[i]) > 2):
a3 = zext_list[i][2]
a4 = zext_list[i+1][2]
if a3 > a4:
err = True
err_list.append( f"Within the Z{a1.lower()} category extension {zext_list[i]} must occur after {zext_list[i+1]}")

if 'I' not in extension_list and 'E' not in extension_list:
err_list.append( 'Either of I or E base extensions need to be present in the ISA string')
Expand Down