-
Notifications
You must be signed in to change notification settings - Fork 1
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
I3C peripheral updates and integration tests #41
Conversation
5ba3aa7
to
f5e1c48
Compare
emulator/periph/src/i3c.rs
Outdated
use emulator_cpu::Irq; | ||
use emulator_registers_generated::i3c::I3cPeripheral; | ||
use emulator_types::{RvData, RvSize}; | ||
use registers_generated::i3c::bits::InterruptEnable; | ||
use registers_generated::i3c::bits::InterruptStatus; | ||
use registers_generated::i3c::bits::StbyCrDeviceAddr; |
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.
minor: is it better to combine them into a single use statement?
/// TX Command in u32 | ||
tti_tx_desc_queue_raw: VecDeque<u32>, | ||
/// TX DATA in u32 | ||
tti_tx_data_raw: VecDeque<u8>, | ||
tti_tx_data_raw: VecDeque<Vec<u8>>, |
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.
Minor: comment should be updated. /// TX DATA in u8
@@ -273,18 +273,10 @@ impl<'a, A: Alarm<'a>> I3CCore<'a, A> { | |||
} |
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.
Is interrupt-status
register a regular type or write1toclear
? If it is write1toclear
, I think we should change this piece of code accordingly.
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.
Ah, you're correct, the docs say "woclr".
d8a0cf7
to
db4bb6c
Compare
This progresses more on the I3C peripheral, correctly queueing writes how the hardware does. We also start on writing a socket protocol so that another thread or program can send reads and writes to the I3C bus. This hasn't been teste yet though. I noticed two bugs that I will address in separate PRs: * The I3C interrupts are not quite working yet. When enabled, they are routed correctly to the kernel handler, but keep getting retriggered and not handled properly. I've disabled the interrupts for now, so the read/write methods need to be called manually. * Alarms are not firing properly. I tried to work around the interrupts not handling correctly by scheduling an alarm to call the read/write methods periodically, but the alarms never fire. I've noticed something similar to this before. I will debug this separately. The biggest piece though is adding new integration tests for the kernel: * A test can be added to `tests/integration/src/lib.rs` * This will build the emulator and firmware with the feature equal to the test name, and then run them. * The test can exit with a non-zero exit code to signal failure. The tests need to built sequentially so that they don't conflict when writing the `layout.ld` linker script (this has to have the same name each time to avoid modifying `RUSTFLAGS` with every invocation; otherwise dependencies are recompiled every single time).
8d30f8c
to
277dc87
Compare
Thanks! |
This progresses more on the I3C peripheral, correctly queueing writes how the hardware does.
We also start on writing a socket protocol so that another thread or program can send reads and writes to the I3C bus. This hasn't been teste yet though.
I noticed two bugs that I will address in separate PRs:
The biggest piece though is adding new integration tests for the kernel:
tests/integration/src/lib.rs
The tests need to built sequentially so that they don't conflict when writing the
layout.ld
linker script (this has to have the same name each time to avoid modifyingRUSTFLAGS
with every invocation; otherwise dependencies are recompiled every single time).