move DynamicPipe to nmutil
[ieee754fpu.git] / src / ieee754 / pipeline.py
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2 # See Notices.txt for copyright information
3
4 from nmutil.singlepipe import SimpleHandshake
5 from nmutil.dynamicpipe import DynamicPipe, SimpleHandshakeRedir
6
7
8 class PipelineSpec:
9 """ Pipeline Specification base class.
10
11 :attribute width: the IEEE754 FP bitwidth
12 :attribute id_wid: the Reservation Station muxid bitwidth
13 :attribute op_wid: an "operand bitwidth" passed down all stages
14 :attribute opkls: an optional class that is instantiated as the "operand"
15
16 See ieee754/fpcommon/getop FPPipeContext for how (where) PipelineSpec
17 is used. FPPipeContext is passed down *every* stage of a pipeline
18 and contains the Reservation Station multiplexer ID as well as
19 an optional "operand". This "operand" may be used to *change*
20 the behaviour of the pipeline. In RISC-V terminology it would
21 typically be set to e.g. funct7 or parts thereof.
22
23 """
24
25 def __init__(self, width, id_width, op_wid=0, opkls=None, pipekls=None):
26 """ Create a PipelineSpec. """
27 self.width = width
28 self.id_wid = id_width
29 self.op_wid = op_wid
30 self.opkls = opkls
31 self.pipekls = pipekls or SimpleHandshakeRedir
32 self.stage = None
33 self.core_config = None
34 self.fpformat = None
35 self.n_comb_stages = None
36