diff --git a/fast-servo/linien-demodulate_add_pipeline.patch b/fast-servo/linien-demodulate_add_pipeline.patch new file mode 100644 index 0000000..c4de43c --- /dev/null +++ b/fast-servo/linien-demodulate_add_pipeline.patch @@ -0,0 +1,21 @@ +diff --git a/gateware/logic/modulate.py b/gateware/logic/modulate.py +index c750306..ffba1b2 100644 +--- a/gateware/logic/modulate.py ++++ b/gateware/logic/modulate.py +@@ -45,12 +45,14 @@ class Demodulate(Module, AutoCSR): + cordic_mode="rotate", + func_mode="circular", + ) +- self.comb += [ ++ self.sync += [ + # cordic input + self.cordic.xi.eq(self.x), + self.cordic.zi.eq( + ((self.phase * self.multiplier.storage) + self.delay.storage) << 1 +- ), ++ ) ++ ] ++ self.comb += [ + # cordic output + self.i.eq(self.cordic.xo >> 1), + self.q.eq(self.cordic.yo >> 1), diff --git a/flake.nix b/flake.nix index b11e2e3..bf15017 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,7 @@ ./fast-servo/pid_pipeline.patch ./fast-servo/pid_err_sig_pipeline.patch ./fast-servo/linien-gateware-chain-pipeline.patch + ./fast-servo/linien-demodulate_add_pipeline.patch ]; };