[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:43:28 BST 2021


--- Comment #15 from dmitry.selyutin at 3mdeb.com ---
(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.
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";`. 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.

> > 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 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. 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.

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

More information about the libre-soc-bugs mailing list