~poptart/riscv-business

90d7b74028402c40dac0453d3ef4ec737d5e909b — terrorbyte 1 year, 5 months ago 87aa8d7
Updated some utilities
3 files changed, 11 insertions(+), 8 deletions(-)

A util/instr_base.tbl
R util/{lookup.table => instr_c.tbl}
M util/trashfmt.py
A util/instr_base.tbl => util/instr_base.tbl +7 -0
@@ 0,0 1,7 @@
#type:instr: opcode: immed  : func7  : func3  : rs1    : rs2    : rd     
R:x0,x0,x0:0000003F:00000000:FE000000:00003800:0007C000:01F80000:000007C0
I:x0,0(x0):0000003F:FFF80000:00000000:00003800:0007C000:00000000:000007C0
S:x0,0(x0):0000003F:FE0007C0:00000000:00003800:0007C000:01F80000:00000000
SB:x0,0(x0):0000003F:FE0007C0:00000000:00003800:0007C000:01F80000:00000000
U:x0,0:0000003F:FFFFF800:00000000:00000000:00000000:00000000:000007C0
UJ:x0,0:0000003F:FFFFF800:00000000:00000000:00000000:00000000:000007C0

R util/lookup.table => util/instr_c.tbl +2 -7
@@ 1,10 1,5 @@
#Instruction:OpCodeMask:ImmediateMask:Funct7Mask:Funct3Mask:rs1Mask:rs2Mask:rdMask
R:x0,x0,x0:00000000
I:x0,0(x0):00000FFF
S:x0,0(x0):FFF00F00
SB:
U:x0,0:FFFFF000
UJ:x0,0:FFFFF000
#type:instr: opcode: immed  : func7  : func3  : rs1    : rs2    : rd     
#R:x0,x0,x0:0000003F:00000000:FE000000:00003800:0007C000:01F80000:000007C0
CR:
CI:
CSS:

M util/trashfmt.py => util/trashfmt.py +2 -1
@@ 1,3 1,4 @@
#!/usr/bin/env python3
import sys
print('{:032b}'.format(int(sys.argv[1], 16)))
x = '{:032b}'.format(int(sys.argv[1], 16))
print(' '.join([x[i:i+8] for i in range(0,len(x),8)]))