kuznia-rdzeni / coreblocks

RISC-V out-of-order core for education and research purposes
https://kuznia-rdzeni.github.io/coreblocks/
BSD 3-Clause "New" or "Revised" License
38 stars 16 forks source link

Hash functions and CountHashTab #727

Open lekcyjna123 opened 3 months ago

lekcyjna123 commented 3 months ago

Hi, Here is a pull request which adds hash tables. In particularly:

I am not sure how to test them, so comments are welcome.

Hash functions I test using statistical test to check if they hash into uniform distribution, but sadly for small input data (from range [0,1023]) there is some bias and statistical tests fails... Whats more I am not sure if we want to have tests based on statistics, because this can cause instability.

tilk commented 3 months ago

Whats more I am not sure if we want to have tests based on statistics, because this can cause instability.

We're not supposed to implement some dreamed up hash functions, but some existing ones with established properties. The only thing to test is to compare a hardware implementation to a software one.