Closed AnttiLukats closed 5 years ago
a fix would be to rewrite the calc in dhrystone_main.c as
Dhrystones_Per_Second = HZ/User_Time * Number_Of_Runs;
but that means we actually modify the benchmark source code :(
Another fix is to define the HZ as 50000000LL this approuch would leavel the benchmark source files untouched with the side effect that resulting binary is about 2Kbyte larger
contest rules say that dhrystone from this github url must be used https://github.com/riscv/riscv-tests/tree/master/benchmarks/dhrystone there are 3 files, and we must assume those files can not be modified to comply with the rules.
Those files will calculate benchmark as
Dhrystones_Per_Second = (HZ * Number_Of_Runs) / User_Time;
Where User_Time is mcycle CSR difference, so it is read from counter that runs and CPU clock speed, so it obvious we must define HZ equal to clock CPU frequency. This can be done in util.h (so we do not need to modify the benchmark sources)
problem is dhrystone result will then be NEGATIVE number.. nonsense!