[libre-riscv-dev] div/mod algorithm written in python

Luke Kenneth Casson Leighton lkcl at lkcl.net
Wed Jul 3 06:53:26 BST 2019

On Wed, Jul 3, 2019 at 5:52 AM Jacob Lifshay <programmerjake at gmail.com> wrote:

> I implemented FixedSqrt and FixedRSqrt and they pass all tests.

 great.  btw, do try to avoid using functions with the word "test" in
them unless they're an actual unit test (shorten to tst or something)
- nosetests3 .../test_xxx.py throws several errors.

>  I
> think I'll create a combined class that can compute all of
> div/rem/fixed-sqrt/fixed-rsqrt before converting to nmigen since
> python is easier to read/write than nmigen.

 sigh indeed.  not sure if there's much that can be done about that,
although i have started doing this at the top of functions:
 comb = m.d.comb
 sync = m.d.sync

 it reduces indentation by 4 and allows things to fit onto one line in
many cases.


More information about the libre-riscv-dev mailing list