Altera Mentor Verification IP Altera Edition AMBA AXI3/4T Manual do Utilizador Página 175

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 783
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 174
SystemVerilog Tutorials
Verifying a Master DUT
Mentor VIP AE AXI3/4 User Guide, V10.2b
157
September 2013
The internal memory for the slave is defined as a sparse array of 8-bits, so that each byte of data
is stored as an address/data pair.
Example 6-17. internal memory
// Storage for a memory
bit [7:0] mem [*];
The do_byte_read() function, when called, reads a data byte from the internal memory, mem,
given an address location as demonstrated in Example 6-18.
You can edit this function to modify the way the read data is extracted from the internal
memory.
Example 6-18. do_byte_read()
// Function : do_byte_read
// Function to provide read data byte from memory at
// particular input address
function bit[7:0] do_byte_read(addr_t addr);
return mem[addr];
endfunction
The do_byte_write() function, when called, writes a data byte to the internal memory, mem,
given an address location as Example 6-19 illustrates.
You can edit this function to modify the way the write data is stored in the internal memory.
Example 6-19. do_byte_write()
// Function : do_byte_write
// Function to write data byte to memory at particular
// input address
function void do_byte_write(addr_t addr, bit [7:0] data);
mem[addr] = data;
endfunction
Vista de página 174
1 2 ... 170 171 172 173 174 175 176 177 178 179 180 ... 782 783

Comentários a estes Manuais

Sem comentários