From 2c673090ace048d61732bf5094faa9f0deaa7e9e Mon Sep 17 00:00:00 2001 From: matt Date: Sat, 13 Dec 2008 23:28:58 +0000 Subject: reset the phase when we shut down. Aids in sync git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10115 221aa14e-8319-0410-a670-987f0aec2ac5 --- sdr_lib/dsp_core_rx.v | 4 +++- sdr_lib/dsp_core_tx.v | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'sdr_lib') diff --git a/sdr_lib/dsp_core_rx.v b/sdr_lib/dsp_core_rx.v index 0e4af37fb..64c82bbda 100644 --- a/sdr_lib/dsp_core_rx.v +++ b/sdr_lib/dsp_core_rx.v @@ -84,7 +84,9 @@ module dsp_core_rx always @(posedge clk) if(rst) phase <= 0; - else if(run) + else if(~run) + phase <= 0; + else phase <= phase + phase_inc; MULT18X18S mult_i diff --git a/sdr_lib/dsp_core_tx.v b/sdr_lib/dsp_core_tx.v index 535f2003e..54889fa2a 100644 --- a/sdr_lib/dsp_core_tx.v +++ b/sdr_lib/dsp_core_tx.v @@ -58,11 +58,13 @@ module dsp_core_tx always @(posedge clk) strobe_hb2 <= strobe_hb2_pre; always @(posedge clk) strobe_cic <= strobe_cic_pre; - // DDC + // NCO always @(posedge clk) if(rst) phase <= 0; - else if(run) + else if(~run) + phase <= 0; + else phase <= phase + phase_inc; wire signed [17:0] da, db; -- cgit v1.2.3