Uart2bus Verification Plan
Uart2bus Verification Plan
UART2BUS
Verificaiton Plan Opencores.com
Release in 26. June 2017
Hany Salah
VLSI Verification Engineer
Table of Contents
1 About the Document..........................................................................................................................1
Description.......................................................................................................................................1
References........................................................................................................................................1
Log Details.......................................................................................................................................1
2 Design Specifications........................................................................................................................3
Design Port-list................................................................................................................................3
Features............................................................................................................................................4
3 System Behavioral Description.........................................................................................................6
4 Verification Levels & Required Tools...............................................................................................7
Verification Levels...........................................................................................................................7
Required Tools.................................................................................................................................7
Environment Configurations............................................................................................................7
5 Methodology & Test Scenario...........................................................................................................9
Methodology....................................................................................................................................9
Testing Scenario.............................................................................................................................12
6 Coverage..........................................................................................................................................16
I
Illustration Index
Design Entity........................................................................................................................................3
TestBench Architecture.........................................................................................................................9
II
Index of Tables
Log details............................................................................................................................................1
Design Port-List....................................................................................................................................3
Environment Configurations................................................................................................................7
Transaction Attributes.........................................................................................................................10
UART Tests........................................................................................................................................12
Coverage Analysis..............................................................................................................................16
III
UART2BUS Verificaiton Plan January 2016
1.2 References
• Bruce Wile, John Goss, Wolfgang Roesner – Comprehensive Functional Verification – The
Complete Industry Cycle – Systems on Silicon (2005).
• System Verilog For Verification – a guide to learning the test-bench language features by
Chris Spear Gregory J Tumbash (2012).
• A Practical Guide to Adopting the Universal Verification Methodology (UVM) by Sharon
Rosenberg, Kathleen Meade – Cadence Design Systems (2010).
1
UART2BUS Verificaiton Plan January 2016
2
UART2BUS Verificaiton Plan January 2016
2 Design Specifications
2.1 Design Port-list
3
UART2BUS Verificaiton Plan January 2016
2.2 Features
• UART Commands are divided into fields and each field includes one byte or more.
• Each byte is sent in between two standard bits; start and stop.
• Start bit is zero while the stop bit is one.
• Support two modes of operation
◦ Text mode command
▪ All values are in HEX format.
▪ Space is represented as 0x20
▪ Tab is represented as 0x09
▪ LF is represented as 0x0A
▪ CR is represented as 0x0D
▪ Both spaces and tabs are considered as white spaces.
▪ Both LF and CR are considered as End Of Line (EOL).
▪ Includes only two commands; address read and address write commands
• Address read command
◦ 'R' or 'r'.
◦ White space single or multiple
◦ Address to read in 4-digit HEX
◦ CR or LF character
• On the reception of EOL characters, the core will read the given address and
transmit the read value in two HEX character followed by both LF and CR.
• Address write command
◦ 'W' or 'w'.
◦ White space single or multiple
◦ Data to write in 2-digit HEX
◦ White space single or multiple
◦ Address to write 4-digit Hex
◦ CR or LF character
• On the reception of EOL characters, the core will write the received data to the
given address. No transmission is sent back to the sender.
◦ Binary mode command
▪ Support single command with configurable number of bytes
▪ The first Byte is full of zeros as indicator to the binary command.
▪ The second Byte is as following
4
UART2BUS Verificaiton Plan January 2016
1 NOP Command would be used to verify that the core responds to UART.
2 Auto Increment is often used when reading a buffer from RAM. Otherwise, it's more convenient to turn auto
increment off.
3 This field exists only in write commands.
4 This byte exists only is respond to read commands.
5 This byte exists only in case of acknowledge request in the command.
5
UART2BUS Verificaiton Plan January 2016
6
UART2BUS Verificaiton Plan January 2016
port with successive bytes every clock cycle concurrently with increment the port address content
and keep int_write signal activated till finalize the data transmission. If the received command is
read, the core will load int_address port with the command address and assert int_read signal. The
core should wait the requested data on the next clock cycle and then disable int_read to terminate
the bus usage. If the requested data includes more than one byte, the incremental address will be
loaded to the address port every clock cycle and the corresponding data will be captured through the
following clock cycle and so on.
First Bit Represent the sequence through which the byte is • Most Significant bit
serialized • Least Significant bit
Data Mode The data representation through the text commands • ASCII
• Binary
Number of stop bits The number of stop bits sent after the latest bit of • One bit
each byte • Two bits
Number of bits The number of bits through each field transfer • Seven bits
• Eight bits
Parity Mode The used parity type through each byte. • Parity Off
• Parity Even
• Parity Odd
7
UART2BUS Verificaiton Plan January 2016
False Data Enable Enable force false data on the output port within • Yes
the read command through the both modes; text, • No
binary
8
UART2BUS Verificaiton Plan January 2016
• We provide C++ code besides the test-bench to calculate baud frequency to facilitate the
usage of UART test-bench.
• Our test-bench will operate on 40 MHz as global clock and 115.2 KHz as baud rate. And
then the D-baud frequency is 144 Hz.
• Scoreboard receives transaction from driver and then check the tested address in the register
file.
• Bus Functional Model BFM includes three different blocks that are described below
9
UART2BUS Verificaiton Plan January 2016
◦ UART BFM: That act as another UART device and talk with DUT through the two
protocol signals.
◦ RF BFM: That act as memory of 64K bytes and talk with DUT through non-protocol
signals
◦ Arbiter BFM: That act as internal bus arbiter.
Transaction Attributes
We propose the following transaction attributes so that we could implement our test plan
Table 4: Transaction Attributes
Byte prefix_wrong Represents the wrong prefix that is used in case of wrong mode
selection.
Enumerate space_type1 Represents the type of the used white space in the first field to be
one of the following options {single, tab, wrong}. Wrong type
also is used to push tricky byte in the text mode.
Enumerate space_type2 Represents the type of the used white space in the second field to
be one of the following options {single, tab, wrong}. Wrong type
also is used to push tricky byte in the text mode.
Byte space_wrong1 Could hold all the 8-bit values except {single or tab} and is used
in case of space_type is wrong as the first wrong white space.
Byte space_wrong2 Could hold all the 8-bit values except {single or tab} and is used
in case of space_type is wrong as the second wrong white space.
Dynamic Array of Bytes _data Could hold all possible values and its length is constrained to be
equal to length_data.
Dynamic Array of Bytes false_data Used in case of driving inconsiderable data into the serial output
port while the DUT reply the read request command. It could
hold all possible values and its length is constrained to be equal
to length_data>
Integer Unsigned length_data Only in range of [1:256] and equal 1 in case of text command
mode.
Enumerate false_data_en Enable forcing false data within the read command.
10
UART2BUS Verificaiton Plan January 2016
Enumerate eol_type Represents the type of end of line used to be one of the following
choices{cr, lf, wrong}. Wrong type is also used to push DUT in
tricky manner.
Byte eol_wrong Could hold all 8-bit values except {cr or lf} and is used in case of
eol_type is wrong.
Enumerate char_type Represents the type of prefix in text mode either to be {capital,
small}.
Enumerate arbit Represents the internal bus state either {accept, refuse}
Time Time before Idle Time before the main command start.
Time Time after Idle Time After the finish byte of the main command.
11
UART2BUS Verificaiton Plan January 2016
12
UART2BUS Verificaiton Plan January 2016
4 Could send NOP command with non 1. Apply UART NOP command with non-
acknowledge request acknowledge request acknowledge bit request and right command mode
• Unified Prefix. prefix.
• No answer should be exist. 2. Apply UART NOP command with wrong command
• The address content shouldn't be prefix and non-acknowledge request.
affected regardless of command data. 3. Apply several UART NOP command to different
locations with different data lengths and non-
acknowledge request.
Write in Command Mode
5 Could send write command including 1. Apply UART write command with wrong prefix.
• Unified Prefix 2. Apply UART write commands to different
• 16-bit address. addresses.
• Data length varies from 1 to 256 bytes. 3. Apply UART write commands with several data
• Incremental address ability. lengths
• Acknowledge request. 4. Apply UART write command to address 0 with
random data.
5. Apply UART write command to address 0xFFFF
with random data.
6. Apply UART write command with acknowledge
request.
7. Apply UART write command with non-
acknowledge request.
8. Apply UART write command including single byte.
9. Apply UART write command including non-
incremental address bit.
10. Apply UART write command including
13
UART2BUS Verificaiton Plan January 2016
Combined Tests
Combined tests include more than one command per test and aim to put the DUT into highly
complicated processes. And also verify the bus functional model besides the DUT.
14
UART2BUS Verificaiton Plan January 2016
10 Able to distinguish between the valid and 1. Apply four valid commands
invalid commands and also able to miss the 2. Apply invalid command
invalid commands in series of valid 3. Apply valid command.
commands from different types and modes. 4. Apply two invalid commands
5. Apply valid command
15
UART2BUS Verificaiton Plan January 2016
16
Opencores.com Verificaiton Plan UART2BUS
6 Coverage
Table 7: Coverage Analysis
first_white_space_field The type of the first white space field in text Tab, Single Space
command wrong space illegal_bins
second_white_space_field The type of the first white space field in text Tab, Single Space
command wrong space illegal_bins
prefix_character_type The type of prefix character R for read W for write cap,small
3 binary_mode_cov command The type of the command in binary mode read, write, nop
1 The DUT is not implemented to overcome invalid wrong inputs like EOL/Whitespace characters and also command prefix. So it is hang-up in such a
case. so the invalid input options are put as illegal_bins in the coverage below
17
Opencores.com Verificaiton Plan UART2BUS
[1:256]
[257:$ illegal_bins
18