Skip to content

Commit

Permalink
[i2c,dv] Capture the transfer direction into .dir for Agent-Target tr…
Browse files Browse the repository at this point in the history
…ansfers

This was already present for the Agent-Controller code, but missed on the target-side.

Signed-off-by: Harry Callahan <[email protected]>
  • Loading branch information
hcallahan-lowrisc committed Jul 5, 2024
1 parent 07b23ab commit 1d9f15f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hw/dv/sv/i2c_agent/i2c_item.sv
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class i2c_item extends uvm_sequence_item;
`uvm_field_int(tran_id, UVM_DEFAULT | UVM_DEC)
`uvm_field_enum(bus_op_e, bus_op, UVM_DEFAULT)
`uvm_field_int(addr, UVM_DEFAULT)
`uvm_field_enum(i2c_pkg::rw_e, dir, UVM_DEFAULT | UVM_NOPRINT)
`uvm_field_enum(i2c_pkg::rw_e, dir, UVM_DEFAULT)
`uvm_field_enum(i2c_pkg::acknack_e, addr_ack, UVM_DEFAULT)
`uvm_field_int(num_data, UVM_DEFAULT | UVM_NOPRINT)
`uvm_field_queue_int(data_q, UVM_DEFAULT | UVM_NOPRINT)
Expand Down
3 changes: 2 additions & 1 deletion hw/dv/sv/i2c_agent/i2c_monitor.sv
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ class i2c_monitor extends dv_base_monitor #(
cfg.stop_perf_monitor.trigger();

mon_dut_item.state = i2c_agent_pkg::StAddrByteRcvd; // Signal the addr+dir is captured
mon_dut_item.bus_op = (rw_req) ? BusOpRead : BusOpWrite;
mon_dut_item.dir = rw_e'(rw_req);
mon_dut_item.bus_op = (mon_dut_item.dir == i2c_pkg::READ) ? BusOpRead : BusOpWrite;

`uvm_info(`gfn, $sformatf("target_address_thread(): req_analysis_port.write()"), UVM_DEBUG)
`downcast(clone_item, mon_dut_item.clone());
Expand Down

0 comments on commit 1d9f15f

Please sign in to comment.