From: Luke Kenneth Casson Leighton Date: Sun, 30 Sep 2018 12:33:07 +0000 (+0100) Subject: add a #define to id_regs.py which indicates name of the instruction X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4a5419687895d1a127fc5535ff907f23ebcadfbb;p=riscv-isa-sim.git add a #define to id_regs.py which indicates name of the instruction the c preprocessor cannot cope with detecting what the name of the instruction is (and when it does, if it is "and" that throws a compile-error), so as a workaround have id_regs.py create a #define INSN_ADD, #define INSN_ADD_I etc. --- diff --git a/id_regs.py b/id_regs.py index b705ec7..0d732b3 100644 --- a/id_regs.py +++ b/id_regs.py @@ -105,4 +105,6 @@ if __name__ == '__main__': regsname = "regs_%s.h" % insn regsname = os.path.join(insns_dir, regsname) with open(regsname, "w") as f: - f.write(find_registers(fname)) + txt = find_registers(fname) + txt += "\n#define INSN_%s\n" % insn.upper() + f.write(txt)