NetworkAnalyzerPipelined (NetworkAnalyzer.v)

Block diagram

This module acts as a network analyzer: it generates a synthesized (DDS) sine wave for excitation of a system being measured, and Fourier analyzes one or more signals from the system for their response functions from the point of excitation. The Fourier analysis consists of computation of sine and cosine integrals over a specified number of clocks. A dead time allows transients to die away. To excite a system, the sine wave generated by the DDS is added to a signal passing in and out through a pair of ports. The intensity of the excitation may be selected as a power of two. The DDS is useful for all excitation frequencies within the sampling bandwidth. Up to 15 signal channels may be intantiated, the number set by a parameter specified at build time.

This module is a full-bandwidth network analyzer: it can measure at any frequency in the sampling bandwidth with resolution determined by the phase-accumulator bit-width parameter wpa.

fres = fs × 2-wpa
For example, with fs = 40 MHz and wpa = 22, the resolution is about 10 Hz. The module's use is significantly simpler than that of the modules with serial DDSs.

The DDS frequency is selected via numerical logic input vectors, as is the duration of integration. The sine and cosine integrals are accessible by the host through a throttled pipe. The up to 30 integrals are transferred as a block (illustrated below), each integral as a double word, along with a double word containing the integration time as a clock count, and a filler double word. The block size transferred is 32 double words (128 bytes) regardless of the number of channels instantiated.

I1, Q1
I2, Q2
...
Inchans, Qnchans
0, 0
...
0, integration time

The following figure shows the open-loop response of the system with the output connected to the cavity input and measured over the entire sampling bandwidth. Besides showing the response of the analog electronics of the controller, it also shows the z = ±1 nulls in the response of IQDetector. The dotted lines are at the IF2 frequency and its negative.

The delay value in the phase plot is slightly low due to a phase-unwrapping glitch at the frequency midpoint (z = -1) where there is a zero in the response.

Ports

clkinputThe clock input.
resetinputThe reset input, used return the network analyzer to the idle state, including stopping DDS output.
goinputArm/trigger vector that initiates an analysis sequence. A single bit simply triggers the start.
gonowoutputIs asserted for a clock when the final trigger condition is met. This is the pulse that finally initiates an analysis sequence.
quadinputThe I/Q quadrant fiducial.
freqinputThe frequency in terms of the phase increment on the 2wpa scale of the DDS phase accumulator, which is incremented every clock.
acquirecountinputIntegration time in clocks.
ddsI0, ddsQ0outputThe I and Q outputs of the DDS. These signals are the provided to the fourier analyzers' reference inputs.
ddsI, ddsQoutputThe ddsI0 and ddsQ0 outputs scaled by 2intensity-15.
signalsinputThe signals in I/Q data streams to be analyzed. There are nchans of them concatenated into a single vector.
fourieroutputThe output Fourier cosine and sine integrals. There are 2*nchan of them concatenated into a single vector.
busyoutputIndicates that a measurement sequence is in progress, including the leading dead time.
validoutputAsserted for one clock cycle to indicate that an analysis sequence has completed and data are available at fourier for readout.
intensityoutputThe intensity of the DDS output. The DDS output is scaled downward by powers of two selected by intensity: dds = 2intensity-15 × full scale.
srcininputA system I/Q data stream to which is added the dds excitation.
srcoutoutputThe srcin port with the scaled dds excitation added.
hi_clkinputHost clock of the host interface.
hi_strobeinputIndicates that the host is initating a read sequence.
hi_readyoutputIndicates that the logic is ready to provide data to the host.
hi_readinputAsserted by the host when reading data from the data port.
hi_dataoutputProvides data to the host.

Parameters

Parameters, their defaults, and descriptions:

nchans1The number of fourier channels instantiated. It is the number of signals concatenated into the signals vector to be analyzed.
wd16The bit width of the signals to be analyzed.
wdds12The bit width of the DDS output ports ddsI,Q and ddsI0,Q0.
wo24The bit widths of the Fourier integrals in ports fourier and meas.
wpawdds+1The bit width of the freq port and the phase accumulator internal to the dds. It controls the frequency resolution (see the note below). The freq port is added to the phase accumulator every clock.
wtc10The bit width of the acquiretime port and integration-time counter.
oflwtcThe number of integrator overflow bits. Integration times must always be short enough that the integrator does not overflow during the analysis cycle.
fapb12The number of accumulator precision bits. These least-significant bits are used during accumulation but discarded from the output as a means to control accumulated quantization noise. The value ofl/2 is often a good choice.
ws14The bit widths of the source input and output ports srcin and srcout.
wi4The intensity-port bit width. It need not be greater than ceiling(log2(wdds)).
whi16The host-interface bus width.

Notes


Example instantiation:

localparam    chans = 3,	// number of channels
              wd = 15,		// signals to be analyzed
              ws = 14,		// through ports
              wdds = 12,	// dds width
              wo = 24,		// fourier output
              wpa = 19,		// phase accumulator
              wtc = 11,		// turn counter
              ofl = 20,		// overflow
              whi = 16;		// host interface

// network analyzer setup parameters
wire              [wtc-1:0]      integrationtime;
wire  signed      [wpi-1:0]      frequency;
wire              [wi-1:0]       intensity;

// DDS outputs
wire  signed      [wdds-1:0]     I0, Q0;          // unscaled
wire  signed      [wdds-1:0]     I, Q;            // scaled

// input signals to be analyzed
wire              [wd-1:0]       sig1, sig2, sig3;

// through ports into which dds is injected
wire  signed      [ws-1:0]       din, dout;

// host interface ports
wire                             hi_clk, hi_strobe, hi_ready, hi_read;
wire              [whi-1:0]      hi_data;

NetworkAnalyzer
    #(.nchans(chans), .wd(wd),   .ws(ws),   .whi(whi), .wdds(wdds), 
             .wo(wo), .wpa(wpa), .wpi(wpi), .wtc(wtc), .ofl(ofl))
    na (
        .clk(clk),                  .reset(stoppulse),
        .go(startpulse),           	.gonow(nagonow),
        .quad(quadrantfiducial),
        .freq(frequency),           .dampcount(dampingtime),
        .intensity(intensity),      .acquirecount(integrationtime),
        .ddsI0(I0),                 .ddsQ0(Q0),             // unscaled
        .ddsI(I),                   .ddsQ(Q),               // scaled
        .signals({sig3, sig2, sig1}),
        .busy(naBusy),              .ddstick(ddst),
        .turntick(nact),            .valid(naValid),
        // ff data stream
        .srcin(din),                .srcout(dout),
        // host interface
        .hi_clk(hi_clk),            .hi_strobe(hi_strobe),
        .hi_ready(hi_ready),        .hi_read(hi_read),
        .hi_data(hi_data)
    );