Facebook/LinkedIn login is now deprecated, please disconnect our access to your social profile.
User dashboard under chipverify.com/connect will be deprecated from Oct 1, 2020, Read More.
Let us contribute to a cleaner Earth, Go Green Updated: May 31, 2020

Part 1 showed how to create a simple AHB-L agent driver that is capable of driving a single non-sequential access.

Now we'll see how to extend this model to create burst transactions with different sizes and types.

Type definitions

  
  
typedef enum bit [1:0] { IDLE, BUSY, NONSEQ, SEQ } e_htrans;
typedef enum bit [2:0] { BYTE, HALF_WORD, WORD, WORD_2, WORD_4, WORD_8, WORD_16, WORD_32} e_hsize;
typedef enum bit [2:0] { SINGLE, INCR, WRAP4, INCR4, WRAP8, INCR8, WRAP16, INCR16 } e_hburst;
typedef enum bit [3:0] { OPCODE_FETCH, DATA_ACCESS, USER_ACCESS, PRIVELEGED, NON_BUFFERABLE, BUFFERABLE, NON_CACHEABLE, CACHEABLE} e_hprot;
typedef enum bit 	   { OKAY, ERROR } e_hresp;

  

Address Data Object

Since AHB transactions require the master to send an address for all beats in a burst, we can reduce burden on the AHB driver by calculating addresses beforehand when data is randomized. As long as the start address is known along with the size of transfer,t this can be easily calculated. These address data pairs can be stored using an intermediate class as shown below.

  
  
class ahb_addr_data extends uvm_object;
  rand bit [31:0] m_addr;
  rand bit [31:0] m_data;
  
  `uvm_object_utils_begin(ahb_addr_data)
  `uvm_field_int 	(m_addr, UVM_PRINT)
  `uvm_field_int 	(m_data, UVM_PRINT)
  `uvm_object_utils_end
  
  function new(string name="ahb_addr_data");
    super.new(name);
  endfunction

  

Login to your free account to read more ...

You consent to our cookies if you continue to use our website. To know more about cookies, see our privacy policy. I accept cookies from this site.

Agree