[libre-riscv-dev] div/mod algorithm written in python
programmerjake at gmail.com
Sat Jun 29 11:08:51 BST 2019
just to make clear, the code in algorithm.py is intended to be a golden
model for testing/verification, not for morphing into nmigen. the nmigen
would go in a separate file.
On Sat, Jun 29, 2019, 03:05 Luke Kenneth Casson Leighton <lkcl at lkcl.net>
> On Sat, Jun 29, 2019 at 10:46 AM Jacob Lifshay <programmerjake at gmail.com>
> > I completed the integer div/mod algorithm for simulation/testing and will
> > be adding fixed-point sqrt/rsqrt next.
> > Those are the operations that handle
> > the mantissas for fdiv/fsqrt/frsqrt.
> perfect - just what's needed. the function "calculate_stage" is what
> goes into div1.py
> > See:
> > after the algorithms work in simulation, I'll convert to nmigen and wire
> > into the fp pipeline.
> > I'm planning on having the whole fpdiv pipe in the div_rem_sqrt_rsqrt
> > folder, I just haven't gotten around to it.
> yeh please don't do that - stick to the structure that's already
> so "calculate_stage" is what is called in ieee754/fpdiv/div1.py,
> taking its data _from_ the self.i object which is in ispec() format -
> these become the input parameters to class UnsignedDivRem - , and
> outputting its data _to_ self.o which is in ospec() format.
> that's difficult to do at the moment because
> UnsignedDivRem.calculate_stage overwrites its variables (self.quotient
> |= rather than returning the computed quotient_bit).
> once that's sorted, calculate_stage will drop into place nicely.
> libre-riscv-dev mailing list
> libre-riscv-dev at lists.libre-riscv.org
More information about the libre-riscv-dev