Skip to content

Conversation

@rivos-eblot
Copy link

Create a TCP server that supports the QEMU SPI device protocol.

Converts QEMU-compliant SPI device protocol into a simplified version of Verilator SPI DPI, using the Verilator SPI PTY communication channel.

Designed to work with the reworked/simplified Verilator SPI DPI protocol implemented in lowRISC/opentitan#28803

Configuring the timeout is required when dealing with another emulation platform
such as Verilator which is much slower than QEMU

Signed-off-by: Emmanuel Blot <[email protected]>
@rivos-eblot
Copy link
Author

note: Running unit tests with Verilator led to better understand the behavior of the SPI device, see also lowRISC/opentitan#28806

@rivos-eblot rivos-eblot marked this pull request as ready for review November 24, 2025 17:11
Pick command opcode 0xE9 which seems to be never used in most SPI device command sets.

Signed-off-by: Emmanuel Blot <[email protected]>
Move it to a dedicated class

Signed-off-by: Emmanuel Blot <[email protected]>
@rivos-eblot rivos-eblot force-pushed the dev/ebl/vtor_spidev branch 2 times, most recently from 634ee4f to 18a9beb Compare December 2, 2025 13:07
@rivos-eblot
Copy link
Author

Note: I've added a reference to lowRISC/opentitan#28803 to ot/verilator/spi.py header, so it would be easier to recover the actual implementation once this PR is merged.

Copy link

@AlexJones0 AlexJones0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not carefully reviewed the exact details of the SPI protocol implementation, as I think they should be broadly correct if this is working locally. Thanks for adding the references and comments, they're helpful to understand what is going on.

Create a TCP server that supports the QEMU SPI device protocol.
Converts QEMU-compliant SPI device protocol into a simplified version of Verilator SPI DPI,
using the Verilator SPI PTY communication channel.

Signed-off-by: Emmanuel Blot <[email protected]>
Python 3.10 is the current oldest non-EOL'ed supported version.

Signed-off-by: Emmanuel Blot <[email protected]>
@rivos-eblot rivos-eblot merged commit 1ec45e8 into lowRISC:ot-9.2.0 Dec 2, 2025
8 of 10 checks passed
@rivos-eblot rivos-eblot deleted the dev/ebl/vtor_spidev branch December 2, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants