assafgedalia Posted September 8, 2015 Report Share Posted September 8, 2015 Hello, let's say i have a sequence, in this sequence i'm reading data using the uvm_do_with macro. an example would be a read transaction in an APB agent. how do i extract the data from it? PARTIAL CODE: virtual task body(); apb_item#(AW, DW) it; case(op_kind) `APB_READ: begin `uvm_do_with(it, { it.address == tr_address; it.rw == op_kind; } );// `uvm_do_with end endcase endtask: body Thx, Assaf Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted September 8, 2015 Report Share Posted September 8, 2015 For a read transfer, it's your driver's job to fill the data field (I'm assuming you have one) of the item with the value present on the PRDATA bus. This way you know that once your item is finished (i.e. you return from `uvm_do_*(...)) you rely on the contents of it.data. I don't really see why you need the case statement in there, though. Quote Link to comment Share on other sites More sharing options...
assafgedalia Posted September 8, 2015 Author Report Share Posted September 8, 2015 Thanks for the answer. i'm using a VIP that is `protected so i don't have access to the driver. all i can do is create a sequence and "feed" it to the driver, inside the sequence i use the code i attached in my previous post. (the case is there because there is also a write option which i omitted) isn't the transaction deleted at the end of the uvm_do_with? otherwise can i use something like this: class sequence; int data; virtual task body(); apb_item#(AW, DW) it; `uvm_do_with(it, { it.address == tr_address; it.rw == op_kind; } );// `uvm_do_with this.data = it.data; endtask: body endclass and then read it from the higher hierarchy the creates the sequence and "feeds" it to the driver? Thx, Assaf Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted September 8, 2015 Report Share Posted September 8, 2015 The item doesn't get deleted after the call to `uvm_do. If the VIP updates data, then your code should work. Quote Link to comment Share on other sites More sharing options...
assafgedalia Posted September 8, 2015 Author Report Share Posted September 8, 2015 ok thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.