-
Notifications
You must be signed in to change notification settings - Fork 792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Sival, i2c] chip_sw_i2c_speed test #20436
Conversation
dif_result_t dif_i2c_read_bytes(const dif_i2c_t *i2c, size_t size, | ||
uint8_t *buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue that this belongs in an i2c_testutils, not the DIFs. It imposes blocking semantics, where it probably ought to allow for some sort of timeout + bytes actually read, which then might require other IPs for measuring. This is target mode, so our device here doesn't have control of timing or whether a transaction will ever complete.
390fda5
to
5819939
Compare
Signed-off-by: Douglas Reis <[email protected]>
5819939
to
3ea088b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look correct to me, thanks @engdoreis. I haven't checked the tests in depth, but if they pass then that's good enough for me.
I agree with @a-will that those blocking difs might be better off in testutils with a timeout.
a0629e9
to
ce7dcca
Compare
For reference, the opentitan/sw/device/lib/dif/dif_spi_host.c Lines 175 to 193 in 9fe2120
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the i2c block really well but overall this looks good to me.
11da589
to
d27d10b
Compare
Signed-off-by: Douglas Reis <[email protected]>
Signed-off-by: Douglas Reis <[email protected]>
Signed-off-by: Douglas Reis <[email protected]>
Signed-off-by: Douglas Reis <[email protected]>
d27d10b
to
2632de8
Compare
Signed-off-by: Douglas Reis <[email protected]>
Signed-off-by: Douglas Reis <[email protected]>
Signed-off-by: Douglas Reis <[email protected]>
Signed-off-by: Douglas Reis <[email protected]>
2632de8
to
ef62757
Compare
FYI, that is merely a past mistake that should not be used as a reference. That function also should not have been in the DIFs. However, there is a significant difference between I2C in target mode and spi_host, as I pointed out in the last line: Our I2C device here doesn't have control of timing or whether a transaction will ever complete. By contrast, spi_host is guaranteed to make forward progress to its end state. That is why the i2c functions need to be in testutils and make effective use of timeouts. |
That makes sense, I'll move the functions to the testutils when working on i2c_dev tests. |
Successfully created backport PR for |
This PR:
Fix #19836