1 from nmutil
.singlepipe
import ControlBase
2 from nmutil
.pipemodbase
import PipeModBaseChain
4 from ieee754
.fpcommon
.denorm
import FPAddDeNormMod
5 from ieee754
.cordic
.fp_pipe_init_stages
import (FPCordicInitStage
,
9 class CordicPipeChain(PipeModBaseChain
):
10 def __init__(self
, pspec
, stages
):
12 super().__init
__(pspec
)
18 class FPCordicBasePipe(ControlBase
):
19 def __init__(self
, pspec
):
20 ControlBase
.__init
__(self
)
23 self
.denorm
= CordicPipeChain(pspec
,
24 [FPCordicInitStage(self
.pspec
),
25 FPAddDeNormMod(self
.pspec
, False),
26 FPCordicConvertFixed(self
.pspec
)])
28 self
._eqs
= self
.connect([self
.denorm
])
30 def chunkify(self
, initstage
, stages
):
33 for i
in range(0, len(stages
), self
.pspec
.rounds_per_stage
):
34 chunks
.append(stages
[i
:i
+ self
.pspec
.rounds_per_stage
])
35 chunks
[0].insert(0, initstage
)
39 def elaborate(self
, platform
):
40 m
= ControlBase
.elaborate(self
, platform
)
41 m
.submodules
.denorm
= self
.denorm