Skip to content

Commit

Permalink
Address the comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Pan Li <[email protected]>
  • Loading branch information
Incarnation-p-lee authored and cmuellner committed Dec 19, 2023
1 parent be49d9a commit 8c969a9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/march-to-cpu-opt
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ def get_vlen(ext_dict):
vlen = max(vlen, zvelen)
return vlen

def get_elen(ext_dict):
elen = 32
def get_elen(ext_dict, xlen):
elen = xlen

if "zve32x" in ext_dict or "zve32f" in ext_dict:
elen = 32
if "zve64x" in ext_dict or "zve64f" in ext_dict or "zve64d" in ext_dict:
elen = 64

Expand Down Expand Up @@ -263,10 +265,12 @@ def parse_elf_file(elf_file_path):
for extension in extension_dict.keys():
extensions.append(extension)

xlen = get_xlen(elf_file_path)

CPU_OPTIONS["extensions"] = extensions
CPU_OPTIONS["vlen"] = get_vlen(extension_dict)
CPU_OPTIONS["elen"] = get_elen(extension_dict)
CPU_OPTIONS["xlen"] = get_xlen(elf_file_path)
CPU_OPTIONS["elen"] = get_elen(extension_dict, xlen)
CPU_OPTIONS["xlen"] = xlen

def main(argv):
opt = parse_opt(argv)
Expand Down

0 comments on commit 8c969a9

Please sign in to comment.