switch to exact version of cython
[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,
26 pipekls=None, n_ops=2):
27 """ Create a PipelineSpec. """
28 self.width = width
29 self.id_wid = id_width
30 self.op_wid = op_wid
31 self.opkls = opkls
32 self.pipekls = pipekls or SimpleHandshakeRedir
33 self.n_ops = n_ops
34 self.stage = None
35 self.core_config = None
36 self.fpformat = None
37 self.n_comb_stages = None
38