Altera Mentor Verification IP Altera Edition AMBA AXI3/4T Manual de usuario Pagina 636

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 783
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 635
Mentor VIP AE AXI3/4 User Guide, V10.2b
616
VHDL Tutorials
Verifying a Slave DUT
September 2013
All other transaction fields default to legal protocol values (see create_write_transaction()
procedure for details).
Example 11-10. Write Transaction Creation and Execution
-- 4 x Writes
-- Write data value 1 on byte lanes 1 to address 1.
create_write_transaction(1, tr_id, index, axi4_tr_if_0(index));
data_words(31 downto 0) := x"00000100";
set_data_words(data_words, tr_id, index, axi4_tr_if_0(index));
set_write_strobes(2, tr_id, index, axi4_tr_if_0(index));
report "master_test_program: Writing data (1) to address (1)";
-- By default it will run in Blocking mode
execute_transaction(tr_id, index, axi4_tr_if_0(index));
In the complete Master Test Program three subsequent write transactions are created and
executed in a similar manner to that shown in Example 11-10. See VHDL AXI4 Master BFM
Test Program for details.
Read Transaction Creation and Execution
The code excerpt in Example 11-11 reads the data that has been previously written into the
slave memory. The Master Test Program first creates a read transaction by calling the
create_read_transaction() procedure, providing only the start address argument. The optional
burst-length automatically defaults to a value of zero—indicating a burst length of a single beat.
The set_size() procedure is then called to set the transaction size field to a single byte
(AXI4_BYTES_1), and the set_id() procedure call sets the transaction id field to be 1. The read
transaction is then executed on the protocol signals by calling the execute_transaction()
procedure.
The read data is obtained using the get_data_words() procedure to get the data_words
transaction field value. The result of the read data is compared with the expected data—and a
message displays the transcript.
Example 11-11. Read Transaction Creation and Execution
--4 x Reads
--Read data from address 1.
create_read_transaction(1, tr_id, index, axi4_tr_if_0(index));
set_id(1, tr_id, index, axi4_tr_if_0(index));
set_size(AXI4_BYTES_1, tr_id, index, axi4_tr_if_0(index));
execute_transaction(tr_id, index, axi4_tr_if_0(index));
get_data_words(data_words, tr_id, index, axi4_tr_if_0(index));
if(data_words(31 downto 0) = x"00000100") then
report "master_test_program: Read correct data (1) at address (1)";
else
hwrite(lp, data_words(31 downto 0));
Vista de pagina 635
1 2 ... 631 632 633 634 635 636 637 638 639 640 641 ... 782 783

Comentarios a estos manuales

Sin comentarios