RampInterp.v
This module provides a ram buffer in which to hold a ramp waypoint table for both I and Q components of a waveform. The buffer is filled by a host via a host interface. When triggered, the module then clocks out the waypoints at a rate also determined by the host, and interpolates between them so as to provide a smoothly changing ramp.
Ports | Parameters | Notes | Example | Illustration
Ramp ports
clk | input | The clock input. |
reset | input | The reset input. |
en | input | An enable input. The state of the module is frozen when at logic zero. |
go | input | Command to initiate a cycle. |
interval | input | The interval in clocks between waypoints. |
step | output | The difference between successive waypoints. |
incr | output | The accumulated increments. |
Host-interface ports
clk_hi | input | Host-interface clock. |
ready_hi | output | Indicates that the table is ready to receive a block of data. |
strobe_hi | input | Strobe signal marking start of a packet. |
bufwri_hi | input | Data-valid signal. |
pipe_hi | input | Data pipe to logic. |
Parameters
dwidth | 16 | Width of the ramp-waypoint data (to be interpolated. |
awidth | 11 | Width of the waypoint address counter. |
iwidth | 16 | Width of the inter-waypoint clock counter. |
swidth | 10 | Width of the word holding the ramp step between waypoints. |
blksize | 512 | Something |
Notes
- The five _hi signals constitute the host interface to the waypoint table. That interface operates independently of the remainder of the logic. The table must be loaded by the host at some time prior to the use of the interpolator (or at least during).
- The table may be filled by more than one data packet from the host interface. The start of each is marked by assertion of the strobe.
- Because this module implements linear interpolation, it is necessary that waypoint tables not have kinks. Waypoints should model smooth curves.
- The inter-waypoint interval value is scaled by 16 in this module.
- The module was tested with the aid of GTKWave.
Example instantiation in Verilog:
wire [2*15-1:0] rampout;
wire [ 19:0] interval;
wire [ 1:0] quadrant; // rotates among the four quadrants
wire [15-1:0] hostdatapath;
RampInterp
#(.dwidth(15), .awidth(20), .iwidth(10), .swidth(8), .blksize(512))
InterpIncr_inst (
.clk(clk),
.reset(reset),
.en(enable),
.fiducial(fid),
.go(go),
.interval(interval),
.quad(quadrant),
.ramp(rampout),
.busy(busy),
.valid(waypointvalid),
.done(done),
// host-interface ports for the waypoint table
.clk_hi(hostclock),
.ready_hi(readytoload),
.strobe_hi(strobe),
.bufwr_hi(hostwrite),
.pipe_hi(hostdatapath)
);
Four-ramp sequence