Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
f For more information on IEEE 802.16e-2005, refer to the IEEE Standard for
Local and Metropolitan Area Networks Part 16: Air Interface for Fixed and
Mobile Broadband Wireless Access Systems, December 2005.
Reference The WiMAX OFDMA ranging reference design offers the following
features:
Design Features
■ Ranging functions compliant to mandatory parts of IEEE802.16e-
2005
■ Suitable for use in WiMAX compliant OFDMA basestations
■ All different ranging modes supported:
● Initial/handover ranging over two symbols
● Initial/handover ranging over four symbols
● Periodic/bandwidth ranging over one symbol
● Periodic/bandwidth ranging over three symbols
● Supports multiple ranging channels
■ Synthesis time parameter of maximum number of ranging channels
■ Supports multiple antennas
■ Adaptive threshold for code detection
■ Improved performance under varying signal-to-noise ratio (SNR)
conditions.
■ Parameterizable maximum timing delay:
Altera Corporation 1
AN-430-1.0 Preliminary
WiMAX OFDMA Ranging
WiMAX Physical Figure 1 shows an overview of the IEEE 802.16e-2005 scalable OFDMA
physical layer (PHY) for WiMAX basestations.
Layer
2 Altera Corporation
Preliminary
WiMAX Physical Layer
MAC/PHY Interface
Interleaving Deinterleaving
Channel Estimation
To MAC
and Equalization
Subchannelization
Pilot Insertion Desubchannelization
OFDMA OFDMA Ranging
Pilot Extraction
Symbol-Level
Processing
IFFT FFT
Remove
Cyclic Prefix
Cyclic Prefix
DUC DDC
CFR
Digital IF From ADC
Processing
DPD
To DAC
Altera Corporation 3
Preliminary
WiMAX OFDMA Ranging
Algorithm Ranging codes are transmitted from the SS to the access point (AP), to
obtain information on the network set-up and synchronize the link. In
Description particular, ranging can obtain the following type of information:
The WiMAX OFDMA ranging reference design considers the first two
requirements (ranging code detect and timing offset calculation). In the
802.16e-2005 specification, there is a mechanism to indicate the frequency
offset to the SS after ranging, but this application note does not consider
the method for calculating frequency offset.
4 Altera Corporation
Preliminary
Algorithm Description
Altera Corporation 5
Preliminary
WiMAX OFDMA Ranging
Initial Ranging
During initial ranging, the same code is transmitted over two symbols
without phase discontinuity, which has the following two important
properties:
■ You can correlate over the entire symbol period rather than just the
CP
■ You can perform correlation with ranging codes in the frequency
domain, even when the timing is unknown. Provided the FFT is run
every symbol, one or two symbols over a three symbol duration
contain a full ranging code
6 Altera Corporation
Preliminary
Algorithm Description
Solution
This section describes the algorithm that is implemented in Altera
hardware.
Initialization Sequence
R(k) = C(k)H(k)
Altera Corporation 7
Preliminary
WiMAX OFDMA Ranging
However, if you do not sample at the ideal point (which is likely on initial
ranging), assuming continuous phase over adjacent symbols, sampling
the data late (with unknown propagation delay) results in an additional
phase shift on subcarrier k given by the following equation:
exp(–j2πkΔn/N)
R(k) = C(k)H(k)exp(–j2πkΔn/N)
Assuming the channel is constant over two subcarriers, and the correct
code is being detected, the new signal S(k) is given by the following
equation:
The resulting signal has a phase that is dependent on the timing offset,
but no longer dependent on the subcarrier number k. The magnitude
corresponds to an approximate maximal ratio weighting, and reflects the
probability of code detect.
8 Altera Corporation
Preliminary
Algorithm Description
In this way, a better channel estimate can be formed (reducing noise) and
all available subcarriers can be used to form the correlation peak. Finally,
the correlation properties of the code remain ideal.
Altera Corporation 9
Preliminary
WiMAX OFDMA Ranging
For initial ranging, the code correlations are summed separately for odd
and even symbols, because the transmitted codes exhibit high correlation
values on alternate symbols (unless the received sequence is aligned
within the cyclic prefix of the receiver reference) (see Figure 3).
10 Altera Corporation
Preliminary
Algorithm Description
Figure 3. Initial Ranging Correlation Summation for Transmission of Two Ranging Codes
*
Transmit Transmit Transmit Transmit Input
Code M Code M Code M + 1 Code M + 1
=
Correlation Correlation Correlation Correlation Correlation
low high low high output
Also, you may process multiple ranging channels, if any of the following
conditions exist:
When there are multiple receiver diversity antennas the code correlation
is performed separately for each antenna and then the correlation values
from each antenna are summed before performing code detection and
timing offset calculation, which improves the ranging performance.
Processing Bandwidth
For a single antenna or single channel configuration, the minimum period
of regular code correlations (for the purpose of bandwidth calculation) is
approximately given by the following equation:
155(n + 1)
Altera Corporation 11
Preliminary
WiMAX OFDMA Ranging
For example, a 200-MHz system clock and a 100-μs symbol period (203
clock cycles) allows 129 codes.
For example, the same 200-MHz clock but three antennas and two
ranging channels allows 129/( 3 × 2 ) = 21 codes.
You can use multiple ranging modules to increase the throughput, or take
advantage of the fact that, depending on the ranging type, not all symbols
are correlated.
Table 2 shows for each ranging type what percentage of symbols are
actually correlated.
Symbols Correlated
Ranging Type
Number %
Periodic or bandwidth over three symbols 3 in 3 100
Periodic or bandwidth over one symbol 1 in 3 33
Initial or handover over two symbols 2 in 3 66
Initial or handover over four symbols 4 in 6 66
For example, for periodic or bandwidth over one symbol with a 200-MHz
clock and a system where ranging symbols are fed in at the maximum
rate, it takes 155(n + 1) cycles to process the first symbol, but only 155
cycles each to process the second and third symbols.
So 155(n + 3) = 3 × 100/0.005 μs
so n = 384 codes
12 Altera Corporation
Preliminary
Algorithm Description
■ Perform ranging on one antenna only, but this option does not
exploit the additional diversity that is available
■ Perform ranging separately for each antenna, and sum correlation
output for all antennas:
● N ranging correlators and one ranging detection circuit
● Exploits additional diversity
● Simple interface to MAC layer (one detection measurement per
ranging channel)
● Ranging detection threshold may need to be modified
■ Perform ranging separately for each antenna and then process the
results from all the ranging blocks
● N ranging correlators and N ranging detection circuits
● Exploits additional diversity
● More complex interface to the MAC layer (multiple detection
measurement per ranging channel)
Solution Performance
This section describes the algorithm’s performance.
Modelling Conditions
Unless otherwise stated, the system simulation has the following settings:
Altera Corporation 13
Preliminary
WiMAX OFDMA Ranging
For modelling open issues, you can define the acceptable performance, by
considering the following points:
Performance in Noise
At a signal-to-noise ratio (SNR) of 2dB and above, false alarm rate and
probability of detection failure are both zero (ideal) in XXX observations.
Figure 4 shows the results for timing offset error. Here the timing offset is
never greater than ± 8 samples (approximately ± 77 ns, or ± 25% of the
worst case cyclic prefix of 1/32).
14 Altera Corporation
Preliminary
Algorithm Description
Altera Corporation 15
Preliminary
WiMAX OFDMA Ranging
16 Altera Corporation
Preliminary
Algorithm Description
Altera Corporation 17
Preliminary
WiMAX OFDMA Ranging
For a 128-point FFT in both noise and multipath, results show false alarm
rate and probability of detection failure are both zero (ideal) at a SNR of
2dB or greater. Figure 9 demonstrates the timing offset performance in a
SNR of 2dB and above. At a SNR of 9.4dB, the timing offset error is better
than 10-3 for an acceptable error of ± 1 sample (approximately ± 77 ns, or
± 25% of the worst case cyclic prefix of 1/32).
18 Altera Corporation
Preliminary
Hardware Description
Figure 9. Probability of Timing Errors in Noise & Multipath (FFT Size = 1,024)
Multicode Operation
Performance is generally acceptable (false alarm rate of zero) with a
single ranging code on the ranging channel. With multiple ranging codes
in contention on the ranging channel, the interference is increased and it
is more important to optimize for detection failure rate or false alarm rate.
In particular, there are the following tradeoffs between improving
detection failure rate and degrading false alarm rate.
■ How many users are expected on a single ranging channel for initial
or periodic ranging?
■ In initial ranging, users randomly select the ranging slot to use in
transmission. The resulting collisions that may occur reduce the
likelihood of code detection, as more interference is present
Description
Suitability to Altera FPGA Devices
This section outlines the main advantages of the FPGA devices that make
them an ideal platform for this type of design.
Altera Corporation 19
Preliminary
WiMAX OFDMA Ranging
20 Altera Corporation
Preliminary
Hardware Description
DSP
Block
Architecture
Figure 11 shows the block diagram for the WiMAX OFDMA reference
design.
Altera Corporation 21
Preliminary
WiMAX OFDMA Ranging
Input
Interface
Correlate
Generate
Code
Calculate
Power
Remove
Channel
z -1 Determine
Threshold
Correlation
Memory
Read Correlation
Results
CORDIC
22 Altera Corporation
Preliminary
Hardware Description
The reference design correlates the ranging channel data with a possible
ranging code and processes the resulting correlated data with the
following outcome:
The remaining part of the reference design, the backend, processes the
correlation data stored in this memory to detect the transmitted ranging
codes (if any), the timing offsets for the SS, and the correlated ranging
power. The results are output to the MAC layer.
Altera Corporation 23
Preliminary
WiMAX OFDMA Ranging
For each ranging channel input the mean power in the channel is
calculated and used to adjust the threshold value used to determine
whether the magnitude of the correlation value signifies a code detection
or not. This adaptive threshold, results in good ranging performance
under different SNR conditions.
Ranging Power
The ranging power output is the correlated power over the OFDMA
symbol that timing offset was calculated. If the timing offset was
calculated over more than one OFDMA symbol (as for
periodic/bandwidth ranging over three symbols and initial/handover
ranging over four symbols), the average power per symbol is output.
For multiple antennas, the power value represents the average power per
symbol over all antennas.
24 Altera Corporation
Preliminary
Hardware Description
The reference design arranges the memory into equal sized blocks. Each
block is dedicated to a specific ranging channel.
Each memory block stores all the correlation values for a ranging channel.
So if the ranging channel is an initial or handover channel, the block
stores correlation values for every initial and handover code. Otherwise,
the block stores the correlation values for every periodic and bandwidth
code. The size of a memory block is determined by which is the larger
number: (initial + handover) codes or (periodic + bandwidth) codes.
Each memory block is subdivided into two parts: the first holds the first
code group correlation values (either all initial or all periodic codes); the
second part holds the second group correlation values (either all
handover or all bandwidth codes). The sizes of the two blocks need not
be identical (see Figure 12). If the first code group has X codes and the
second code group has Y codes, the first X entries belong to the first code
group and the subsequent Y entries belong to the second code group.
Depending on whether the ranging channel is an initial/handover or
periodic/bandwidth one, the subdivision of the memory block may not
be at the same point if the code groups have different numbers of codes.
Altera Corporation 25
Preliminary
WiMAX OFDMA Ranging
correlation values are added up and stored in the first correlation location
and the second and fourth correlation values are stored in the second
correlation location.
The same memory is shared for all antennas. In fact the corresponding
correlation values for all antennas are summed and written to memory.
The use of multiple antennas results in improvement in performance of
the ranging algorithm as summing the correlation values results in
improved SNR.
When the ranging channel data has been clocked into the internal buffer
on the input interface of the reference design, it only starts correlation of
that data if the correlation memory reserved for that ranging channel is
empty—the backend of the reference design has processed and output
the results from the previous correlation values for this ranging channel).
As the reference design writes the code correlation values into the
correlation memory, the backend is informed on a per code basis, to allow
it to start processing the results as the front end is performing the next
code correlation. This operation leads to higher performance.
The output interface from the reference design has a buffer, set to default
size of two. If the downstream agent cannot accept the data, two results
are stored in this buffer before reading and processing of more correlation
values from the correlation memory is stalled. You can change this buffer
size.
Input Interface
The input interface consists of the following subinterfaces:
26 Altera Corporation
Preliminary
Hardware Description
Altera Corporation 27
Preliminary
WiMAX OFDMA Ranging
Note to Table 3:
(1) Must be stable before you release the reference design from reset.
The symbol offset, ranging type, ranging channel number, and starting
slot number of first subchannel of ranging channel in symbol 0 are
sampled by the reference design only when both sink_valid and
sink_sop are high. These signals apply to the entire ranging channel
and so need only be sampled once.
28 Altera Corporation
Preliminary
Hardware Description
The data bus interface follows a simple bus protocol. It can accept data
samples on consecutive clock cycles.
clk_i
rst_n_i
sink_ready_i
sink_sop_i
sink_eop_i
sink_valid_i
sink_i_i
sink_q_i
sink_channel_num_i 0
sink_slot_num_i
sink_ranging_type_i 2
sink_symbol_offset_i 1
ip_sample_cnt 1 2 3 4 5 6 7
Altera Corporation 29
Preliminary
WiMAX OFDMA Ranging
clk_i
rst_n_i
sink_ready_i
sink_sop_i
sink_eop_i
sink_valid_i
sink_i_i
sink_q_i
sink_channel_num_i
sink_slot_num_i
sink_ranging_type_i
sink_symbol_offset_i 1 2
ip_sample_cnt 90 91 92 93 94 95 96 1
You must hold the reference design in reset until all the code
configuration inputs (cgen_xxx) are at their correct values.
30 Altera Corporation
Preliminary
Hardware Description
When you release it from reset, the reference design takes approximately
37,000 cycles to initialize (~ 256 × 144). During this time sink_ready
remains low such that no data is accepted at the data bus input interface.
Altera Corporation 31
Preliminary
WiMAX OFDMA Ranging
■ max_pos_timeoffset
■ max_neg_timeoffset
■ margin_pos_timeoffset
■ margin_neg_timeoffset
These parameters only take effect for timing delays greater than
FFT size/2 and less than –(FFT size/2).
Thus, they are not applicable to periodic and bandwidth ranging where
the delays are small.
For initial/handover ranging, the code detection results over the two
symbols determine whether the timing offset is actually less than
–FFT size/2 or greater than FFT size/2. If so, the raw timing offset value
is shifted by the FFT size.
Under severe noise or fading channel conditions the timing offset may be
incorrectly shifted by the FFT size, which result in a large timing error.
This effect can happen when a code detection value for one of the
correlation values is incorrect.
If you know that the maximum possible timing offset of a SS is less than
the FFT size (you should know cell site area and propagation
characteristics), by adjusting the values of max_pos_timeoffset and
max_neg_timeoffset accordingly, the performance of the system
improves.
The reference design ensures that only those values are shifted by the FFT
size that do not result in a final timing offset that exceeds the maximum
delays possible. Hence, the closer the maximum possible delays are to
FFT size/2, the better the performance is.
Due to noise and fading channel conditions, the timing offset value
calculated may differ by a small amount to the actual timing offset of the
SS. By setting the margin_pos_timeoffset and
margin_neg_timeoffset values to be non-zero, the window of timing
samples that are shifted by the FFT size is increased. Any timing samples
that appear in this window, can result in a delay greater or less than the
FFT size. Instead these timing values are saturated to either the maximum
or minimum possible timing offsets (max_pos_timeoffset or
max_neg_timeoffset). With the timing offset value and saturation
flag output is an output to indicate whether this saturation has taken
place. Using this margin window improves performance of the
algorithm.
32 Altera Corporation
Preliminary
Hardware Description
These inputs are static after initialization and should be set up before you
feed the first ranging channel data into the reference design.
Adaptive Thresholds
In the algorithm, a correlation value is calculated for each ranging code
correlation with the ranging channel input data. The result is compared
to a threshold value derived from correlation_threshold_in. If it is
greater than the threshold, this signifies a code detection.
The reference design calculates the total power in the ranging channel in
a symbol.
Multiple Antennas
Also, for multiple antennas, the power mentioned above is the power
across all antennas.
Altera Corporation 33
Preliminary
WiMAX OFDMA Ranging
Output Interface
Table 7 lists the output interface signals.
All signals other than source_data and source_type are single bit
wide.
34 Altera Corporation
Preliminary
Hardware Description
clk_i
data_ready
rdata_i
rdata_type_i 4 0 1 2 3 4
rdata_valid_i
rdata_sop_i
rdata_eop_i
rchan_no_op 0
rslot_no_op
rcode_no_op
rtimeoff_op
rpwr_op
Altera Corporation 35
Preliminary
WiMAX OFDMA Ranging
The first data for a new packet is signified by a high on source_sop. The
source_type signal provides information on the data contained in
source_data on the same clock cycle (see Table 4 on page 28). In this
example, source_type transitions from 0 to 1 to 2 to 3 to 4. The
downstream agent should accept source_types in any order. The
transition occur on consecutive clock cycles and correspond to data on the
source_data bus of ranging channel number (0), then ranging slot
number (1647), then ranging code number (12), then time offset (–30),
then ranging power (159).
The downstream agent must only consider the reference design output
signals (source_data, source_sop, source_eop, source_type)
valid if source_valid is high on the same rising clock edge.
All source_data values are unsigned with the exception of time offset,
which is signed.
36 Altera Corporation
Preliminary
Hardware Description
Parameters
The following two VHDL packages define the reference design
parameters:
Parameters in range_io_pkg.vhd
The following parameters are available in range_io_pkg.vhd:
■ Ranging Type
■ FFT Size
■ Cyclic Prefix Length
■ Symbol Offset
■ Slot Number Bit Width
■ Ranging Channel—Number Bit Width
■ Ranging Channel—Number of Ranging Channels
■ Multiple Antennas
■ Power Bit Width
■ Timing Offset Bit Width
■ Output Data Bus Width
■ Output Data Type Bus Width
■ Output Data Type Values
■ Ranging Code Generator Outputs
■ Information on Signal Number Representations
■ Definitions for RTL Testbench
Ranging Type
The ranging type has the following constants:
constant ranging_type_INITIAL_OR_HANDOVER_OVER_2_SYMBOLS :
std_logic_vector(1 downto 0) := "00";
constant ranging_type_INITIAL_OR_HANDOVER_OVER_4_SYMBOLS :
std_logic_vector(1 downto 0) := "01";
constant ranging_type_PERIODIC_OR_BANDWIDTH_OVER_1_SYMBOL :
std_logic_vector(1 downto 0) := "10";
Altera Corporation 37
Preliminary
WiMAX OFDMA Ranging
constant ranging_type_PERIODIC_OR_BANDWIDTH_OVER_3_SYMBOLS :
std_logic_vector(1 downto 0) := "11";
These constants provide the codes that define the following four ranging
types:
FFT Size
The FFT size has the following constants:
These constants provide the two-bit codes that define which FFT size you
are using (128, 512, 1,024, or 2,048).
38 Altera Corporation
Preliminary
Hardware Description
Symbol Offset
The symbol offset has the following constants:
These constants define the symbol offset within the group of three
consecutive symbols (it takes values 0, 1, and 2). In the uplink, the
symbols are processed in groups of three consecutive symbols. The
reference design needs to know which of the three symbols the ranging
channel data is from, as it influences how it processes the data.
This constant gives the bit width of signals that hold the slot number.
This constant gives the input bit width of the real and imaginary parts of
the data.
Altera Corporation 39
Preliminary
WiMAX OFDMA Ranging
The first constant defines the bit width that represents the maximum
number of ranging channels – 1 in binary, with a minimum bit width of 1.
The second constant defines the bit width that represents the maximum
number of ranging channels – 1 in binary with a minimum bit width of 0
(when there is only one ranging channel).
Multiple Antennas
Multiple antennas have the following constants:
The first constant defines the total number of antennas and is the bit
width to represent 0 to (NUM_ANTS – 1) for one antenna.
The second and third constants define represent the number of bits
required to represent the antenna number and is the bit width to
represent 0 to (NUM_ANTS – 1) for 1 antenna.
In the second constant, the last define can take the value 0, if there is only
1 antenna; in the third constant the define has a minimum value of 1.
40 Altera Corporation
Preliminary
Hardware Description
This constant represents the number of bits to represent the power in the
correlated ranging code.
This constant represents the number of bits for the output data bus. The
output data bus sends out power information, timing offset values, slot
numbers, ranging channel number, and type on different clock cycles.
Thus, the width of the data bus must be the maximum of the width of
these signals:
This constant represents the number of bits (3) to represent the output
field that describes what type of data is output on the output data bus
(source_data).
Altera Corporation 41
Preliminary
WiMAX OFDMA Ranging
These constants define the different values possible on the output bus,
source_type, and describe what type of data is being output on
source_data. They describe whether the data is ranging channel
information, slot number, ranging code number, timing offset value, or
power for correlated ranging code.
In the constant name _FRAC_ refers to a constant that defines the number
of fractional bits in the number.
In the constant name, _INT_ refers to a constant that defines the number
of integer bits.
Generally, most numbers are assumed to be signed even if they can never
be negative. Thus, the top integer bit is the sign bit.
42 Altera Corporation
Preliminary
Hardware Description
The ranging channel power input for each symbol has the following
constants:
The full precision output from accumulator of correlation values has the
following constants:
The CORDIC cartesian inputs and magnitude output have the following
constants:
The adaptive threshold full precision value has the following constants:
Altera Corporation 43
Preliminary
WiMAX OFDMA Ranging
The adaptive threshold truncated and saturated precision value has the
following constants:
The field codes to define the sideband signal type in the text files have the
following constants:
The RTL testbench requires these constants that define the following
conditions:
44 Altera Corporation
Preliminary
Hardware Description
Parameters in range_pkg.vhd
The following parameters are available in range_pkg.vhd:
■ Round to nearest
■ Round towards infinity
■ Round towards negative infinity
■ Round towards zero
Rounding Mode
The rounding mode has the following constants:
Altera Corporation 45
Preliminary
WiMAX OFDMA Ranging
The first constant defines the rounding mode that the reference design
uses in its front end; the second constant defines the rounding mode that
the reference design uses in its back end.
Correlation Value
The correlation value has the following constants:
The last constant defines the final bit width of the correlation result
written to memory. The result is a 32-bit wide real and 32-bit wide
imaginary number. The first two constants define which bits to truncate
and at which MSB point to perform saturation on the full precision
correlation result, to arrive at the final bit.
The bit width to represent 0 to the maximum number of codes – 1 has the
following constant:
Assume this number is N. The first constant defines the number of bits
required to represent N in binary. The second constant defines the
number of bits required to represent (N – 1) in binary.
46 Altera Corporation
Preliminary
Hardware Description
The second constant defines the actual address bus width for the
correlation memory and is different to the first constant because there is
only one ranging channel—the top address bit is not actually required.
The first constant defines the address bus width defined by concatenating
the constitute signals together (ranging channel number and number of
codes). The +1 indicates that there are two correlation values per code—
the width of the concatenated signal that forms the read address. This
constant be may equal to the second constant or greater by one. Where
there is only one ranging channel the two constants differ by 1.
CORDIC
The number of bits to represent the phase from the output of the CORDIC
has the following constant:
The number of fractional bits in the correlation values read from the
correlation memory has the following constant:
Altera Corporation 47
Preliminary
WiMAX OFDMA Ranging
The bit number when you read the correlation value read from the
memory (how many bits to truncate) has the following constant:
The number of bits the magnitude output from CORDIC must be reduced
to the following constant:
To construct the power value, this constant defines the bit number in the
correlation magnitude that comes out of the CORDIC, from which you
start extracting bits.
This constant represents the number of bits to represent the power in the
ranging channel in one OFDMA symbol.
Adaptive Threshold
The adaptive threshold has the following constants:
The first constant defines how many MSBs to remove; the second how
many least significant bits (LSBs) to remove.
48 Altera Corporation
Preliminary
Testbench
The reference design need the constants for the timing calculation from
the CORDIC’s phase output. The following equation represents the
constant:
The word width for buffer in output Avalon streaming interface has the
following constant:
The latency from writing data to reading it has the following constant:
■ The address width to access this buffer (and hence the depth of
buffer: A2_OPMEM_ADDR_WIDTH
■ The data width of this buffer: A2_OPMEM_DWIDTH
■ The latency between writing data to the buffer and reading the same
location: A2_OPMEM_WRTRD_LAT
Altera Corporation 49
Preliminary
WiMAX OFDMA Ranging
■ Compares the output from the ranging RTL module to the data
contained in the
\wimax_ofdma\source\rtl\ul_rx\ranging_ap\data\exp_op_data
_.txt file
You can generate the input and expected output data (see “Input &
Output Data File Formats” on page 50) or use one of the 33 Altera-
provided data files (see “Input & Output Data File Formats” on page 50).
■ Understand the content of the data files that Altera provides with
this reference design
■ Generate your own data files for use with the RTL testbench
50 Altera Corporation
Preliminary
Testbench
Block 0
Sub-block 1
Sub-block 2
Sub-block 3
Block 1
Sub-block 1
Sub-block 2
Sub-block 3
...
Block N - 1
Sub-block 1
Sub-block 2
Sub-block 3
The first line contains a single number N, which indicates the number of
blocks in the file. If N = 0, the number of blocks in the file is unknown or
not calculated and you can ignore it. The testbench ignores this field,
regardless of its value. However, you must set this field to 0 if the number
of blocks in the file is not known.
After the first line, each block of data follows. Each block comprises 3
subblocks. Figure 16 shows the structure of each block in more detail. The
first line in each block contains a single number that indicates the number
of subblocks in this current block, which should always be 3.
Altera Corporation 51
Preliminary
WiMAX OFDMA Ranging
The next line contains a single number that indicates the number of
entries in subblock 1, which should always be 1. The following line
contains a single number that is the value of the entry for subblock 1.
Subblock 1 only contains a block number ID, given by this value.
The next line contains a single number that indicates the number of
entries in subblock 2. Subblock 2 contains all sideband signal and
configuration information. The number of entries in this subblock varies
depending on which file is being referred to. Assuming it has 12 entries,
the next 12 lines in the files contain the sideband signal and configuration
information.
The next line contains a single number, m, that indicates the number of
entries in subblock 3. The next m lines contain information on the data
signal values.
...
...
52 Altera Corporation
Preliminary
Testbench
14
11 1
12 3
13 256
14 319
0 0
1 2
2 2604
3 1
4 0
5 8
6 9
7 0
8 4
9 1
The first line contains 14, which means there are 14 entries in subblock 2.
The next 14 lines contain the sideband signal and configuration
information. There are two numbers on each line. The first number is a
code that indicates which sideband signal or configuration information is
referred to. The second number gives the value for this sideband signal or
configuration information. Table 9 shows the subblock 2 field codes with
the different sideband codes and which files can contain these values.
Altera Corporation 53
Preliminary
WiMAX OFDMA Ranging
Note to Table 9:
(1) Not required for the testbench.
144
17388 23877
21709 19399
16389 28867
6923 26390
-14143 -9200
-13723 -17297
13323 17627
12076 17699
54 Altera Corporation
Preliminary
Testbench
.............
The first line contains the number of data samples in a ranging channel,
which is 144 for this example. This value can be either 144 or 96 (when the
FFT size is 128). The next 144 (or 96) lines contain the ranging channel
data. Each line contains two numbers: the first is the real part of the
sample; the second is the imaginary part. The samples are ordered from
the lowest numbered subcarrier of the lowest numbered subchannel that
comprises a ranging channel to the highest numbered subcarrier of the
highest numbered subchannel of the ranging channel.
The possible dynamic range of the numbers must match the bit width for
the input data setup in the RTL (in one of the VHDL package files).
1
-26 0123 0
The first line always contains the number 1, as there is only one entry for
this subblock. The next line gives the value for the entry. It contains three
numbers, –26, 123, and 0. The first number represents the timing offset
value, which the reference design calculates; the second, the correlated
received ranging power for the SS transmitting with this timing offset; the
third indicates whether the timing offset was saturated (= 1) to maximum
or minimum timing offset value.
■ ip_data_per_1sym_i1p1b1h1_fft2048_EbNo3_fadch1_simid9.txt
■ exp_op_dataper_1sym_i1p1b1h1_fft2048_EbNo3_fadch1_simid9.txt
■ range_io_pkg_simid9.vhd
■ range_pkg_simid9.vhd
Altera Corporation 55
Preliminary
WiMAX OFDMA Ranging
Table 10 shows the parameters for the following input and output data
file names:
Getting Started This section describes the following WiMAX OFDMA ranging reference
design topics:
56 Altera Corporation
Preliminary
Getting Started
■ System Requirements
■ Install the Reference Design
■ System Requirements
■ System Requirements
System Requirements
The reference design requires the following hardware and software:
Altera Corporation 57
Preliminary
WiMAX OFDMA Ranging
cordic
Contains the Altera CORDIC reference design.
wimax_ofdma
Contains the WiMAX ranging reference design files.
source
Contains the source files.
rtl
Contains the RTL files.
common
Contains common files for other Altera WiMAX reference designs.
ul_rx
Contains uplink receiver files.
ranging_ap
Contains the ranging access point files.
ranging_ap
Contains the ranging access point files.
build
Contains the ranging access point build files.
data
Contains the testbench data files.
doc
Contains the documentation.
scripts
Contains the ModelSim simulation scripts.
sim
Contains the simulation files.
source
Contains the source files (again). Contains the
ranging_ap.vhd top-level file.
cdetect_timeoffset
Contains the code detect timing offset files.
ip
Contains the IP for the ranging access point files.
op_mem
Contains the memory IP.
phase_mult
Contains the phase multiplier IP.
correlation
Contains the correlation blocks.
tb
Contains the testbench files.
58 Altera Corporation
Preliminary
Getting Started
1 The CORDIC source files are in Verilog HDL; the design RTL
files are all in VHDL.
\rtl\ul_rx\ranging_ap\tb
ranging_ap_tb.vhd RTL testbench.
\rtl\ul_rx\ranging_ap\scripts
ranging_ap.tcl ModelSim simulation Tcl script.
ranging_ap_batch_msim.pl Pearl batch file for ModelSim simulations.
ranging_ap_wave.do ModelSim waveform file.
ranging_ap_quartus.tcl Quartus II synthesis Tcl script.
Run Simulation
Because the CORDIC reference design files are in Verilog HDL and all
other RTL files are in VHDL, you require a mixed language license for the
ModelSim simulator.
\wimax_ofdma\source\rtl\ul_rx\ranging_ap\data\ip_data.txt
\wimax_ofdma\source\rtl\ul_rx\ranging_ap\data\exp_op_data
.txt
\wimax_ofdma\source\rtl\common\range_io_pkg.vhd
Altera Corporation 59
Preliminary
WiMAX OFDMA Ranging
\source\rtl\ul_rx\ranging_ap\source\range_pkg.vhd
The files compile and a waveform viewer appears that lists the main
signals. The simulation automatically runs through to completion.
■ Copies the input and expected output data files and VHDL package
files to the correct name and locations for the simulation
■ Invokes the ModelSim simulator and executes the range_ap.tcl Tcl
script
■ Copies and renames the simulation-generated output files to give a
unique version for each simulation run
60 Altera Corporation
Preliminary
Getting Started
\wimax_ofdma\source\rtl\ul_rx\ranging_ap\scripts
ranging_ap_batch_msim.pl
The Command Prompt indicates useful log messages that show which
test files the simulation is copying, and how it renames the output files.
Synthesis
Altera provides a Tcl script that allows the RTL to be synthesized using
the Quartus II software.
\wimax_ofdma\source\rtl\ul_rx\ranging_ap\scripts
4. In the Tcl console execute the synthesis Tcl script by typing the
following command, which creates a Quartus II project for design in
directory \wimax_ofdma\source\rtl\ul_rx\ranging_ap\build:
source ranging_ap_quartus.tcl
Altera Corporation 61
Preliminary
WiMAX OFDMA Ranging
Copyright © 2006 Altera Corporation. All rights reserved. Altera, The Programmable Solutions Company,
the stylized Altera logo, specific device designations, and all other words and logos that are identified as
trademarks and/or service marks are, unless noted otherwise, the trademarks and service marks of Altera
Corporation in the U.S. and other countries. All other product or service names are the property of their re-
spective holders. Altera products are protected under numerous U.S. and foreign patents and pending
101 Innovation Drive applications, maskwork rights, and copyrights. Altera warrants performance of its semiconductor products
San Jose, CA 95134 to current specifications in accordance with Altera's standard warranty, but reserves the right to make chang-
(408) 544-7000 es to any products and services at any time without notice. Altera assumes no responsibility or liability
arising out of the application or use of any information, product, or service described
www.altera.com herein except as expressly agreed to in writing by Altera Corporation. Altera customers
Applications Hotline: are advised to obtain the latest version of device specifications before relying on any pub-
(800) 800-EPLD lished information and before placing orders for products or services.
Literature Services:
literature@altera.com
62 Altera Corporation
Preliminary