rsd-devel / rsd

RSD: RISC-V Out-of-Order Superscalar Processor
Apache License 2.0
934 stars 95 forks source link

Off by one error in leading 0 count loop? #66

Closed peter-d closed 6 months ago

peter-d commented 1 year ago

Looks like there's an off by one in this for loop https://github.com/rsd-devel/rsd/blob/bc874fc450c04ccf85ab6a3a93469582f01e5ce4/Processor/Src/FloatingPointUnit/FP32PipelinedFMA.sv#L138

It should either be '<76' or '<=75', given it iterates over a 76b vector.

lpha-z commented 1 year ago

Thank you for pointing this out. As you pointed out, leading_zeros_count < 76 is correct here. We will fix this.