[Libre-soc-bugs] [Bug 657] unit tests needed for BCD instructions

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Aug 19 18:56:16 BST 2021


--- Comment #17 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to dmitry.selyutin from comment #15)
> (In reply to Luke Kenneth Casson Leighton from comment #14)
> First of all, your reply made me realize that I haven't pushed the changes.

doh, been there

> However, your replies led to some more changes, more below. :-)
> > yes. full_adder64 (much as i like it) can be replaced
> It's already replaced in trunk.


> > do
> >      addg6s |= 0b0110 << lo
> This is not as close as it can be to `addg6s(lo + 3 downto lo) := "0110";`.

don't worry about it.  

> The best option would be to assign parts of slice (I'm splitting the integer
> into bits). IIRC Python supports it, I will re-check.

it doesn't, which is why we created SelectableInt.

> > > 3. Instead of generating the product, we generate random BCDs.
> > yyyeah, lots of them.
> Not that many. However, when I checked the code to see the number (16 * 31
> currently, 1 register is not used), I found that somehow I swapped the loop.
> I've fixed it now, and pushed along with forgotten commits.


> > it uses (ultimately) XOR?
> I have no idea what Python uses, but most likely yes. 

i meant in the abstract (back at gate level)

> I simply took the most
> obvious option to generate BCD in range 0..9.
> > btw do keep to under an 80 char limit.
> I'll re-check it. 

some GUI based editors have guide lines. another trick
is "git diff" in an xterm 80x65 or so.  if any line wraps,

> That said, I don't like how does DPD_TO_BCD_TABLE
> formatting look like after line-length change. It used to be much cleaner,
> and the only reason it's changed is the hard limitation. Any ideas on how to
> improve it are appreciated, I only thought about spaces.

yeah i did a global search replace vim ":%s/   / /g" and realised after
it took away too much.

reinserting one space inter-column would likely do it.

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

More information about the libre-soc-bugs mailing list