[Libre-soc-bugs] [Bug 448] MUL pipeline unit tests

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Aug 5 18:09:18 BST 2020


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

--- Comment #14 from Cole Poirier <colepoirier at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #13)
> (In reply to Cole Poirier from comment #12)
> 
> > Sure... I'd like to understand how to create this separate unit test. But
> > I'm not sure what the correct api is for adding registers, I looked in the
> > other MUL and DIV tests and they are all two operand, otherwise I would have
> > just used one such test as a template.
> 
> leave it.  the fact that we have to discuss it is impeding your progress
> in committing a working test for everything else.

Makes sense, I commented it out and added a TODO. Unfortunately the test fails
like this. Should I commit?

```
['RA']
reading reg 1
[SelectableInt(value=0x0, bits=64)]
concat 128 SelectableInt(value=0x0, bits=128)
abs 0
abs 0
SelectableInt mul 0x0 0x2 64 256
MULS SelectableInt(value=0x0, bits=320) False False
F
======================================================================
FAIL: run_all (__main__.TestRunner)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_pipe_caller.py", line 289, in run_all
    sim.run()
  File "/home/colepoirier/src/nmigen/nmigen/sim/pysim.py", line 382, in run
    while self.advance():
  File "/home/colepoirier/src/nmigen/nmigen/sim/pysim.py", line 371, in advance
    self._real_step()
  File "/home/colepoirier/src/nmigen/nmigen/sim/pysim.py", line 347, in
_real_step
    process.run()
  File "/home/colepoirier/src/nmigen/nmigen/sim/_pycoro.py", line 120, in run
    self.coroutine.throw(exn)
  File "/home/colepoirier/src/nmigen/nmigen/sim/_pycoro.py", line 61, in run
    command = self.coroutine.send(response)
  File "/home/colepoirier/src/nmigen/nmigen/sim/pysim.py", line 265, in wrapper
    yield from process()
  File "test_pipe_caller.py", line 273, in process
    yield from sim.call(opname)
  File "/home/colepoirier/src/soc/src/soc/decoder/isa/caller.py", line 668, in
call
    results = info.func(self, *inputs)
  File "/home/colepoirier/src/soc/src/soc/decoder/isa/caller.py", line 766, in
decorator
    result = func(*args, **kwargs)
  File "/home/colepoirier/src/soc/src/soc/decoder/isa/fixedarith.py", line 280,
in op_mulli
    prod[0:128] = MULS(RA, EXTS(SI))
  File "/home/colepoirier/src/soc/src/soc/decoder/selectable_int.py", line 311,
in __setitem__
    assert value.bits == bits, "%d into %d" % (value.bits, bits)
AssertionError: 320 into 128

----------------------------------------------------------------------
Ran 1 test in 2.526s

FAILED (failures=1)

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


More information about the libre-soc-bugs mailing list