[opentitantool] Improvements to GPIO for Ti50 host emulation
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
### Description
When `opentitansession` is used to run a ti50 emulation sub-process, GPIO signals are emulated by the sub-process listening on an array of unix sockets (one for each pin) and the session process establishes connections to each of them. Then each end will notify the other about how it drives its end of the emulated signal, by means of sending single characters through the pipe.
There are currently a number of issues:
- `GpioMonitoring` trait is not implemented, this could be useful for testing. Implementing it would probably require the session process to monitor all sockets simultaneously using the `mio` library, in order to notice changes. This could be accompanied by timestamps on the messages through the sockets.
- We want a guarantee that if the sub-process first toggles a GPIO, then prints something on a simulated serial port, and a test script first receives the serial output and then inspects the state of the GPIO, that the test is guaranteed to see the GPIO change. Currently, this is not guaranteed since we perform only a single read from the GPIO socket upon being queried for its state. We probably need some sort of request/response protocol, in order to know how long to keep reading from the GPIO socket, before being guaranteed to see events that happened before the the read operation started.
Contributor guide
Assessment
This issue has not been assessed yet.