InterpIncr.v

First a summary about the interpolation scheme for which this module is intended. Ramp waypoints are available periodically, and the slope of the ramp is approximated by the step from one waypoint to the next divided by the interval between waypoints. In this interpolation scheme, the ramp between two waypoints is incremented in the correct direction (up or down) every n clock cycles, where n is the integer nearest the reciprocal of the slope. This module module takes the interval between waypoints and the increment from one waypoint to the next, computes the reciprocal slope n, generates internal pulses that are interpreted as the times at which to increment the ramp and the direction (up or down), and accumulates the increments, which is returned and added to the first of the two waypoints in the enclosing module. When the next waypoint increment is available, the increment is reset and the cycle is repeated. This module is instantiated twice, once each for the interleaved I and Q components.

Ports

clkinputThe clock input.
resetinputThe reset input.
eninputAn enable input. The state of the module is frozen when at logic zero.
goinputCommand to initiate a cycle.
intervalinputThe interval in clocks between waypoints.
stepoutputThe difference between successive waypoints.
incroutput    The accumulated increments.

Parameters

dwidth    Width of the signed step input, chosen large enough to handle the largest anticipated step.
iwidth Width of the inter-waypoint interval input, chosen to accommodate the largest expected interval. For example, if the clock is 40 MHz, the longest ramp is 10 s, and there are 512 waypoints in that ramp, then iwidth must be at least 20.
swidth Width of the word holding the accumulated ramp increment between waypoints (default dwidth; it should not need to be changed).
xwidth Width of the internal word holding the timer interval between increments (reciprocal slope n; default 8).

Notes

Example instantiation in Verilog:

wire		[14:0]	step;
wire		[19:0]	interval;
wire		[ 7:0]	incr;

InterpIncr
    #(.dwidth(15), .iwidth(20), .swidth(10), .xwidth(8))
    InterpIncr_inst (
        .clk(clk), 
        .reset(reset),
        .en(en),
        .go(go), 
        .interval(20000),
        .step(step),
        .incr(incr),
        .busy(busy)
    );