1 # SPDX-License-Identifier: LGPL-2.1-or-later
2 # See Notices.txt for copyright information
4 from nmutil
.singlepipe
import SimpleHandshake
8 """ Pipeline Specification base class.
10 :attribute width: the IEEE754 FP bitwidth
11 :attribute id_wid: the Reservation Station muxid bitwidth
12 :attribute op_wid: an "operand bitwidth" passed down all stages
13 :attribute opkls: an optional class that is instantiated as the "operand"
15 See ieee754/fpcommon/getop FPPipeContext for how (where) PipelineSpec
16 is used. FPPipeContext is passed down *every* stage of a pipeline
17 and contains the Reservation Station multiplexer ID as well as
18 an optional "operand". This "operand" may be used to *change*
19 the behaviour of the pipeline. In RISC-V terminology it would
20 typically be set to e.g. funct7 or parts thereof.
24 def __init__(self
, width
, id_width
, op_wid
=0, opkls
=None, pipekls
=None):
25 """ Create a PipelineSpec. """
27 self
.id_wid
= id_width
30 self
.pipekls
= pipekls
or SimpleHandshake
31 self
.core_config
= None
33 self
.n_comb_stages
= None
36 def DynamicPipeCreate(pspec
, *args
, **kwargs
):
37 superclass
= pspec
.pipekls
38 class DynamicPipe(superclass
):
39 def __init__(self
, *args
, **kwargs
):
41 superclass
.__init
__(self
, *args
, **kwargs
)
43 return DynamicPipe(*args
, **kwargs
)