[Libre-soc-bugs] [Bug 448] MUL pipeline unit tests
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Sat Aug 8 12:27:28 BST 2020
https://bugs.libre-soc.org/show_bug.cgi?id=448
--- Comment #59 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Cole Poirier from comment #58)
> (In reply to Luke Kenneth Casson Leighton from comment #57)
> > (In reply to Cole Poirier from comment #56)
> > > Updated and pushed, I think it actually works from examining the test output!
> >
> > test_values = [-32768, -32767, -32766, -2, -1, 0, 1, 2, 32766,
> > 32767]
> >
> > so, this is now some fixed values (only), where we want fixed values
> > *and* random values appended.
> >
> > for i in range(40):
> > choice = random.choice(test_values)
> > l = [f"mulli 0, 1, {choice}"]
> >
> > this is now "multiply immediate-choice randomly selected by register 1
> > and put the result in register 0"
> >
> > we don't want "a random choice" we want a for-loop of *all* options from
> > test_values
>
> Right, that makes more sense. I'm sorry but I wasn't able to figure out the
> manner in which you want me to append these random values? Is it simple a
> line before the "for val in test_values" loop that goes like this?
>
> ```
> for i in range(20):
> test_values.append(random.randint(-1 << 15, (1 << 15) - 1))
> ```
yep that's it. the idea is to tidy up the morass of dozens of hand-added random
values, not change the actual functionality.
> > initial_regs = [0] * 32
> > initial_regs[1] = random.randint(-1 << 15, (1 << 15) - 1)
> >
> > this - a 64-bit register - is limited to the range -32768 to +32767
> > we want register 1 to be the full range 0 to 2^64-1
>
> Thank you, I was under the misapprehension that it needed to be in the
> 2^16-1 range in order to ever hit the edge cases over million of runs,
shrinking the range definitely won't achieve that.
> thanks for helping me clear up this misunderstanding.
i see where you're heading, good point, yes we can refine it, by combining
similar things to the "all" test.
however it should be the 0x0 0x1 0xffff.. etc etc list again expanded by some
random values this time in the range 0 to 2^64-1
so the inner loop should set up the list same as in the "all" test named
test_values_ra, append a few random values, then do "for ra in test_values_ra"
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list