ReferenceProc.v

This module adds the phase of a reference signal to a setpoint signal. The reference signal is averaged over many samples prior to the operation. When the reference accumulation is done, the Cordic rotation is initiated.

Data outputs are initially all zero. The go input initiates an accumulation cycle, after which the a Cordic rotation is initiated. Cordic rotations are subsequently automatically retriggered, unless the Testbench symbol is defined by a Verilog directive.

Ports | Parameters | Notes | Example

Ports

clkinputThe clock input.
resetinputReset input, which clears the accumulator and resets the module's state to the idle state.
quadinputA two-bit quadrant fiducial.
goinputInitiates an accumulation cycle. It may be a multi-bit vector whose width is the gb parameter.
ininputThe data input (setpoint) port of w1 bits width. The phase of the reference input is added to this signal.
inMagoutputThe magnitude of the in input scaled by 1/0.607253. It has the same bit width as in.
refinputThe reference input whose phase is added to the in input.
refavgoutputThe reference input averaged output by the internal accumulator. Its width is the same as the in input.
IoutoutputThe in-phase (I) output.
QoutoutputThe quadra-phase (Q) output.
IoutNoutputThe twos-complement negative of the in-phase (I) output, synchronous with Iout.
QoutNoutputThe twos-complement negative of the quadra-phase (Q) output, synchronous with Qout.
outoutputThe I/Q output with the ++--... modulation for fs/4 upconversion.
busyoutputThis output indicates that a Cordic cycle is in progress.
doneoutputA pulse that indicates that a Cordic cycle has completed and data are valid.

Parameters

The figure below illustrates the usage of the bit-width parameters.

w116The bit width of the in input port.
w216The bit width of the ref input port.
w316The bit width of the five output-data ports.
ofl10The number of accumulator overflow bits. The number of accumulation clocks is tied to this parameter: cycles = 2ofl.
apb5The number of accumulator precision bits. These bits on the lsb end of the accumulator participate in the addition of samples, but are discarded at the end of the cycle. This is done to preserve precision of the output.
gb1The number of bits in the go vector, which may be a multi-level trigger.
direction1'b1Whether the module adds the reference phase (1'b1) or subtracts (1'b0) to the set point.

Notes

Example instantiation:

localparam		wid = 16;
wire		[wid-1:0]	Iout, Qout, out;
wire				g, busy, done;
ReferenceProc
    #(.w1(wid), .w2(wid), .w3(wid), .ofl(8), .apb(4))	
    rpinstance (
        .clk(clk),		.reset(reset),
        .go(g),			.quad(quad),
        .in(data),		.ref(d1),
        .Iout(Iout),		.Qout(Qout),		.out(out),
        .busy(busy),		.done(done)
    );