[Libre-soc-bugs] [Bug 439] generated op_divde appears to be incorrect

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jul 24 10:55:55 BST 2020


https://bugs.libre-soc.org/show_bug.cgi?id=439

--- Comment #1 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list