[Libre-soc-bugs] [Bug 904] Formal proof for pop-count

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sat Aug 6 12:17:15 BST 2022


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

--- Comment #5 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #4)
> (In reply to Luke Kenneth Casson Leighton from comment #2)
> > renember there is already a treereduce function
> > in nmutil, please do not duplicate it, it will
> > be embarrassing to publicly announce that two
> > identical functions are present in an EU funded
> > project.
> 
> I didn't remember that. 

understandable as it is 7 lines if that, no comments and
no docs or unit tests.  If you can cross ref some comments,...
I will do it.

> The version I added (tree_reduction) is still useful
> because iirc it matches the reduction algorithm used by SVP64 (without
> predication),

nice. Compliance with the spec there is going to be
interesting given dynamic skipping
https://git.libre-soc.org/?p=libreriscv.git;a=blob;f=openpower/sv/preduce.py;hb=HEAD

> whereas treereduce doesn't -- it instead matches the algorithm
> used by Arm SVE's reduction ops.

great ill put that in docstrings.

> also, tree_reduction is a very simple wrapper around partial_prefix_sum_ops
> which is a prefix sum that allows you to choose which outputs you want and
> eliminates unnecessary operations, leaving just the operations needed for
> just those outputs.

doing that dynamically at runtime in HDL  is where it gets
hair raising

> an additional benefit of the version I wrote is you can easily get the full
> list of operations run by the tree reduction, just:
> list(tree_reduction_ops(...))

nice.

if you can fix it by removing data class and keep clear
of unnecessary (i.e. all) type-based assertions it'll be ok.
I don't mind length based assertions which make sure
mistakes that create silent errors.

But if someone passes in a string instead of an int and
a runtime exception occurs then great that is good enough.

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


More information about the libre-soc-bugs mailing list