[libre-riscv-dev] pipeline nmigen class

Luke Kenneth Casson Leighton lkcl at lkcl.net
Sat Feb 16 07:39:53 GMT 2019


ok so i found several months ago a python class, originally an example
from PyRTL believe it or not, that aids and assists in the creation of
pipelines.

where most pipelines you are forced to create the stages explicitly,
with the names of variables from the first stage being explicitly
named in the second, this class uses a feature of python that allows
for over-riding of the names of class attributes to create pipeline
variables *on demand*.

there's an example, here:
https://git.libre-riscv.org/?p=ieee754fpu.git;a=blob;f=src/add/pipeline_example.py

it's quite clearly much more readable than having to do "n_stage_2 =
n_stage_1 + 1" and, crucially, if the number of stages has to be
*altered*, the entire module is not totally disrupted.

l.



More information about the libre-riscv-dev mailing list