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

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Aug 6 23:58:33 BST 2020


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

--- Comment #48 from Cole Poirier <colepoirier at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #45)
> https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/fu/mul/test/
> test_pipe_caller.py;hb=HEAD#l290
> 
> blegh.  that's a mess, Cole.
> 
> instead, do a for loop appending one random value to a static list, each
> time.

Like this?

def case_mulli(self):

    test_values = [-32768, -32767, -32766, -2, -1, 0, 1, 2, 32766, 32767]

    for i in range(20):
        test_values.append(random.randint(-1 << 15, (1 << 15)-1))

    l = ["mulli 3, 1, 2"]
    for ra in test_values:
        for rb in test_values:
            initial_regs = [0] * 32
            initial_regs[1] = ra
            initial_regs[2] = rb
            # use "with" so as to close the files used
            with Program(l, bigendian) as prog:
                self.add_case(prog, initial_regs)

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


More information about the libre-soc-bugs mailing list