got a backtrace: Traceback (most recent call last): File "src/soc/fu/div/test/test_pipe_caller.py", line 359, in process yield from isa_sim.call(opname) File "/home/jacob/projects/libreriscv/soc/src/soc/decoder/isa/caller.py", line 663, in call results = info.func(self, *inputs) File "/home/jacob/projects/libreriscv/soc/src/soc/decoder/isa/caller.py", line 761, in decorator result = func(*args, **kwargs) File "/home/jacob/projects/libreriscv/soc/src/soc/decoder/isa/fixedarith.py", line 893, in op_divde divisor[0:128] = concat([0 * 64], RB) File "/home/jacob/projects/libreriscv/soc/src/soc/decoder/selectable_int.py", line 441, in selectconcat res.bits += i.bits AttributeError: 'list' object has no attribute 'bits' I'm on soc commit 8bf37997d31250126a664aeb3bd67ac0cd72a70c generated code: @inject() def op_divde(self, RA, RB, RT): dividend = concat(0, repeat=128) dividend[0:128] = concat(RA, concat(0, repeat=64)) divisor = concat(0, repeat=128) divisor[0:128] = concat([0 * 64], RB) if eq(divisor, concat(0, repeat=128)): overflow = 1 else: result = DIVS(dividend, divisor) if eq(result[64:128], SelectableInt(value=0x0, bits=64)): RT = result[63:128] overflow = 0 else: overflow = 1 if eq(overflow, 1): RT[0:64] = undefined[0:64] return (overflow, RT,)
(In reply to Jacob Lifshay from comment #0) > got a backtrace: > > Traceback (most recent call last): > File "src/soc/fu/div/test/test_pipe_caller.py", line 359, in process > yield from isa_sim.call(opname) > File "/home/jacob/projects/libreriscv/soc/src/soc/decoder/isa/caller.py", > line 663, in call > results = info.func(self, *inputs) > File "/home/jacob/projects/libreriscv/soc/src/soc/decoder/isa/caller.py", > line 761, in decorator > result = func(*args, **kwargs) > File > "/home/jacob/projects/libreriscv/soc/src/soc/decoder/isa/fixedarith.py", > line 893, in op_divde > divisor[0:128] = concat([0 * 64], RB) > File > "/home/jacob/projects/libreriscv/soc/src/soc/decoder/selectable_int.py", > line 441, in selectconcat > res.bits += i.bits > AttributeError: 'list' object has no attribute 'bits' > > I'm on soc commit 8bf37997d31250126a664aeb3bd67ac0cd72a70c that's interesting. dividend[0:127] <- (RA) || [0]*64 is correctly parse/interpreted to: dividend[0:128] = concat(RA, concat(0, repeat=64)) (note the two concats) where divisor[0:127] <- [0*64] || (RB) is *incorrectly* parse/interpreted to: divisor[0:128] = concat([0 * 64], RB) (note the missing concat). the first argument is a list. therefore "res" is a list, therefore "res.bits" cannot be done. it _should_ be: divisor[0:128] = concat(concat(0, repeat=64), RB) not divisor[0:128] = concat([0 * 64], RB) will take a look. it's in the parser, somewhere.
wasn't in the parser, it was the pseudocode diff --git a/openpower/isa/fixedarith.mdwn b/openpower/isa/fixedarith.mdwn index 5f55660..7edafee 100644 --- a/openpower/isa/fixedarith.mdwn +++ b/openpower/isa/fixedarith.mdwn @@ -716,7 +716,7 @@ XO-Form Pseudo-code: dividend[0:127] <- (RA) || [0]*64 - divisor[0:127] <- [0*64] || (RB) + divisor[0:127] <- [0]*64 || (RB) if divisor = [0]*128 then overflow <- 1 else @@ -746,7 +746,7 @@ XO-Form Pseudo-code: dividend[0:127] <- (RA) || [0]*64 - divisor[0:127] <- [0*64] || (RB) + divisor[0:127] <- [0]*64 || (RB) if divisor = [0]*128 then overflow <- 1
should be good, give that a shot, jacob (will try it here, too) commit cc732fee588b4422bdf0c97d2646e9b9d75860ce (HEAD -> master, origin/master) Author: Luke Kenneth Casson Leighton <lkcl@lkcl.net> Date: Fri Jul 24 11:09:14 2020 +0100 submodule update
assigning to you, jacob, for confirmation on the unit test