[top-i2c,dv] Added chip level I2C Device TX_RX test#633
Conversation
dafa77b to
c434d75
Compare
fbf55a9 to
13af90e
Compare
d5e3010 to
74cf3b0
Compare
74cf3b0 to
0646a31
Compare
engdoreis
left a comment
There was a problem hiding this comment.
I left a suggestion, otherwise it LGTM.
| VOLATILE_WRITE(i2c->txdata, txdata); | ||
| } | ||
|
|
||
| void i2c_clear_cmd_complete(i2c_t i2c) |
There was a problem hiding this comment.
I suggest making a function to clear interrupts that take the interrupt as argument like uart:
mocha/sw/device/lib/hal/uart.c
Line 36 in 3b3b9e2
There was a problem hiding this comment.
Do you mean something like that:
void i2c_clear_intr_state(i2c_t i2c, uint32_t state)
{
VOLATILE_WRITE(i2c->intr_state, state);
}
There was a problem hiding this comment.
Yes, but 'state' would be an enum with the interrupts. It should also accept more then one interrupt per call.
3e897ea to
eb7d381
Compare
| @@ -37,23 +69,42 @@ function int unsigned top_chip_dv_i2c_tx_rx_vseq::round_up_divide(int unsigned a | |||
| endfunction | |||
|
|
|||
| function void top_chip_dv_i2c_tx_rx_vseq::configure_agent_timing(); | |||
There was a problem hiding this comment.
I think these changes also have an impact on top_chip_dv_i2c_host_tx_rx_vseq. Isn't it an issue?
There was a problem hiding this comment.
I don't think that host_tx_rx_test gets affected. I've took these calculations from i2c_base_vseq function get_timing_values(). They look sensible to reason.
There was a problem hiding this comment.
Oh, sorry. I think I didn't answer this question well. These parameters are used to add delays which should depend on the speed of the I2C bus and not on host / device part. So, whatever the speed is just calculate the timing parameter the same way
There was a problem hiding this comment.
Sorry, I was unclear. The issue I see is that you've created the dut_init task for top_chip_dv_i2c_device_tx_rx_vseq to read some SW symbols and then use them in this configure_agent_timing function, all fine here. But in your implementation of top_chip_dv_i2c_host_tx_rx_vseq::dut_init() should also backdoor read these missing SW symbols.
This also needs to be added in host_tx_rx_test.c as done in device_tx_rx_test.c or in a common shared file?
Something like:
const uint16_t scl_high_time_ns = 4000;
const uint16_t setup_data_time_ns = 250;
const uint16_t setup_start_time_ns = 4700;
const uint16_t hold_start_time_ns = 4000;
const uint16_t setup_stop_time_ns = 4000;
const uint16_t bus_free_time_ns = 4700;
const uint16_t rise_time_ns = I2C_RISE_NS;
const uint16_t fall_time_ns = I2C_FALL_NS;9c8cb36 to
eddbdd0
Compare
f4fb13a to
3a94487
Compare
3a94487 to
ca5122a
Compare
A reviewer on lowRISC#633 commented about inconsistency in the naming of tBUF timing parameter accross different places. That made me look at the name of the bus_free_time_cycles field in the i2c_timing_params_t struct and I realized that it is also inconsistent. Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
A reviewer on lowRISC#633 commented about inconsistency in the naming of tBUF timing parameter accross different places. That made me look at the name of the bus_free_time_cycles field in the i2c_timing_params_t struct and I realized that it is also inconsistent. Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
98dc37c to
f048803
Compare
…vice Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
f048803 to
62ae5e7
Compare
| { | ||
| name: i2c_device_tx_rx_cheri | ||
| uvm_test_seq: top_chip_dv_i2c_device_tx_rx_vseq | ||
| sw_images: ["i2c_device_tx_rx_test_vanilla_sram:5" "bootrom:5"] |
There was a problem hiding this comment.
| sw_images: ["i2c_device_tx_rx_test_vanilla_sram:5" "bootrom:5"] | |
| sw_images: ["i2c_device_tx_rx_test_cheri_sram:5" "bootrom:5"] |
| @@ -37,23 +69,42 @@ function int unsigned top_chip_dv_i2c_tx_rx_vseq::round_up_divide(int unsigned a | |||
| endfunction | |||
|
|
|||
| function void top_chip_dv_i2c_tx_rx_vseq::configure_agent_timing(); | |||
There was a problem hiding this comment.
Sorry, I was unclear. The issue I see is that you've created the dut_init task for top_chip_dv_i2c_device_tx_rx_vseq to read some SW symbols and then use them in this configure_agent_timing function, all fine here. But in your implementation of top_chip_dv_i2c_host_tx_rx_vseq::dut_init() should also backdoor read these missing SW symbols.
This also needs to be added in host_tx_rx_test.c as done in device_tx_rx_test.c or in a common shared file?
Something like:
const uint16_t scl_high_time_ns = 4000;
const uint16_t setup_data_time_ns = 250;
const uint16_t setup_start_time_ns = 4700;
const uint16_t hold_start_time_ns = 4000;
const uint16_t setup_stop_time_ns = 4000;
const uint16_t bus_free_time_ns = 4700;
const uint16_t rise_time_ns = I2C_RISE_NS;
const uint16_t fall_time_ns = I2C_FALL_NS;| super.new(name); | ||
| endfunction | ||
|
|
||
| function top_chip_dv_i2c_device_tx_rx_vseq::calc_timing_params_in_cycles(); |
There was a problem hiding this comment.
I think this function should be moved in the top_chip_dv_i2c_tx_rx_vseq as I believe top_chip_dv_i2c_host_tx_rx_vseq also need to have the same thing?
A reviewer on lowRISC#633 commented about inconsistency in the naming of tBUF timing parameter accross different places. That made me look at the name of the bus_free_time_cycles field in the i2c_timing_params_t struct and I realized that it is also inconsistent. Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
Added a host Vseq and device SW. The host will initiate read / write transfer. The device SW waits for the transfers to finish and compare the data bytes in each transfer at the end