[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
0646a31 to
3e897ea
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>
3e897ea to
eb7d381
Compare
| sw_sys_clk_period_ns[0]); | ||
| fall_cycles = round_up_divide({sw_fall_time_ns[1], sw_fall_time_ns[0]}, | ||
| sw_sys_clk_period_ns[0]); | ||
| endtask |
There was a problem hiding this comment.
Nit: most of your new methods are long enough to justify the fact to add the label, I feel it hard to read without it.
| @@ -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?
| // De-allocate the xfer item in order to send a new transfer | ||
| xfer = null; |
There was a problem hiding this comment.
This is dead code and can be dropped
| 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 hold_stop_time_ns = 4700; |
There was a problem hiding this comment.
Nit: hold_stop_time_ns is actually bus-free time (tBUF) per the I2C spec, not a hold time on the stop condition — same concept as bus_free_time_cycles in i2c_timing_params_t (i2c.h). Same naming carries through to sw_hold_stop_time_ns/stop_hold_cycles in top_chip_dv_i2c_tx_rx_vseq.sv and the backdoor-read in top_chip_dv_i2c_device_tx_rx_vseq.sv. Could you either rename to bus_free_time_ns/bus_free_cycles for consistency, or add a short comment noting it maps to tBUF?
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