sdr test bench architecture

33
SDR Test bench Architecture WINLAB – Rutgers University Date : October 15 2009 Authors : Prasanthi Maddala, [email protected] Khanh Le, [email protected]

Upload: rahim-koch

Post on 02-Jan-2016

32 views

Category:

Documents


0 download

DESCRIPTION

SDR Test bench Architecture. WINLAB – Rutgers University Date : October 15 2009 Authors : Prasanthi Maddala, [email protected] Khanh Le, [email protected]. SDR platform – V1.0. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: SDR  Test bench Architecture

SDR Test bench Architecture

WINLAB – Rutgers University

Date : October 15 2009

Authors :

Prasanthi Maddala, [email protected]

Khanh Le, [email protected]

Page 2: SDR  Test bench Architecture

SDR Test Bench 2

SDR platform – V1.0

• The Figure above shows the first version of SDR platform and this document describes a test bench being developed for it.

Page 3: SDR  Test bench Architecture

SDR Test Bench

SDR Test Bench 3

• This Figure shows a test bench for an SDR design.• The test bench could contain different drivers and monitors controlled by the simulation manager as shown in the figure, depending on the design under test.• Our current version of test bench provides an Ethernet driver, a DiBo SPI monitor, a WiBo control monitor, and a simulation manager that interacts with these blocks.

Page 4: SDR  Test bench Architecture

SDR Test Bench 4

Ethernet Driver

• Ethernet driver emulates the Ethernet receive PHY.

Page 5: SDR  Test bench Architecture

SDR Test Bench 5

Ethernet Driver

• On receiving a signal from the simulation manager along with the data to be sent, Etherner driver sends data to the receive Ethernet interface in the SDR design. • It can be either set to 100 Mbps or 1Gbps through the generic DATA_RATE• It can also add Ethernet and IP headers, or Ethernet header alone (depending on the signal add_hdr), before sending out data to the design under test.

Page 6: SDR  Test bench Architecture

SDR Test Bench 6

Ethernet Driver – SDR Design Interface

Signal Name In/Out Width Description

eth_data_valid Out 1 Active High. Indicates that the data on eth_data port is valid.

eth_error Out 1

eth_data Out 8 Ethernet frame data that comes from Ethernet PHY module on the board. For an Ethernet link at 100Mbps only eth_data[3:0] is valid. If it is a 1Gbps link all the 8 bits are valid.

Page 7: SDR  Test bench Architecture

Ethernet Driver – Simulation Manager Interface

Signal Name In/Out Width Description

Cmd_en In 1 Active High. Sync signal for the cmd and param signals.

Cmd[7:0] In 8 Command code from the simulation manager, explained in next slide.

Param[7:0] In 8 Parameter word sent along with a command. Explained in next slide.

src_mac_addr[47:0] In 48 Source MAC address

dest_mac_addr[47:0] In 48 Destination MAC address

src_ip_addr[31:0] In 24 Source IP address

dest_ip_addr[31:0] In 24 Destination IP address

data[0 to 1521][7:0] In (1522)(8) Ethernet data to be sent to the SDR design

data_size In 11 Size of the Ethernet data to be sent – i.e., only the data size no.of bytes of the above data port are valid for a given frame

eth_frame_sent Out 1 Active High. Signal indicating that a frame has been sent.

7SDR Test Bench

Page 8: SDR  Test bench Architecture

SDR Test Bench 8

Ethernet Driver – Commands

Command Command Code

Parameters Description

send_frame 00000001 Param[1:0] – add_hdr

indicates whether the Ethernet driver has to add headers before sending out data

00 - no need of adding headers

01 - Add Ethernet header only

10, 11 - Add both Ethernet and IP headers

Send ethernet frame to the SDR design.

Page 9: SDR  Test bench Architecture

SDR Test Bench 9

Monitors

Monitors provided in this design are• DiBo SPI Monitor• WiBo Control Monitor which consists of

1. WiBo SPI Monitor2. U2 Monitor3. Antenna Switch Monitor - Antenna Switches are treated as a register by

introducing a dummy ant_sw_sync signal which is used only for simulation purposes.

Each of the above is used to monitor a set of registers (SPI registers, u2 , antenna switches) and they use a common block called the register monitor. Register monitor keeps a record of register contents and register write operations with the help of text files. It can also take various commands from the simulation manager, such as comparing all the register contents with the values given in a text file, comparing a particular register value etc., and send a response back to the simulation manager.

Following slides explain the register monitor first, and then discuss how each of the above monitors uses the register monitor to perform the required function.

Page 10: SDR  Test bench Architecture

SDR Test Bench 10

Register Monitor

Page 11: SDR  Test bench Architecture

SDR Test Bench 11

Register Monitor – Register read/write interface

Signal Name In/Out Width Description

reg_req In 1 Active high, request to read or write to a register

reg_rdnwr In 1 1 – register read request

0 – register write request

reg_no In ADDR_WIDTH (Generic)

Address of the register to be read or written to.

reg_wr_data In DATA_WIDTH (Generic)

Data to be written into the register with address reg_no

reg_rd_data Out DATA_WIDTH (Generic)

Requested register data

Page 12: SDR  Test bench Architecture

SDR Test Bench 12

Register Monitor – Simulation Manager Interface

Signal Name In/Out Width Description

Cmd In 8 Coded command sent by the simulation manager. Explained in next slide

Param In 32 Contents of the param word are interpreted according to the command code. Explained in next silde.Currently the param word is being used as follows

Param[7:0] - register number

Param[31:8] – register data

• With command 00000001 – compare next register write, the register monitor checks if the next write is being made to the register number given in the param word and if the register write data is equal to that given in the param word.

•With command 00000010 – compare current register contents, the register monitor checks if the data in the register param[7:0] is same as param[31:8]

Golden_file_name In String File name of the new golden file. Before the simulation manager sends a compare files command(00000011), it can send an update golden file command(10000000) to change to golden file. Along with that command it sends the new golden_file_name.

Cmd_pass In DATA_WIDTH (Generic)

Active High, indicating that the command was successfully completed. In case of compare commands it means that there isa match.

Cmd_fail Out DATA_WIDTH (Generic)

Active High, indicates that the command has failed. Reason for the failure is given in the cmd_file_tag

Cmd_fail_tag Out 4 0001 - Bad command 0010 - Bad Param 0011 - Can’t open file 1000- Register content mismatch (file or single register)

Page 13: SDR  Test bench Architecture

SDR Test Bench 13

Register Monitor – Commands

Command Command Code

Parameters Description

chk_next_wr 00000001 Param[7:0] – register address

Param[31:8] – register data

the register monitor checks if the next write is being made to the register number given in the param word and if the register write data is equal to that given in the param word.

chk_reg_con 00000010 Param[7:0] – register address

Param[31:8] – register data

compare current register contents, the register monitor checks if the data in the register param[7:0] is same as param[31:8]

cmp_file 00000011 Not used compare register content file with the golden file

cnt_wr 00000100 Param[31 :0] – number of write operations

Count the number of write operations from the time the command has been sent ,and send a response cmd_pass once the count is equal to that in the param word.

update_file 10000000 Not used Update the golden file. File name is given as an input string(golden_file_name)

Page 14: SDR  Test bench Architecture

SDR Test Bench 14

Register Monitor – Files

•Register Log File – The register monitor logs all its read/write operations in the this file. A register log file can look as follows

No Rd/Wr Register No Register Data*************************************************************************************1 Read 0 000100102 Write 0 00011110 4 Write 4 01010101

•Register Content File – Register monitor keeps a record of the register contents in this file.The initial contents are by default all 0s, but they can be non-zero too. Every write operation results in updating this file and for every read operation, register data is fetched from this file. It can look as follows

Register No Register Data************************************************************ 0 01101000 1 00000000 2 01010000

•Error File - Read/write errors(Ex: Invalid register no, read not supported ), command failures are logged in the error file. The error file may look like this Operation Number Error********************************************************************************* Read 3 Invalid register no : 68 sim_mgr cmd 2 Bad Command code 00011111

Page 15: SDR  Test bench Architecture

SDR Test Bench 15

SPI Monitor

An SPI monitor consists of an SPI emulator and a register monitor.• SPI emulator interprets the SPI input signals and performs register read/write operations.•Write operation corresponds to sending an update to the register update monitor, with the register address and data information.•Read operation corresponds to fetching register data from the register monitor, and sending out the data bits serially.• SPI emulator architecture depends on the actual chip that is being used (Ex MAX 2829 or AD9862). Though they have a standard 3 or 4-wire SPI interface, read/write operations are performed in a different way in each of the chips.

Page 16: SDR  Test bench Architecture

SDR Test Bench 16

DiBo SPI Monitor

• DiBo SPI monitor emulates the SPI interface and registers of AD9862.

Page 17: SDR  Test bench Architecture

SDR Test Bench 17

Signal Name In/Out Width Description

sen In 1 Active low , used to gate read and write operations. When sen is high, sdio and sdo are three-stated.

sclk In 1 clk used to synchronize SPI reads/writes. (Maximumbit rate -16 MHz).A register update is sent after the 16th rising clock edge (and 24th rising clock edge for the dual byte case). Incomplete read/write operations are ignored.

sdio Inout 1 Serial bidirectional line used by default as input to write to the SPI registers. Used as an output for read operations in 3-wire mode. SDIO BiDir register( Register 0 Bit 7) is used to configure the SPI interface in 3-wire or 4-wire mode

sdo Out 1 Default output for read operations. (4-wire mode)

DiBo SPI Monitor – SDR Design Interface

Page 18: SDR  Test bench Architecture

SDR Test Bench 18

WiBo Control Monitor

• WiBo control monitor emulates the following- U2 – the shift register MM74HC595- SPI interface and registers on MAX2829- Antenna Switches U3, U4, U5

Page 19: SDR  Test bench Architecture

SDR Test Bench 19

WiBo Control Monitor

Page 20: SDR  Test bench Architecture

SDR Test Bench 20

WiBo SPI Monitor

• WiBo SPI emulator emulates the SPI interface and registers of MAX2829. • MAX2829 SPI is a 3-wire interface which does not support read operations.• It has 13 registers which are 14 bit wide as opposed to 64, 8 bit registers in AD9862.• Also, MAX2829 does not support dual word write operations as AD9862.•With these and other differences in operation, though the same interface is maintained (with sdo floating – three stated always) for WiBo spi monitor, its architecture is completely different.

Page 21: SDR  Test bench Architecture

SDR Test Bench 21

Signal Name In/Out Width Description

sen In 1 Active low. This signal is connected to cs(bar) of the SPI interface of MAX2829. It indicates that the clock is active. A register update is sent when wibo_sen transitions high. Only the last 18 bits shifted in are retained,and no check is made on the number of clock pulses.

sclk In 1 Clk used to synchronize SPI writes. (Maximumbit rate -16 MHz). Data is shifted on the rising edge.This is also connected to the shift clock (sck) of U2.

sdio Inout 1 Though this is an inout port, the wibo spi emulator uses it only as an input port for receiving serial data

sdo Out 1 This pin is not used by the wibo spi emulator. It is always tristated.

WiBo SPI Monitor – SDR Design Interface

Page 22: SDR  Test bench Architecture

SDR Test Bench 22

WiBo SPI Emulator – Register Monitor Interface

Signal Name In/Out Width Description

reg_req In 1 Active high, request to write to a register

reg_rdnwr In 1 1 – register read request

0 – register write request

For WiBo SPI emulator , it is always 0.

reg_no In 4 Address of the register to be written to.

reg_wr_data In 14 Data to be written into the register with address reg_no

reg_rd_data Out 14 Though this port exists , it is never used by the WiBo SPI emulator

Page 23: SDR  Test bench Architecture

SDR Test Bench 23

U2 Monitor

Page 24: SDR  Test bench Architecture

SDR Test Bench 24

U2 Monitor – SDR Design Interface

Signal Name In/Out Width Description

U2_sen In 1 This is connected to the storage clock (rck) of U2. On a rising edge of this clock, data in the shift register is transferred to the storage register i.e., to the output linesof U2.

sclk In 1 Clock used for the shift register (sck). Data is shifted on the rising edge. This is a shared port between u2 and WiBo SPI (sclk)

sdata In 1 Serial data shifted into the register.

This is a shared port between u2 and WiBo SPI(sdio)

Page 25: SDR  Test bench Architecture

SDR Test Bench 25

U2 Emulator – Register Monitor Interface

Signal Name In/Out Width Description

reg_req In 1 Active high, request to write to U2

reg_rdnwr In 1 1 – register read request

0 – register write request

For U2 emulator , it is always 0.

reg_no In 1 Since there is only 1 register, the register number is always given as 0.

reg_wr_data In 8 Data to be written to U2

reg_rd_data Out 8 Though this port exists , it is never used by the u2 emulator.

Page 26: SDR  Test bench Architecture

SDR Test Bench 26

Antenna Switch Monitor

Page 27: SDR  Test bench Architecture

SDR Test Bench 27

Signal Name In/Out Width Description

radio_sync In 1 Active High. Indicates that the data on the radio_iox pins is valid.

radio_io5 In 1 This signal is used to turn on U3 – tx antenna switch. When it is on, the switch is crossed giving 2.4GHz output to A03 and 5.6 GHz output to A04.

radio_io6 In 1 This signal is used to turn on U4 – rx antenna switch. When it is on, the switch is crossed, routing antenna A02 output to 2.4GHz input of MAX2829 and A01 output to 5.6GHz input of MAX2829.

radio_io7 In 1 A spare signal that could be used to control the antenna switches.

Antenna Switch Monitor – SDR Design Interface

Page 28: SDR  Test bench Architecture

SDR Test Bench 28

Antenna Switch Emulator – Register Monitor Interface

Signal Name In/Out Width Description

reg_req In 1 Active high, request to write to the antenna switches

reg_rdnwr In 1 For antenna switch emulator this is always 0

reg_no In 1 Since there is only 1 register, the register number is always given as 0.

reg_wr_data In 3 Data to be written to the antenna switches

reg_rd_data Out 8 Though this port exists , it is never used by the antenna switch emulator

Page 29: SDR  Test bench Architecture

Simulation Manager

SDR Test Bench 29

Page 30: SDR  Test bench Architecture

SDR Test Bench 30

• Simulation manager shown in the figure, has an interface that is defined to interact with Ethernet driver, DiBo SPI monitor, and WiBo control monitor.• This interface has to be modified if any more blocks like Ethernet monitor, RS232 driver etc., are added to the test bench• For a given interface, the simulation manager can have different architectures.• Ex: 2 designs that can be tested with this simulation manager

- test_v5lx_top.vhd - ocrp_top.vhd

these designs can have different architectures for the simulation manager.

Simulation Manager

Page 31: SDR  Test bench Architecture

SDR Test Bench 31

Simulation Manager – Architecture for OCRP

OCRP is designed such that all control is through Ethernet only i.e., SPI register writes, U2 and antenna switch updates can be done only through control commands sent over Ethernet. The simulation manager for OCRP does the following 1)takes an Ethernet command file and sends commands to the Ethernet driver.2)After sending all the Ethernet frames, it sends a file compare command to all the monitors along with appropriate golden files.3)Once it receives responses from the monitors, it reports them to the report file.

Page 32: SDR  Test bench Architecture

SDR Test Bench 32

Ethernet Command File• Contains a list of command file names and the properties associated with these files. These properties can vary with the simulation manager (sim_mgr)architecture.For OCRP, the following file format may be followed

Command Type Add Ethernet Header Add IP header File Name **************************************************************************************************** Cntrl Yes Yes wibo_freq_2_437.txt Cntrl Yes Yes set_rx.txt Data No No mod_data.txt

• The test bench top file (tb_top.vhd) is instantiated with its ETH_CMD_FILE generic set to the Ethernet command file name. This is then passed down to the sim_mgr.• The sim_mgr reads data from each of the files in the list into an array of bytes and sends it to the ethernet driver along with a command and a param word.

Report File• The simulation manager logs all the commands that it sends and the responses obtained in this file. A report file may look as follows*********************************************************************************************Ethernet driver command sent*********************************************************************************************Check next update command sent to DiBo Monitor*********************************************************************************************DiBo command pass

Error File• The simulation manager reports any errors in simulation, by writing to this file…

Simulation Manager – Files for OCRP

Page 33: SDR  Test bench Architecture

SDR Test Bench 33

Simulation Manager – Architecture for test_v5lx_top.vhd

•Test_v5lx_top is the first SDR design, developed to test the SDR platform (v1.0). •This design does not take any data commands. It takes control commands with a fixed length – •Though WiBo and DiBo can be controlled through Ethernet, initial controls are sent by the design itself.•Whenever the design receives a control command, it updates all the registers on both DiBo and WiBo.

So, the simulation manager for test_v5lx_top does the following1) takes an Ethernet command file and drives the Ethernet driver. The Ethernet command file looks similar to that of OCRP, except that the command type field is not used.2) Waits for the first set of register updates before sending the first command to the Ethernet driver.3) After sending a command to the Ethernet driver, it waits for another set of register updates before sending the next command.