Hans G. wrote:
Ok, I found that the bug was introduced into std_4rx_0tx.rbf at version
4848. Version 4287 does not have the problem.
The changes in changeset 4713 looked suspicious.
"Refactored FPGA *.vh files. Moved common pieces to toplevel/include. "
But I couldn’t find any obvisous mistakes there.
Then I generated a complete diff between r 4287 and 4848 the following
way:
$ cd usrp
$ svn diff -r 4287:4848
But I didn’t find any mistakes there even.
It is also possible that something went wrong when generating
std_4rx_0tx.rbf.
Has anybody tried rebuilding it (with Quartus II) with the current trunk
code (r 4848 or later)
When looking further into the code for the RX_chain I did find a few
(unrelated) bugs in
usrp/fpga/sdr_lib/rx_chain.v
When the NCO is turned off (RX_NCO_ON is not defined)
then sample_strobe is assigned to 1
However sample_strobe is an input, so this will fail.
The same mistake is made for decimator_strobe when the CIC is turned
off.
It can be solved by adding wires for sample_strobe_internal and
decimator_strobe_internal and assigning to that in stead.
This probably hasn’t surfaced because at the moment NCO and CIC are
always enabled.
see lines 31,32, 64 and 74 below.
usrp/fpga/sdr_lib/rx_chain.v
31 input sample_strobe,
32 input decimator_strobe,
…
51 ifdef RX_NCO_ON 52 phase_acc #(FREQADDR,PHASEADDR,32) rx_phase_acc 53 (.clk(clock),.reset(reset),.enable(enable), 54 .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe), 55 .strobe(sample_strobe),.phase(phase) ); 56 57 cordic rx_cordic 58 ( .clock(clock),.reset(reset),.enable(enable), 59 .xi(i_in),.yi(q_in),.zi(phase[31:16]), 60 .xo(bb_i),.yo(bb_q),.zo() ); 61
else
62 assign bb_i = i_in;
63 assign bb_q = q_in;
64 assign sample_strobe = 1;
65 endif // !
ifdef RX_NCO_ON
66
67 ifdef RX_CIC_ON 68 cic_decim cic_decim_i_0 69 ( .clock(clock),.reset(reset),.enable(enable), 70 .rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe), 71 .signal_in(bb_i),.signal_out(hb_in_i) ); 72
else
73 assign hb_in_i = bb_i;
74 assign decimator_strobe = sample_strobe;
75 `endif
Greetings,
Martin