Bitvis VIP AXI4-Lite
Quick Access
BFM
BFM functionality is implemented in axilite_bfm_pkg.vhd
Signal Record
t_axilite_if
Record element |
Type |
---|---|
write_address_channel |
|
write_data_channel |
|
write_response_channel |
|
read_address_channel |
|
read_data_channel |
Note
For more information on the AXI4-Lite signals, refer to “AMBA® AXI™ and ACE™ Protocol Specification”, Part B (ARM IHI 0022G), available from ARM.
Configuration Record
t_axilite_bfm_config
Default value for the record is C_AXILITE_BFM_CONFIG_DEFAULT.
Record element |
Type |
Default |
Description |
---|---|---|---|
max_wait_cycles |
natural |
10 |
The maximum number of clock cycles to wait for the DUT ready or valid signals before reporting a timeout alert |
max_wait_cycles_severity |
TB_FAILURE |
The above timeout will have this severity |
|
clock_period |
time |
-1 ns |
Period of the clock signal |
clock_period_margin |
time |
0 ns |
Input clock period margin to specified clock_period. Will check ‘T/2’ if input clock is low when BFM is called and ‘T’ if input clock is high. |
clock_margin_severity |
TB_ERROR |
The above margin will have this severity |
|
setup_time |
time |
-1 ns |
Generated signals setup time. Suggested value is clock_period/4. An alert is reported if setup_time exceeds clock_period/2. |
hold_time |
time |
-1 ns |
Generated signals hold time. Suggested value is clock_period/4. An alert is reported if hold_time exceeds clock_period/2. |
bfm_sync |
SYNC_ON_CLOCK_ONLY |
When set to SYNC_ON_CLOCK_ONLY the BFM will
enter on the first falling edge, estimate the
clock period,
synchronize the output signals and exit ¼
clock period after a succeeding rising edge.
When set to SYNC_WITH_SETUP_AND_HOLD the BFM
will use the configured setup_time, hold_time
and
clock_period to synchronize output signals
with clock edges.
|
|
match_strictness |
MATCH_EXACT |
Matching strictness for std_logic values in
check procedures.
MATCH_EXACT requires both values to be the
same. Note that the expected value can contain
the don’t care operator ‘-‘.
MATCH_STD allows comparisons between ‘H’ and
‘1’, ‘L’ and ‘0’ and ‘-’ in both values.
|
|
expected_response |
OKAY |
Sets the expected response for both read and write transactions |
|
expected_response_severity |
TB_FAILURE |
A response mismatch will have this severity |
|
protection_setting |
UNPRIVILEGED_NONSECURE_DATA |
Sets the access permissions (e.g. write to data/instruction, privileged and secure access) |
|
num_aw_pipe_stages |
natural |
1 |
Write Address Channel pipeline steps |
num_w_pipe_stages |
natural |
1 |
Write Data Channel pipeline steps |
num_ar_pipe_stages |
natural |
1 |
Read Address Channel pipeline steps |
num_r_pipe_stages |
natural |
1 |
Read Data Channel pipeline steps |
num_b_pipe_stages |
natural |
1 |
Response Channel pipeline steps |
id_for_bfm |
t_msg_id |
ID_BFM |
Message ID used for logging general messages in the BFM |
id_for_bfm_wait |
t_msg_id |
ID_BFM_WAIT |
Message ID used for logging waits in the BFM |
id_for_bfm_poll |
t_msg_id |
ID_BFM_POLL |
Message ID used for logging polling in the BFM |
Methods
All signals are active high.
All parameters in brackets are optional.
Note
The AXI4-Lite BFM procedures do not access the AXI channels independently. However, this is sufficient for most use cases. If independent channel access is required, for instance simultaneous read and write accesses, use the VVC.
axilite_write()
Writes the given data to the given address of the DUT, using the AXI4-Lite protocol. For protocol details, see the AXI4-Lite specification. If the byte_enable argument is not used, it will be set to all ‘1’, i.e. all bytes are used.
The procedure reports an alert if:
Data length is neither 32 bit nor 64 bit (alert level: TB_ERROR)
wready does not occur within max_wait_cycles clock cycles (alert level: max_wait_cycles_severity, set in the config)
awready does not occur within max_wait_cycles clock cycles (alert level: max_wait_cycles_severity, set in the config)
bresp is not set to expected_response (set in the config) when bvalid is set to ‘1’ (alert level: expected_response_severity, set in the config)
bvalid is not set within max_wait_cycles clock cycles (alert level: max_wait_cycles_severity, set in the config)
axilite_write(addr_value, data_value, [byte_enable,] msg, clk, axilite_if, [scope, [msg_id_panel, [config]]])
Object |
Name |
Dir. |
Type |
Description |
---|---|---|---|---|
constant |
addr_value |
in |
unsigned |
The address of an AXI4-Lite accessible register |
constant |
data_value |
in |
std_logic_vector |
The data value to be written to the addressed register |
constant |
byte_enable |
in |
std_logic_vector |
This argument selects which bytes to use (all ‘1’ means all bytes are updated) |
constant |
msg |
in |
string |
A custom message to be appended in the log/alert |
signal |
clk |
in |
std_logic |
The clock signal used to read and write data in/out of the AXI4-Lite BFM |
signal |
axilite_if |
inout |
AXI4-Lite signal interface record |
|
constant |
scope |
in |
string |
Describes the scope from which the log/alert originates. Default value is C_BFM_SCOPE (“AXILITE_BFM”). |
constant |
msg_id_panel |
in |
t_msg_id_panel |
Controls verbosity within a specified scope. Default value is shared_msg_id_panel. |
constant |
config |
in |
Configuration of BFM behavior and restrictions. Default value is C_AXILITE_BFM_CONFIG_DEFAULT. |
-- Examples:
axilite_write(x"00101155", x"AAAA", "Writing data to Peripheral 1", clk, axilite_if, C_SCOPE, shared_msg_id_panel, C_AXILITE_BFM_CONFIG_DEFAULT);
axilite_write(C_ADDR_PERIPHERAL_1, x"00F1", "01", "Writing first byte to Peripheral 1", clk, axilite_if, C_SCOPE, shared_msg_id_panel, C_AXILITE_BFM_CONFIG_DEFAULT);
-- Suggested usage (requires local overload, see 'Local BFM overloads' section):
axilite_write(C_ADDR_DMA, x"AAAA", "Writing data to DMA");
axilite_read()
Reads data from the DUT at the given address, using the AXI4-Lite protocol. For protocol details, see the AXI4-Lite specification. The read data is placed on the output ‘data_value’ when the read has completed.
The procedure reports an alert if:
The read data length (rdata) is neither 32 bit nor 64 bit (alert level: TB_ERROR)
arready does not occur within max_wait_cycles clock cycles (alert level: max_wait_cycles_severity, set in the config)
rresp is not set to expected_response (set in the config) when rvalid is set to ‘1’ (alert level: expected_response_severity, set in the config)
rvalid is not set within max_wait_cycles clock cycles (alert level: max_wait_cycles_severity, set in the config)
axilite_read(addr_value, data_value, msg, clk, axilite_if, [scope, [msg_id_panel, [config]]])
Object |
Name |
Dir. |
Type |
Description |
---|---|---|---|---|
constant |
addr_value |
in |
unsigned |
The address of an AXI4-Lite accessible register |
variable |
data_value |
out |
std_logic_vector |
The data value to be read from the addressed register |
constant |
msg |
in |
string |
A custom message to be appended in the log/alert |
signal |
clk |
in |
std_logic |
The clock signal used to read and write data in/out of the AXI4-Lite BFM |
signal |
axilite_if |
inout |
AXI4-Lite signal interface record |
|
constant |
scope |
in |
string |
Describes the scope from which the log/alert originates. Default value is C_BFM_SCOPE (“AXILITE_BFM”). |
constant |
msg_id_panel |
in |
t_msg_id_panel |
Controls verbosity within a specified scope. Default value is shared_msg_id_panel. |
constant |
config |
in |
Configuration of BFM behavior and restrictions. Default value is C_AXILITE_BFM_CONFIG_DEFAULT. |
-- Examples:
axilite_read(C_ADDR_PERIPHERAL_1, v_data_out, "Read from Peripheral 1", clk, axilite_if, C_SCOPE, shared_msg_id_panel, C_AXILITE_BFM_CONFIG_DEFAULT);
-- Suggested usage (requires local overload, see 'Local BFM overloads' section):
axilite_read(C_ADDR_IO, v_data_out, "Reading from IO device");
axilite_check()
Reads data from the DUT at the given address, using the AXI4-Lite protocol. For protocol details, see the AXI4-Lite specification. After reading data from the AXI4-Lite bus, the read data is compared with the expected data, and if they don’t match, an alert with severity ‘alert_level’ is reported. The procedure also report alerts for the same conditions as the axilite_read() procedure.
axilite_check(addr_value, data_exp, msg, clk, axilite_if, [alert_level, [scope, [msg_id_panel, [config]]]])
Object |
Name |
Dir. |
Type |
Description |
---|---|---|---|---|
constant |
addr_value |
in |
unsigned |
The address of an AXI4-Lite accessible register |
constant |
data_exp |
in |
std_logic_vector |
The data value to expect when reading the addressed register |
constant |
msg |
in |
string |
A custom message to be appended in the log/alert |
signal |
clk |
in |
std_logic |
The clock signal used to read and write data in/out of the AXI4-Lite BFM |
signal |
axilite_if |
inout |
AXI4-Lite signal interface record |
|
constant |
alert_level |
in |
Sets the severity for the alert. Default value is ERROR. |
|
constant |
scope |
in |
string |
Describes the scope from which the log/alert originates. Default value is C_BFM_SCOPE (“AXILITE_BFM”). |
constant |
msg_id_panel |
in |
t_msg_id_panel |
Controls verbosity within a specified scope. Default value is shared_msg_id_panel. |
constant |
config |
in |
Configuration of BFM behavior and restrictions. Default value is C_AXILITE_BFM_CONFIG_DEFAULT. |
-- Examples:
axilite_check(C_ADDR_PERIPHERAL_1, x"3B", "Check data from Peripheral 1", clk, axilite_if, C_SCOPE, shared_msg_id_panel, ERROR, C_AXILITE_BFM_CONFIG_DEFAULT);
-- Suggested usage (requires local overload, see 'Local BFM overloads' section):
axilite_check(C_ADDR_UART_RX, x"3B", "Checking data in UART RX register");
init_axilite_if_signals()
Initializes the AXI4-Lite interface. All the BFM outputs are set to ‘0’, and BFM inputs are set to ‘Z’. awprot and arprot are set to UNPRIVILEGED_NONSECURE_DATA (“010”).
t_axilite_if := init_axilite_if_signals(addr_width, data_width)
Object |
Name |
Dir. |
Type |
Description |
---|---|---|---|---|
constant |
addr_width |
in |
natural |
Width of the address signals |
constant |
data_width |
in |
natural |
Width of the data signals |
-- Examples:
axilite_if <= init_axilite_if_signals(addr_width, data_width)
Local types
t_axilite_write_address_channel
Record element |
Type |
---|---|
awaddr |
std_logic_vector |
awvalid |
std_logic |
awprot |
std_logic_vector(2 downto 0) |
awready |
std_logic |
t_axilite_write_data_channel
Record element |
Type |
---|---|
wdata |
std_logic_vector |
wstrb |
std_logic_vector |
wvalid |
std_logic |
wready |
std_logic |
t_axilite_write_response_channel
Record element |
Type |
---|---|
bready |
std_logic |
bresp |
std_logic_vector(1 downto 0) |
bvalid |
std_logic |
t_axilite_read_address_channel
Record element |
Type |
---|---|
araddr |
std_logic_vector |
arvalid |
std_logic |
arprot |
std_logic_vector(2 downto 0) |
arready |
std_logic |
t_axilite_read_data_channel
Record element |
Type |
---|---|
rready |
std_logic |
rdata |
std_logic_vector |
rresp |
std_logic_vector(1 downto 0) |
rvalid |
std_logic |
t_axprot
UNPRIVILEGED_NONSECURE_DATA, UNPRIVILEGED_NONSECURE_INSTRUCTION, UNPRIVILEGED_SECURE_DATA, UNPRIVILEGED_SECURE_INSTRUCTION, PRIVILEGED_NONSECURE_DATA, PRIVILEGED_NONSECURE_INSTRUCTION, PRIVILEGED_SECURE_DATA, PRIVILEGED_SECURE_INSTRUCTION
t_xresp
OKAY, SLVERR, DECERR, ILLEGAL
Local BFM overloads
A good approach for better readability and maintainability is to make simple, local overloads for the BFM procedures in the TB process. This allows calling the BFM procedures with the key parameters only, e.g.
axilite_write(C_ADDR_PERIPHERAL_1, C_TEST_DATA, "Sending data to Peripheral 1");
rather than
axilite_write(C_ADDR_PERIPHERAL_1, C_TEST_DATA, "Sending data to Peripheral 1", clk, axilite_if, C_SCOPE, shared_msg_id_panel, C_AXILITE_BFM_CONFIG_DEFAULT);
By defining the local overload as e.g.
procedure axilite_write(
constant addr_value : in unsigned;
constant data_value : in std_logic_vector;
constant msg : in string
) is
begin
axilite_write(
addr_value, -- Keep as is
data_value, -- Keep as is
msg, -- Keep as is
clk, -- Signal must be visible in local process scope
axilite_if, -- Signal must be visible in local process scope
C_SCOPE, -- Setting a default value
shared_msg_id_panel, -- Use global, shared msg_id_panel
C_AXILITE_BFM_CONFIG_LOCAL); -- Use locally defined configuration or C_AXILITE_BFM_CONFIG_DEFAULT
end procedure;
Using a local overload like this also allows the following – if wanted:
Have address value as natural – and convert in the overload
Set up defaults for constants. May be different for two overloads of the same BFM
Apply dedicated message ID panel to allow dedicated verbosity control
Compilation
This BFM package may only be compiled with VHDL-2008 or newer. It is dependent on the Utility Library, which is only compatible with VHDL-2008 or newer.
After UVVM-Util has been compiled, the BFM package can be compiled into any desired library.
See Essential Mechanisms - Compile Scripts for information about compile scripts.
Simulator compatibility and setup
See Prerequisites for a list of supported simulators.
For required simulator setup see UVVM-Util Simulator compatibility and setup.
Additional Documentation
For more information on the AXI4-Lite specification, refer to “AMBA® AXI™ and ACE™ Protocol Specification”, Part B (ARM IHI 0022G), available from ARM.
Important
This is a simplified Bus Functional Model (BFM) for AXI4-Lite.
The given BFM complies with the basic AXI4-Lite protocol and thus allows a normal access towards an AXI4-Lite interface.
This BFM is not an AXI4-Lite protocol checker.
For a more advanced BFM please contact UVVM support at info@uvvm.org
VVC
VVC functionality is implemented in axilite_vvc.vhd
For general information see VVC Framework - Essential Mechanisms.
Entity
Generics
Name |
Type |
Default |
Description |
---|---|---|---|
GC_ADDR_WIDTH |
integer |
8 |
Width of the AXI4-Lite address bus |
GC_DATA_WIDTH |
integer |
32 |
Width of the AXI4-Lite data bus |
GC_INSTANCE_IDX |
natural |
1 |
Instance number to assign the VVC |
GC_AXILITE_CONFIG |
C_AXILITE_BFM_CONFIG_DEFAULT |
Configuration for the AXI4-Lite BFM |
|
GC_CMD_QUEUE_COUNT_MAX |
natural |
C_CMD_QUEUE_COUNT_MAX |
Absolute maximum number of commands in the VVC command queue |
GC_CMD_QUEUE_COUNT_THRESHOLD |
natural |
C_CMD_QUEUE_COUNT_THRESHOLD |
An alert will be generated when reaching this threshold to indicate that the command queue is almost full. The queue will still accept new commands until it reaches GC_CMD_QUEUE_COUNT_MAX. |
GC_CMD_QUEUE_COUNT_THRESHOLD_SEVERITY |
C_CMD_QUEUE_COUNT_THRESHOLD_SEVERITY |
Alert severity which will be used when command queue reaches GC_CMD_QUEUE_COUNT_THRESHOLD |
|
GC_RESULT_QUEUE_COUNT_MAX |
natural |
C_RESULT_QUEUE_COUNT_MAX |
Maximum number of unfetched results before result_queue is full |
GC_RESULT_QUEUE_COUNT_THRESHOLD |
natural |
C_RESULT_QUEUE_COUNT_THRESHOLD |
An alert will be issued if result queue exceeds this count. Used for early warning if result queue is almost full. Will be ignored if set to 0. |
GC_RESULT_QUEUE_COUNT_THRESHOLD_SEVERITY |
C_RESULT_QUEUE _COUNT_THRESHOLD_SEVERITY |
Severity of alert to be initiated if exceeding GC_RESULT_QUEUE_COUNT_THRESHOLD |
Signals
Object |
Name |
Dir. |
Type |
Description |
---|---|---|---|---|
signal |
clk |
in |
std_logic |
VVC Clock signal |
signal |
axilite_vvc_master_if |
inout |
AXI4-Lite signal interface record |
In this VVC, the interface has been encapsulated in a signal record of type t_axilite_if in order to improve readability of the code. Since the AXI4-Lite interface buses can be of arbitrary size, the interface vectors have been left unconstrained. These unconstrained vectors need to be constrained when the interface signals are instantiated. For this interface, it could look like:
signal axilite_if : t_axilite_if(write_address_channel(awaddr(C_ADDR_WIDTH -1 downto 0)),
write_data_channel (wdata (C_DATA_WIDTH -1 downto 0),
wstrb ((C_DATA_WIDTH/8)-1 downto 0)),
read_address_channel (araddr(C_ADDR_WIDTH -1 downto 0)),
read_data_channel (rdata (C_DATA_WIDTH -1 downto 0)));
Configuration Record
vvc_config accessible via shared_axilite_vvc_config
Record element |
Type |
Default |
Description |
---|---|---|---|
inter_bfm_delay |
C_AXILITE_INTER_BFM_DELAY_DEFAULT |
Delay between any requested BFM accesses
towards the DUT.
TIME_START2START: Time from a BFM start to the
next BFM start (a TB_WARNING will be issued if
access takes longer than TIME_START2START).
TIME_FINISH2START: Time from a BFM end to the
next BFM start.
Any insert_delay() command will add to the
above minimum delays, giving for instance the
ability to skew the BFM starting time.
|
|
cmd_queue_count_max |
natural |
C_CMD_QUEUE_COUNT_MAX |
Maximum pending number in command queue before queue is full. Adding additional commands will result in an ERROR. |
cmd_queue_count_threshold |
natural |
C_CMD_QUEUE_COUNT_THRESHOLD |
An alert will be issued if command queue exceeds this count. Used for early warning if command queue is almost full. Will be ignored if set to 0. |
cmd_queue_count_threshold_severity |
C_CMD_QUEUE_COUNT_THRESHOLD_SEERITY |
Severity of alert to be initiated if exceeding cmd_queue_count_threshold |
|
result_queue_count_max |
natural |
C_RESULT_QUEUE_COUNT_MAX |
Maximum number of unfetched results before result_queue is full |
result_queue_count_threshold |
natural |
C_RESULT_QUEUE_COUNT_THRESHOLD |
An alert will be issued if result queue exceeds this count. Used for early warning if result queue is almost full. Will be ignored if set to 0. |
result_queue_count_threshold_severity |
C_RESULT_QUEUE_COUNT_THRESHOLD_SEVERITY |
Severity of alert to be initiated if exceeding result_queue_count_threshold |
|
bfm_config |
C_AXILITE_BFM_CONFIG_DEFAULT |
Configuration for the AXI4-Lite BFM |
|
msg_id_panel |
t_msg_id_panel |
C_VVC_MSG_ID_PANEL_DEFAULT |
VVC dedicated message ID panel. See Scope of Verbosity Control for how to use verbosity control. |
force_single_pending_transac/ tion |
boolean |
false |
Waits until the previous transaction is completed before starting the next one |
unwanted_activity_severity |
C_UNWANTED_ACTIVITY_SEVERITY |
Severity of alert to be issued if unwanted activity on the DUT outputs is detected. It is enabled with ERROR severity by default. |
Note
cmd/result queue parameters in the configuration record are unused and will be removed in v3.0, use instead the entity generic constants.
The configuration record can be accessed from the Central Testbench Sequencer through the shared variable array, e.g.
shared_axilite_vvc_config(1).inter_bfm_delay.delay_in_time := 50 ns;
shared_axilite_vvc_config(1).bfm_config.clock_period := 10 ns;
Status Record
vvc_status accessible via shared_axilite_vvc_status
The current status of the VVC can be retrieved during simulation. This is achieved by reading from the shared variable from the test sequencer. The record contents can be seen below:
Record element |
Type |
Description |
---|---|---|
current_cmd_idx |
natural |
Command index currently running |
previous_cmd_idx |
natural |
Previous command index to run |
pending_cmd_idx |
natural |
Pending number of commands in the command queue |
Methods
All VVC procedures are defined in vvc_methods_pkg.vhd (dedicated to this VVC).
See Common VVC Methods for procedures which are common to all VVCs.
It is also possible to send a multicast to all instances of a VVC with ALL_INSTANCES as parameter for vvc_instance_idx.
All parameters in brackets are optional.
Caution
Orange description is preliminary.
axilite_write()
Adds a write command to the AXI4-Lite VVC executor queue, which will distribute this command to the various channel executors which in turn will run as soon as all preceding commands have completed. When the command is scheduled to run, the executors call the AXI4-Lite procedures in axilite_channel_handler_pkg.vhd. This procedure can be called with or without byte_enable constant. When not set, byte_enable is set to all ‘1’, indicating that all bytes are valid.
axilite_write(VVCT, vvc_instance_idx, addr, data, [byte_enable,] msg, [scope])
Object |
Name |
Dir. |
Type |
Description |
---|---|---|---|---|
signal |
VVCT |
inout |
t_vvc_target_record |
VVC target type compiled into each VVC in order to differentiate between VVCs |
constant |
vvc_instance_idx |
in |
integer |
Instance number of the VVC |
constant |
addr |
in |
unsigned |
The address of an AXI4-Lite accessible register |
constant |
data |
in |
std_logic_vector |
The data value to be written to the addressed register |
constant |
byte_enable |
in |
std_logic_vector |
This argument selects which bytes to use (all ‘1’ means all bytes are updated) |
constant |
msg |
in |
string |
A custom message to be appended in the log/alert |
constant |
scope |
in |
string |
Describes the scope from which the log/alert originates. Default value is C_VVC_CMD_SCOPE_DEFAULT. |
-- Examples:
axilite_write(AXILITE_VVCT, 0, x"0011A000", x"F102", "Writing data to Peripheral 1", C_SCOPE);
axilite_write(AXILITE_VVCT, 0, C_ADDR_PERIPHERAL_1, x"F102", b"11", "Writing data to Peripheral 1", C_SCOPE);
axilite_write(AXILITE_VVCT, 0, C_ADDR_DMA, x"1155F102", "Writing data to DMA", C_SCOPE);
axilite_read()
Adds a read command to the AXI4-Lite VVC executor queue, which will distribute this command to the various channel executors which in turn will run as soon as all preceding commands have completed. When the command is scheduled to run, the executors call the AXI4-Lite procedures in axilite_channel_handler_pkg.vhd.
The value read from DUT will not be returned in this procedure call since it is non-blocking for the sequencer/caller, but the read data will be stored in the VVC for a potential future fetch (see example with fetch_result below). If the data_routing is set to TO_SB, the read data will be sent to the AXI4-Lite VVC dedicated scoreboard where it will be checked against the expected value (provided by the testbench).
axilite_read(VVCT, vvc_instance_idx, addr, [data_routing,] msg, [scope])
Object |
Name |
Dir. |
Type |
Description |
---|---|---|---|---|
signal |
VVCT |
inout |
t_vvc_target_record |
VVC target type compiled into each VVC in order to differentiate between VVCs |
constant |
vvc_instance_idx |
in |
integer |
Instance number of the VVC |
constant |
addr |
in |
unsigned |
The address of an AXI4-Lite accessible register |
constant |
data_routing |
in |
Selects the destination of the read data |
|
constant |
msg |
in |
string |
A custom message to be appended in the log/alert |
constant |
scope |
in |
string |
Describes the scope from which the log/alert originates. Default value is C_VVC_CMD_SCOPE_DEFAULT. |
-- Examples:
axilite_read(AXILITE_VVCT, 0, x"00099555", "Read from Peripheral 1", C_SCOPE);
axilite_read(AXILITE_VVCT, 0, C_ADDR_IO, "Read from IO device", C_SCOPE);
-- Example with fetch_result() call: Result is placed in v_result
variable v_cmd_idx : natural; -- Command index for the last read
variable v_result : work.vvc_cmd_pkg.t_vvc_result; -- Result from read
...
axilite_read(AXILITE_VVCT, 0, x"112252AA", "Read from Peripheral 1");
v_cmd_idx := get_last_received_cmd_idx(AXILITE_VVCT, 0);
await_completion(AXILITE_VVCT, 0, v_cmd_idx, 100 ns, "Wait for read to finish");
fetch_result(AXILITE_VVCT, 0, v_cmd_idx, v_result, "Fetching result from read operation");
Hint
t_vvc_result is defined in the corresponding vvc_cmd_pkg.vhd for the VIP.
axilite_check()
Adds a check command to the AXI4-Lite VVC executor queue, which will distribute this command to the various channel executors which in turn will run as soon as all preceding commands have completed. When the command is scheduled to run, the executors call the AXI4-lite procedures in axilite_channel_handler_pkg.vhd. The axilite_check() procedure will perform a read operation, then check if the read data is equal to the ‘data’ parameter. If the read data is not equal to the expected data, an alert with severity ‘alert_level’ will be issued. The read data will not be stored by this procedure.
axilite_check(VVCT, vvc_instance_idx, addr, data, msg, [alert_level, [scope]])
Object |
Name |
Dir. |
Type |
Description |
---|---|---|---|---|
signal |
VVCT |
inout |
t_vvc_target_record |
VVC target type compiled into each VVC in order to differentiate between VVCs |
constant |
vvc_instance_idx |
in |
integer |
Instance number of the VVC |
constant |
addr |
in |
unsigned |
The address of an AXI4-Lite accessible register |
constant |
data |
in |
std_logic_vector |
The data value to expect when reading the addressed register |
constant |
msg |
in |
string |
A custom message to be appended in the log/alert |
constant |
alert_level |
in |
Sets the severity for the alert. Default value is ERROR. |
|
constant |
scope |
in |
string |
Describes the scope from which the log/alert originates. Default value is C_VVC_CMD_SCOPE_DEFAULT. |
-- Examples:
axilite_check(AXILITE_VVCT, 0, x"00099555", x"393B", "Check data from Peripheral 1", ERROR, C_SCOPE);
Activity Watchdog
The VVCs support a centralized VVC activity register which the activity watchdog uses to monitor the VVC activities. The VVCs will register their presence to the VVC activity register at start-up, and report when ACTIVE and INACTIVE, using dedicated VVC activity register methods, and trigger the global_trigger_vvc_activity_register signal during simulations. The activity watchdog is continuously monitoring the VVC activity register for VVC inactivity and raises an alert if no VVC activity is registered within the specified timeout period.
Include activity_watchdog(num_exp_vvc, timeout, [alert_level, [msg]])
in the testbench to start using the activity watchdog.
Note that setting the exact number of expected VVCs in the VVC activity register can be omitted by setting num_exp_vvc = 0.
More information can be found in Essential Mechanisms - Activity Watchdog.
Transaction Info
This VVC supports transaction info, a UVVM concept for distributing transaction information in a controlled manner within the complete testbench environment. The transaction info may be used in many different ways, but the main purpose is to share information directly from the VVC to a DUT model.
Info field |
Type |
Default |
Description |
---|---|---|---|
operation |
t_operation |
NO_OPERATION |
Current VVC operation, e.g. INSERT_DELAY, POLL_UNTIL, READ, WRITE |
vvc_meta |
t_vvc_meta |
C_VVC_META_DEFAULT |
VVC meta data of the executing VVC command |
-> msg |
string |
“” |
Message of executing VVC command |
-> cmd_idx |
integer |
-1 |
Command index of executing VVC command |
transaction_status |
t_transaction_status |
INACTIVE |
Set to INACTIVE, IN_PROGRESS, FAILED or SUCCEEDED during a transaction |
Info field |
Type |
Default |
Description |
---|---|---|---|
operation |
t_operation |
NO_OPERATION |
Current VVC operation, e.g. INSERT_DELAY, POLL_UNTIL, READ, WRITE |
arwaddr |
unsigned(31 downto 0) |
0x0 |
The address for a read or write transaction |
vvc_meta |
t_vvc_meta |
C_VVC_META_DEFAULT |
VVC meta data of the executing VVC command |
-> msg |
string |
“” |
Message of executing VVC command |
-> cmd_idx |
integer |
-1 |
Command index of executing VVC command |
transaction_status |
t_transaction_status |
INACTIVE |
Set to INACTIVE, IN_PROGRESS, FAILED or SUCCEEDED during a transaction |
Info field |
Type |
Default |
Description |
---|---|---|---|
operation |
t_operation |
NO_OPERATION |
Current VVC operation, e.g. INSERT_DELAY, POLL_UNTIL, READ, WRITE |
wdata |
std_logic_vector(255 downto 0) |
0x0 |
Write data |
wstrb |
std_logic_vector(31 downto 0) |
0x0 |
Write strobe |
vvc_meta |
t_vvc_meta |
C_VVC_META_DEFAULT |
VVC meta data of the executing VVC command |
-> msg |
string |
“” |
Message of executing VVC command |
-> cmd_idx |
integer |
-1 |
Command index of executing VVC command |
transaction_status |
t_transaction_status |
INACTIVE |
Set to INACTIVE, IN_PROGRESS, FAILED or SUCCEEDED during a transaction |
Info field |
Type |
Default |
Description |
---|---|---|---|
operation |
t_operation |
NO_OPERATION |
Current VVC operation, e.g. INSERT_DELAY, POLL_UNTIL, READ, WRITE |
vvc_meta |
t_vvc_meta |
C_VVC_META_DEFAULT |
VVC meta data of the executing VVC command |
-> msg |
string |
“” |
Message of executing VVC command |
-> cmd_idx |
integer |
-1 |
Command index of executing VVC command |
transaction_status |
t_transaction_status |
INACTIVE |
Set to INACTIVE, IN_PROGRESS, FAILED or SUCCEEDED during a transaction |
Info field |
Type |
Default |
Description |
---|---|---|---|
operation |
t_operation |
NO_OPERATION |
Current VVC operation, e.g. INSERT_DELAY, POLL_UNTIL, READ, WRITE |
rdata |
std_logic_vector(255 downto 0) |
0x0 |
Read data |
vvc_meta |
t_vvc_meta |
C_VVC_META_DEFAULT |
VVC meta data of the executing VVC command |
-> msg |
string |
“” |
Message of executing VVC command |
-> cmd_idx |
integer |
-1 |
Command index of executing VVC command |
transaction_status |
t_transaction_status |
INACTIVE |
Set to INACTIVE, IN_PROGRESS, FAILED or SUCCEEDED during a transaction |
More information can be found in Essential Mechanisms - Distribution of Transaction Info.
Scoreboard
This VVC has built in Scoreboard functionality where data can be routed by setting the TO_SB parameter in supported method calls, i.e. axilite_read(). Note that the data is only stored in the scoreboard and not accessible with the fetch_result() method when the TO_SB parameter is applied. The AXI4-Lite scoreboard is accessible from the testbench as a shared variable AXILITE_VVC_SB, located in the vvc_methods_pkg.vhd, e.g.
AXILITE_VVC_SB.add_expected(C_AXILITE_VVC_IDX, pad_axilite_sb(v_expected), "Adding expected");
The AXI4-Lite scoreboard is per default 256 bits wide standard logic vector. When sending expected result to the scoreboard, where the result width is smaller than the default scoreboard width, we recommend zero-padding the data with the pad_axilite_sb() function, e.g.
AXILITE_VVC_SB.add_expected(<AXI-Lite VVC instance number>, pad_axilite_sb(<exp data>));
See the Bitvis VIP Scoreboard for a complete list of available commands and additional information. All of the listed Generic Scoreboard commands are available for the AXI4-Lite VVC scoreboard using the AXILITE_VVC_SB.
Unwanted Activity Detection
This VVC supports detection of unwanted activity from the DUT. This mechanism will give an alert if the DUT generates any unexpected bus activity. It assures that no data is output from the DUT when it is not expected, i.e. read/receive/check/expect VVC methods are not called. Once the VVC is inactive, it starts to monitor continuously on the DUT outputs. When unwanted activity is detected, the VVC issues an alert.
The unwanted activity detection can be configured from the central testbench sequencer, where the severity of alert can be changed to a different value. To disable this feature in the testbench, e.g.
shared_axilite_vvc_config(C_VVC_INDEX).unwanted_activity_severity := NO_ALERT;
Note that the ready signals (awready, wready, arready) are not monitored in this VVC. The ready signals are allowed to be set independently of the valid signals (awvalid, wvalid, arvalid), and there is no method to differentiate between the unwanted activity and intended activity. See the AXI4-Lite protocol specification for more information.
The unwanted activity detection is ignored when the valid signals (bvalid, rvalid) go low within one clock period after the VVC becomes inactive. This is to handle the situation when the read command exits before the next rising edge, causing signal transitions during the first clock cycle after the VVC is inactive.
For AXI4-Lite VVC, the unwanted activity detection feature is enabled by default with severity ERROR.
More information can be found in Essential Mechanisms - Unwanted Activity Detection.
Compilation
The AXI4-Lite VVC must be compiled with VHDL-2008 or newer. It is dependent on the following libraries:
UVVM Utility Library (UVVM-Util)
UVVM VVC Framework
Bitvis VIP Scoreboard
AXI4-Lite BFM
Before compiling the AXI4-Lite VVC, assure that uvvm_util, uvvm_vvc_framework and bitvis_vip_scoreboard have been compiled.
See Essential Mechanisms - Compile Scripts for information about compile scripts.
Compile to library |
File |
Comment |
---|---|---|
bitvis_vip_axilite |
axilite_bfm_pkg.vhd |
AXI4-Lite BFM |
bitvis_vip_axilite |
transaction_pkg.vhd |
AXI4-Lite transaction package with DTT types, constants, etc. |
bitvis_vip_axilite |
vvc_cmd_pkg.vhd |
AXI4-Lite VVC command types and operations |
bitvis_vip_axilite |
axilite_channel_handler_pkg.vhd |
Package containing procedures for accessing AXI4-Lite channels. Only for use by the VVC. |
bitvis_vip_axilite |
../uvvm_vvc_framework/src_target_dependent/td_target_support_pkg.vhd |
UVVM VVC target support package, compiled into this VVC library |
bitvis_vip_axilite |
../uvvm_vvc_framework/src_target_dependent/td_vvc_framework_common_methods_pkg.vhd |
Common UVVM framework methods compiled into the this VVC library |
bitvis_vip_axilite |
vvc_sb_pkg.vhd |
AXI4-Lite VVC scoreboard |
bitvis_vip_axilite |
vvc_methods_pkg.vhd |
AXI4-Lite VVC methods |
bitvis_vip_axilite |
../uvvm_vvc_framework/src_target_dependent/td_queue_pkg.vhd |
UVVM queue package for this VVC |
bitvis_vip_axilite |
../uvvm_vvc_framework/src_target_dependent/td_vvc_entity_support_pkg.vhd |
UVVM VVC entity support compiled into this VVC library |
bitvis_vip_axilite |
axilite_vvc.vhd |
AXI4-Lite VVC |
bitvis_vip_axilite |
vvc_context.vhd |
AXI4-Lite VVC context file |
Simulator compatibility and setup
See Prerequisites for a list of supported simulators.
For required simulator setup see UVVM-Util Simulator compatibility and setup.
Additional Documentation
For more information on the AXI4-Lite specification, refer to “AMBA® AXI™ and ACE™ Protocol Specification”, Part B (ARM IHI 0022G), available from ARM.
Important
This is a simplified Verification IP (VIP) for AXI4-Lite.
The given VIP complies with the basic AXI4-Lite protocol and thus allows a normal access towards an AXI4-Lite interface.
This VIP is not an AXI4-Lite protocol checker.
For a more advanced VIP please contact UVVM support at info@uvvm.org
Note
Disclaimer: This IP and any part thereof are provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with this IP.