diff --git a/Makefile b/Makefile index 17f991be..a6ea5dbb 100644 --- a/Makefile +++ b/Makefile @@ -4,12 +4,8 @@ PK_H := ../riscv-pk/machine/encoding.h ENV_H := ../riscv-tests/env/encoding.h OPENOCD_H := ../riscv-openocd/src/target/riscv/encoding.h INSTALL_HEADER_FILES := $(ISASIM_H) $(PK_H) $(ENV_H) $(OPENOCD_H) +PSEUDO_FLAG := $(if $(PSEUDO),-pseudo,) -ifdef PSEUDO - PSEUDO_FLAG := -pseudo -else - PSEUDO_FLAG := -endif default: everything diff --git a/rv32_c b/extensions/rv32_c similarity index 100% rename from rv32_c rename to extensions/rv32_c diff --git a/rv32_c_f b/extensions/rv32_c_f similarity index 100% rename from rv32_c_f rename to extensions/rv32_c_f diff --git a/rv32_d_zfa b/extensions/rv32_d_zfa similarity index 100% rename from rv32_d_zfa rename to extensions/rv32_d_zfa diff --git a/rv32_i b/extensions/rv32_i similarity index 100% rename from rv32_i rename to extensions/rv32_i diff --git a/rv32_zbb b/extensions/rv32_zbb similarity index 100% rename from rv32_zbb rename to extensions/rv32_zbb diff --git a/rv32_zbkb b/extensions/rv32_zbkb similarity index 100% rename from rv32_zbkb rename to extensions/rv32_zbkb diff --git a/rv32_zbs b/extensions/rv32_zbs similarity index 100% rename from rv32_zbs rename to extensions/rv32_zbs diff --git a/rv32_zicntr b/extensions/rv32_zicntr similarity index 100% rename from rv32_zicntr rename to extensions/rv32_zicntr diff --git a/rv32_zk b/extensions/rv32_zk similarity index 100% rename from rv32_zk rename to extensions/rv32_zk diff --git a/rv32_zkn b/extensions/rv32_zkn similarity index 100% rename from rv32_zkn rename to extensions/rv32_zkn diff --git a/rv32_zknd b/extensions/rv32_zknd similarity index 100% rename from rv32_zknd rename to extensions/rv32_zknd diff --git a/rv32_zkne b/extensions/rv32_zkne similarity index 100% rename from rv32_zkne rename to extensions/rv32_zkne diff --git a/rv32_zknh b/extensions/rv32_zknh similarity index 100% rename from rv32_zknh rename to extensions/rv32_zknh diff --git a/rv32_zks b/extensions/rv32_zks similarity index 100% rename from rv32_zks rename to extensions/rv32_zks diff --git a/rv64_a b/extensions/rv64_a similarity index 100% rename from rv64_a rename to extensions/rv64_a diff --git a/rv64_c b/extensions/rv64_c similarity index 100% rename from rv64_c rename to extensions/rv64_c diff --git a/rv64_d b/extensions/rv64_d similarity index 100% rename from rv64_d rename to extensions/rv64_d diff --git a/rv64_f b/extensions/rv64_f similarity index 100% rename from rv64_f rename to extensions/rv64_f diff --git a/rv64_h b/extensions/rv64_h similarity index 100% rename from rv64_h rename to extensions/rv64_h diff --git a/rv64_i b/extensions/rv64_i similarity index 100% rename from rv64_i rename to extensions/rv64_i diff --git a/rv64_m b/extensions/rv64_m similarity index 100% rename from rv64_m rename to extensions/rv64_m diff --git a/rv64_q b/extensions/rv64_q similarity index 100% rename from rv64_q rename to extensions/rv64_q diff --git a/rv64_q_zfa b/extensions/rv64_q_zfa similarity index 100% rename from rv64_q_zfa rename to extensions/rv64_q_zfa diff --git a/rv64_zacas b/extensions/rv64_zacas similarity index 100% rename from rv64_zacas rename to extensions/rv64_zacas diff --git a/rv64_zba b/extensions/rv64_zba similarity index 100% rename from rv64_zba rename to extensions/rv64_zba diff --git a/rv64_zbb b/extensions/rv64_zbb similarity index 100% rename from rv64_zbb rename to extensions/rv64_zbb diff --git a/rv64_zbkb b/extensions/rv64_zbkb similarity index 100% rename from rv64_zbkb rename to extensions/rv64_zbkb diff --git a/rv64_zbs b/extensions/rv64_zbs similarity index 100% rename from rv64_zbs rename to extensions/rv64_zbs diff --git a/rv64_zcb b/extensions/rv64_zcb similarity index 100% rename from rv64_zcb rename to extensions/rv64_zcb diff --git a/rv64_zfh b/extensions/rv64_zfh similarity index 100% rename from rv64_zfh rename to extensions/rv64_zfh diff --git a/rv64_zk b/extensions/rv64_zk similarity index 100% rename from rv64_zk rename to extensions/rv64_zk diff --git a/rv64_zkn b/extensions/rv64_zkn similarity index 100% rename from rv64_zkn rename to extensions/rv64_zkn diff --git a/rv64_zknd b/extensions/rv64_zknd similarity index 100% rename from rv64_zknd rename to extensions/rv64_zknd diff --git a/rv64_zkne b/extensions/rv64_zkne similarity index 100% rename from rv64_zkne rename to extensions/rv64_zkne diff --git a/rv64_zknh b/extensions/rv64_zknh similarity index 100% rename from rv64_zknh rename to extensions/rv64_zknh diff --git a/rv64_zks b/extensions/rv64_zks similarity index 100% rename from rv64_zks rename to extensions/rv64_zks diff --git a/rv_a b/extensions/rv_a similarity index 100% rename from rv_a rename to extensions/rv_a diff --git a/rv_c b/extensions/rv_c similarity index 100% rename from rv_c rename to extensions/rv_c diff --git a/rv_c_d b/extensions/rv_c_d similarity index 100% rename from rv_c_d rename to extensions/rv_c_d diff --git a/rv_c_zihintntl b/extensions/rv_c_zihintntl similarity index 100% rename from rv_c_zihintntl rename to extensions/rv_c_zihintntl diff --git a/rv_d b/extensions/rv_d similarity index 100% rename from rv_d rename to extensions/rv_d diff --git a/rv_d_zfa b/extensions/rv_d_zfa similarity index 100% rename from rv_d_zfa rename to extensions/rv_d_zfa diff --git a/rv_d_zfh b/extensions/rv_d_zfh similarity index 100% rename from rv_d_zfh rename to extensions/rv_d_zfh diff --git a/rv_f b/extensions/rv_f similarity index 100% rename from rv_f rename to extensions/rv_f diff --git a/rv_f_zfa b/extensions/rv_f_zfa similarity index 100% rename from rv_f_zfa rename to extensions/rv_f_zfa diff --git a/rv_h b/extensions/rv_h similarity index 100% rename from rv_h rename to extensions/rv_h diff --git a/rv_i b/extensions/rv_i similarity index 100% rename from rv_i rename to extensions/rv_i diff --git a/rv_m b/extensions/rv_m similarity index 100% rename from rv_m rename to extensions/rv_m diff --git a/rv_q b/extensions/rv_q similarity index 100% rename from rv_q rename to extensions/rv_q diff --git a/rv_q_zfa b/extensions/rv_q_zfa similarity index 100% rename from rv_q_zfa rename to extensions/rv_q_zfa diff --git a/rv_q_zfh b/extensions/rv_q_zfh similarity index 100% rename from rv_q_zfh rename to extensions/rv_q_zfh diff --git a/rv_s b/extensions/rv_s similarity index 100% rename from rv_s rename to extensions/rv_s diff --git a/rv_sdext b/extensions/rv_sdext similarity index 100% rename from rv_sdext rename to extensions/rv_sdext diff --git a/rv_svinval b/extensions/rv_svinval similarity index 100% rename from rv_svinval rename to extensions/rv_svinval diff --git a/rv_svinval_h b/extensions/rv_svinval_h similarity index 100% rename from rv_svinval_h rename to extensions/rv_svinval_h diff --git a/rv_system b/extensions/rv_system similarity index 100% rename from rv_system rename to extensions/rv_system diff --git a/rv_v b/extensions/rv_v similarity index 100% rename from rv_v rename to extensions/rv_v diff --git a/rv_v_aliases b/extensions/rv_v_aliases similarity index 100% rename from rv_v_aliases rename to extensions/rv_v_aliases diff --git a/rv_zabha b/extensions/rv_zabha similarity index 100% rename from rv_zabha rename to extensions/rv_zabha diff --git a/rv_zacas b/extensions/rv_zacas similarity index 100% rename from rv_zacas rename to extensions/rv_zacas diff --git a/rv_zawrs b/extensions/rv_zawrs similarity index 100% rename from rv_zawrs rename to extensions/rv_zawrs diff --git a/rv_zba b/extensions/rv_zba similarity index 100% rename from rv_zba rename to extensions/rv_zba diff --git a/rv_zbb b/extensions/rv_zbb similarity index 100% rename from rv_zbb rename to extensions/rv_zbb diff --git a/rv_zbc b/extensions/rv_zbc similarity index 100% rename from rv_zbc rename to extensions/rv_zbc diff --git a/rv_zbkb b/extensions/rv_zbkb similarity index 100% rename from rv_zbkb rename to extensions/rv_zbkb diff --git a/rv_zbkc b/extensions/rv_zbkc similarity index 100% rename from rv_zbkc rename to extensions/rv_zbkc diff --git a/rv_zbkx b/extensions/rv_zbkx similarity index 100% rename from rv_zbkx rename to extensions/rv_zbkx diff --git a/rv_zbs b/extensions/rv_zbs similarity index 100% rename from rv_zbs rename to extensions/rv_zbs diff --git a/rv_zcb b/extensions/rv_zcb similarity index 100% rename from rv_zcb rename to extensions/rv_zcb diff --git a/rv_zcmop b/extensions/rv_zcmop similarity index 100% rename from rv_zcmop rename to extensions/rv_zcmop diff --git a/rv_zcmp b/extensions/rv_zcmp similarity index 100% rename from rv_zcmp rename to extensions/rv_zcmp diff --git a/rv_zcmt b/extensions/rv_zcmt similarity index 100% rename from rv_zcmt rename to extensions/rv_zcmt diff --git a/rv_zfh b/extensions/rv_zfh similarity index 100% rename from rv_zfh rename to extensions/rv_zfh diff --git a/rv_zfh_zfa b/extensions/rv_zfh_zfa similarity index 100% rename from rv_zfh_zfa rename to extensions/rv_zfh_zfa diff --git a/rv_zicbo b/extensions/rv_zicbo similarity index 100% rename from rv_zicbo rename to extensions/rv_zicbo diff --git a/rv_zicntr b/extensions/rv_zicntr similarity index 100% rename from rv_zicntr rename to extensions/rv_zicntr diff --git a/rv_zicond b/extensions/rv_zicond similarity index 100% rename from rv_zicond rename to extensions/rv_zicond diff --git a/rv_zicsr b/extensions/rv_zicsr similarity index 100% rename from rv_zicsr rename to extensions/rv_zicsr diff --git a/rv_zifencei b/extensions/rv_zifencei similarity index 100% rename from rv_zifencei rename to extensions/rv_zifencei diff --git a/rv_zihintntl b/extensions/rv_zihintntl similarity index 100% rename from rv_zihintntl rename to extensions/rv_zihintntl diff --git a/rv_zimop b/extensions/rv_zimop similarity index 100% rename from rv_zimop rename to extensions/rv_zimop diff --git a/rv_zk b/extensions/rv_zk similarity index 100% rename from rv_zk rename to extensions/rv_zk diff --git a/rv_zkn b/extensions/rv_zkn similarity index 100% rename from rv_zkn rename to extensions/rv_zkn diff --git a/rv_zknh b/extensions/rv_zknh similarity index 100% rename from rv_zknh rename to extensions/rv_zknh diff --git a/rv_zks b/extensions/rv_zks similarity index 100% rename from rv_zks rename to extensions/rv_zks diff --git a/rv_zksed b/extensions/rv_zksed similarity index 100% rename from rv_zksed rename to extensions/rv_zksed diff --git a/rv_zksh b/extensions/rv_zksh similarity index 100% rename from rv_zksh rename to extensions/rv_zksh diff --git a/rv_zvbb b/extensions/rv_zvbb similarity index 100% rename from rv_zvbb rename to extensions/rv_zvbb diff --git a/rv_zvbc b/extensions/rv_zvbc similarity index 100% rename from rv_zvbc rename to extensions/rv_zvbc diff --git a/rv_zvkg b/extensions/rv_zvkg similarity index 100% rename from rv_zvkg rename to extensions/rv_zvkg diff --git a/rv_zvkn b/extensions/rv_zvkn similarity index 100% rename from rv_zvkn rename to extensions/rv_zvkn diff --git a/rv_zvkned b/extensions/rv_zvkned similarity index 100% rename from rv_zvkned rename to extensions/rv_zvkned diff --git a/rv_zvknha b/extensions/rv_zvknha similarity index 100% rename from rv_zvknha rename to extensions/rv_zvknha diff --git a/rv_zvknhb b/extensions/rv_zvknhb similarity index 100% rename from rv_zvknhb rename to extensions/rv_zvknhb diff --git a/rv_zvks b/extensions/rv_zvks similarity index 100% rename from rv_zvks rename to extensions/rv_zvks diff --git a/rv_zvksed b/extensions/rv_zvksed similarity index 100% rename from rv_zvksed rename to extensions/rv_zvksed diff --git a/rv_zvksh b/extensions/rv_zvksh similarity index 100% rename from rv_zvksh rename to extensions/rv_zvksh diff --git a/unratified/rv64_zbp b/extensions/unratified/rv64_zbp similarity index 100% rename from unratified/rv64_zbp rename to extensions/unratified/rv64_zbp diff --git a/unratified/rv_c_zicfiss b/extensions/unratified/rv_c_zicfiss similarity index 100% rename from unratified/rv_c_zicfiss rename to extensions/unratified/rv_c_zicfiss diff --git a/unratified/rv_smdbltrp b/extensions/unratified/rv_smdbltrp similarity index 100% rename from unratified/rv_smdbltrp rename to extensions/unratified/rv_smdbltrp diff --git a/unratified/rv_smrnmi b/extensions/unratified/rv_smrnmi similarity index 100% rename from unratified/rv_smrnmi rename to extensions/unratified/rv_smrnmi diff --git a/unratified/rv_zalasr b/extensions/unratified/rv_zalasr similarity index 100% rename from unratified/rv_zalasr rename to extensions/unratified/rv_zalasr diff --git a/unratified/rv_zbp b/extensions/unratified/rv_zbp similarity index 100% rename from unratified/rv_zbp rename to extensions/unratified/rv_zbp diff --git a/unratified/rv_zfbfmin b/extensions/unratified/rv_zfbfmin similarity index 100% rename from unratified/rv_zfbfmin rename to extensions/unratified/rv_zfbfmin diff --git a/unratified/rv_zicfilp b/extensions/unratified/rv_zicfilp similarity index 100% rename from unratified/rv_zicfilp rename to extensions/unratified/rv_zicfilp diff --git a/unratified/rv_zicfiss b/extensions/unratified/rv_zicfiss similarity index 100% rename from unratified/rv_zicfiss rename to extensions/unratified/rv_zicfiss diff --git a/unratified/rv_zvfbfmin b/extensions/unratified/rv_zvfbfmin similarity index 100% rename from unratified/rv_zvfbfmin rename to extensions/unratified/rv_zvfbfmin diff --git a/unratified/rv_zvfbfwma b/extensions/unratified/rv_zvfbfwma similarity index 100% rename from unratified/rv_zvfbfwma rename to extensions/unratified/rv_zvfbfwma diff --git a/shared_utils.py b/shared_utils.py index 4b6917cb..f6cd4b72 100644 --- a/shared_utils.py +++ b/shared_utils.py @@ -457,7 +457,7 @@ def process_pseudo_instructions( logging.debug(f"Processing pseudo line: {line}") ext, orig_inst, pseudo_inst, line_content = pseudo_regex.findall(line)[0] ext_file = find_extension_file(ext, opcodes_dir) - + # print("ext_file",ext_file) validate_instruction_in_extension(orig_inst, ext_file, file_name, pseudo_inst) name, single_dict = process_enc_line(f"{pseudo_inst} {line_content}", file_name) @@ -514,6 +514,7 @@ def find_extension_file(ext: str, opcodes_dir: str): ext_file = f"{opcodes_dir}/unratified/{ext}" if not os.path.exists(ext_file): log_and_exit(f"Extension {ext} not found.") + # print(ext_file) return ext_file @@ -574,7 +575,7 @@ def create_inst_dict( if include_pseudo_ops is None: include_pseudo_ops = [] - opcodes_dir = os.path.dirname(os.path.realpath(__file__)) + opcodes_dir = os.path.dirname(os.path.realpath(__file__)) + "/extensions" instr_dict: InstrDict = {} file_names = [ @@ -603,6 +604,7 @@ def create_inst_dict( ) logging.debug("Collecting imported instructions") + for file_name in file_names: logging.debug(f"Parsing File: {file_name} for imported instructions") lines = read_lines(file_name)