From 5e60fcf8088985b7dd8e6a5cd6e5d093e5b70399 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sun, 29 May 2011 04:11:39 -0700 Subject: [sim,opcodes] improved sim build and run performance --- parse-opcodes | 105 ++++++++++++++++++++++++++++++++------------------------- update-opcodes | 2 +- 2 files changed, 60 insertions(+), 47 deletions(-) diff --git a/parse-opcodes b/parse-opcodes index 5a34318..4cf0b84 100755 --- a/parse-opcodes +++ b/parse-opcodes @@ -85,51 +85,64 @@ def make_disasm_table(match,mask): print '#define MATCH_%s %s' % (name2, hex(match)) print '#define MASK_%s %s' % (name2, hex(mask[name])) -def make_switch(match,mask): - opcode_mask = ((1<<(opcode_base+opcode_size))-(1<> 0x%x) & 0x%x)' % (opcode_base,(1<> %d) & %d)\n' % (switch_base, (1<> start) & ((1 << len) - 1) @@ -826,6 +839,6 @@ elif sys.argv[1] == '-verilog': elif sys.argv[1] == '-disasm': make_disasm_table(match,mask) elif sys.argv[1] == '-switch': - make_switch(match,mask) + make_switch(match,mask,sys.argv[2]) else: assert 0 diff --git a/update-opcodes b/update-opcodes index 75121e8..6f88671 100755 --- a/update-opcodes +++ b/update-opcodes @@ -3,4 +3,4 @@ ./parse-opcodes -verilog < opcodes > inst.v ./parse-opcodes -disasm < opcodes > ../xcc/src/include/opcode/mips-riscv-opc.h ./parse-opcodes -disasm < opcodes > ../pk/pk/riscv-opc.h -./parse-opcodes -switch < opcodes > ../sim/riscv/execute.h +./parse-opcodes -switch ../sim/riscv < opcodes -- cgit v1.2.3