Jump to content
soleshka

AHB , bus2reg , reg2bus in hrdata & hwdata

Recommended Posts

Hello Experts,

We have implementation of AHB sequence item having  hwrada as well hrdata data  without any additional override sequence classes for each case.

 

We have  implemented (more properly reused what was there)  the following generic adapter bus2reg implementation :

 virtual function void bus2reg(uvm_sequence_item bus_item, ref uvm_reg_bus_op rw);
        ahb_ivc_seq_item ahb_bus_adapter;
        if (!$cast(ahb_bus_adapter, bus_item)) begin
          `uvm_fatal("NOT_AHB_BUS_ADAPTER_TYPE","Provided bus_item is not of the correct type")
          return;
        end
        rw.kind = (!ahb_bus_adapter.ahb_hwrite) ? UVM_READ : UVM_WRITE;
        rw.addr = ahb_bus_adapter.ahb_haddr;
                                rw.data = ahb_bus_adapter.ahb_hrdata ;
        rw.n_bits = (ahb_bus_adapter.ahb_hsize == 3'b010) ? 32 : 8;
        rw.status = UVM_IS_OK;
    endfunction : bus2reg;

 

Shouldn't there be something like :

//        rw.data = (!ahb_bus_adapter.ahb_hwrite) ? ahb_bus_adapter.ahb_hrdata : ahb_bus_adapter.ahb_hwdata;

instead of the bold line ?

As it seems to me the old peace of code was refering to case there is only one data line..

 

Thank you for any advice ,

Oleg Greenberg

Share this post


Link to post
Share on other sites

The register adapter contains 2 functions:

(1) bus2reg

(2) reg2bus

bus2reg implements the path from the pinlevel interface to the register layer. This is the path which returns the rD-data (ahb_hrdata).

reg2bus implements the path from the register layer to the pimlevel interface. This is the path which is used to send the WR-data ahb_hwdata) from the register layer to the DUT.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...