[libre-riscv-dev] big cleanup / reorg

Luke Kenneth Casson Leighton lkcl at lkcl.net
Wed Jul 31 13:55:14 BST 2019

i did a tidyup today including putting heavily commonly used
(identical) code into two key strategic modules: FPModBase and

FPModBase sets up self.i and self.o from ispec and ospec, and the
setup and process functions are absolutely cookie-cut identical across
literally every single FP module... so those go into a FPModBase,
which is now the default base class for pretty much absolutely every
FP module.

bear in mind that those are all *combinatorial* modules.

FPModBaseChain now contains the code that creates *pipelines* from
those combinatorial modules, and so derives from the (new)
DynamicPipe.  the *only* place now where DynamicPipe is used is:

all of the manual (near-duplicated) code that was formerly in setup()
has now gone, replaced with get_chain() which must return the chain of
*combinatorial* blocks that are to have the "data handling" - pipeline
registers - wrapped around them.

importantly: rather than be forced to declare the ispec and ospec, the
new FPModBaseChain returns the ispec and ospec of the *start and end
of the chain*.  this saves a lot of messing about.

right across the board these two cut out a huge amount of duplicated
cookie-cut identical code.

i've also started removing a lot of the FSM code that wasn't really
being used / maintained, as there is still the (original) jon dawson
code that does pretty much the same job, is smaller, and easier to


More information about the libre-riscv-dev mailing list