nix-servo/fast-servo/linien-demodulate_add_pipeline.patch
linuswck 7eb4cbb0aa gateware: Add pipeline to Demodulation
- Fix timing violations at 125MHz sys frequency
2025-01-13 11:17:14 +08:00

22 lines
718 B
Diff

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),