Lattice Semiconductor Correlator IP Core
3
Since the coefficients in a complex correlation are restricted to the values {+1,-1}, the multiplications in Equation 3
simplify to inversions of the d
re
and d
im
terms, and the whole equation reduces to a series of additions and subtrac-
tions. The Correlator IP core performs these inversions and sums the results to produce a new result value r for
each new d
re
and d
im
term input to the core. In this case, the result sequence will have two terms, a real term and
an imaginary term.
Functional Description
The Correlator IP core is composed of the following functional blocks:
•
State Machine
– Controls the flow of data received from the user. Generates the starting pointer values neces-
sary to read/write the Tap Memory and stores the pointer values in the Channel Memory. Stores the starting
pointer values for the next correlation operation in the input FIFO. Generates the “shiftby” value for the aligner.
•
Channel Memory
– Stores the pointer to the location in Tap Memory to write the next data value.
•
Input FIFO
– Stores the pointer to the starting point in Tap and Coefficient Memories for the next correlation.
•
Tap Memory
– Stores the data terms (d
i
).
•
Coefficient Memory
– Stores the coefficient terms (c
i
).
•
Aligner
– Aligns data and coefficients read from memory for the correlation operation.
•
Correlator
– Performs the equivalent of the multiplication operations in Equations 1 and 2.
•
Adder/Accumulator
– Performs the addition and subtraction operations in Equations 1 and 2.
Correlator Input and Output Data
The Correlator IP core accepts a new input data value for a channel and writes that value into Tap Memory. When it
is ready to perform the next correlation operation for that channel, the new data value will be included in the corre-
lation, along with enough “old” data already in memory to completely fill the correlation window. The Tap Memory is
a circular buffer which contains a correlation window’s worth of data. As each new value is added to Tap Memory
for a particular channel, a correlation operation needs to be run and completed before the next new value is added
to memory for that channel. New data can be written into Tap Memory for channels other than the one the Correla-
tor is operating on, however it is the user’s responsibility to insure that a correlation operation is done for a particu-
lar channel before new data is written into memory for that same channel. This is easy to do for a large number of
channels where new data is written to channels in a round-robin sequence, or if the Correlator throughput is not
stressed to its limit (i.e. unused cycles appear between correlations), but the problem can be difficult to manage for
small numbers of channels. The Correlator IP core will automatically prevent new data being written into Tap Mem-
ory and corrupting a correlation as long as the input FIFO depth (parameter 9) is set to 1.
Figures 2 and 3 show the timing of the user interface. The state machine accepts one new data value from the user
interface at a time. When the state machine is ready to accept a new input data word from the user interface it
asserts the
crdy
signal. The user interface then inputs
din
,
chan_in
,
code_sel_in
,
block_start_in
, and
asserts the
irdy
signal. When the state machine sees
irdy
go active, it will take the new data value from the user
interface. If the design has been configured for multiple channels, the state machine reads the pointer for that chan-
nel from the Channel Memory. This pointer value tells the state machine where in Tap Memory to write the data
value just received from the user interface. This pointer value will also be the starting point for the next correlation
operation, so this pointer value is stored in the Input FIFO until the next correlation operation is ready to start. Once
the present correlation operation finishes, or if no correlation operation was in progress when a new data value was
received, then the Input FIFO is read to determine the starting pointer for the next correlation. The state machine
begins reading the Tap and Coefficient Memories at the starting pointer location, and it reads until it has read an
entire correlation window’s worth of data and coefficients.
Figure 2 shows at time 173.5µs that
crdy
went active. The user provided a value of 0x3 for channel 0, and set the
code_sel_in
to 1 which indicates which coefficient sequence is to be used for the correlation of channel 0 data.