XGMII Driver initialization incomplete
See original GitHub issueThe XGMII Driver initialization is incomplete resulting in a corrupted word on the first transfer.
The _XGMII_Bus
helper class sets it’s value to XGMII IDLE during the __init__
:
https://github.com/cocotb/cocotb/blob/97e28803308d09d2bd885e4279d5036ef9861d42/cocotb/drivers/xgmii.py#L61-L83
But this value is never read during initialization of XGMII(Driver)
…
https://github.com/cocotb/cocotb/blob/97e28803308d09d2bd885e4279d5036ef9861d42/cocotb/drivers/xgmii.py#L122-L140
… and as reading the value clears the internal _integer
buffer of the helper class …
https://github.com/cocotb/cocotb/blob/97e28803308d09d2bd885e4279d5036ef9861d42/cocotb/drivers/xgmii.py#L104-L113
… the first word of the first transaction (actually the PREAMBLE and START byte) is OR’ed with the IDLE value corrupting the transmission.
One way of fixing would be to simply read the value of the bus during __init__
of XGMII(Driver)
and thus clearing the buffer.
self.signal <= self.bus.value
Alternatively (and maybe cleaner) we could remove the default value of the helper class and use the idle
helper of XGMII(Driver)
.
I’ll submit a pull for the latter, as I feel it’s cleaner. Thoughts?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
This was resolved by #1905, right?
@ecg173-bi Have a look here at the type annotation for the XGMIIDriver, the
signal
argument is supposed to be a sim handle not aBus
. I’d suggest the following, assumingstream_in
is your XGMII bus.