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
)
8 class CordicPipeChain(PipeModBaseChain
):
9 def __init__(self
, pspec
, stages
):
11 super().__init
__(pspec
)
17 class FPCordicBasePipe(ControlBase
):
18 def __init__(self
, pspec
):
19 ControlBase
.__init
__(self
)
22 self
.denorm
= CordicPipeChain(pspec
,
23 [FPCordicInitStage(self
.pspec
),
24 FPAddDeNormMod(self
.pspec
, False)])
26 self
._eqs
= self
.connect([self
.denorm
])
28 def chunkify(self
, initstage
, stages
):
31 for i
in range(0, len(stages
), self
.pspec
.rounds_per_stage
):
32 chunks
.append(stages
[i
:i
+ self
.pspec
.rounds_per_stage
])
33 chunks
[0].insert(0, initstage
)
37 def elaborate(self
, platform
):
38 m
= ControlBase
.elaborate(self
, platform
)
39 m
.submodules
.denorm
= self
.denorm