[i2c, dv] Updates for both i2c_agent and i2c_sanity
1) i2c_agent
- Add knob to control target address mode (7-bit: current support, 10-bit: RFU)
- Update agent to support re-programming registers from test
- Remove unused macros
2) i2c_sanity
- Support re-programming timing regs during tranceiving tran in i2c_sanity
- Add knob to control target address mode
Signed-off-by: Tung Hoang <tung.hoang.290780@gmail.com>
diff --git a/hw/dv/sv/i2c_agent/i2c_device_driver.sv b/hw/dv/sv/i2c_agent/i2c_device_driver.sv
index a9e9cd9..362880e 100644
--- a/hw/dv/sv/i2c_agent/i2c_device_driver.sv
+++ b/hw/dv/sv/i2c_agent/i2c_device_driver.sv
@@ -6,11 +6,9 @@
`uvm_component_utils(i2c_device_driver)
`uvm_component_new
- bit [I2C_DATA_WIDTH-1:0] data;
+ rand bit [7:0] rd_data;
- rand bit [I2C_DATA_WIDTH-1:0] rd_data;
-
- constraint rd_data_c { rd_data inside {[0 : ((1 << I2C_DATA_WIDTH) - 1)]}; }
+ constraint rd_data_c { rd_data inside {[0 : 127]}; }
virtual task get_and_drive();
i2c_item rsp_item;
@@ -26,7 +24,7 @@
end
RdData: begin
`DV_CHECK_MEMBER_RANDOMIZE_FATAL(rd_data)
- for (int i = I2C_DATA_WIDTH-1; i >= 0; i--) begin
+ for (int i = 7; i >= 0; i--) begin
cfg.vif.device_send_bit(cfg.timing_cfg, rd_data[i]);
end
`uvm_info(`gfn, $sformatf("driver, trans %0d, byte %0d %0b",