From f92bbaaa700cd9eb14e4b585d9c0d4fff53efb5b Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Tue, 5 Jan 2021 23:16:00 -0800 Subject: [PATCH] Update readme --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 93dcef6..552a24e 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,13 @@ To send data into a design with a `GmiiSource`, call `send()` or `send_nowait()` # wait for operation to complete (optional) await gmii_source.wait() +It is also possible to wait for the transmission of a specific frame to complete by passing an event in the tx_complete field of the `GmiiFrame` object, and then awaiting the event. The frame, with simulation time fields set, will be returned in the event data. Example: + + frame = GmiiFrame.from_payload(b'test data', tx_complete=Event()) + await gmii_source.send(frame) + await frame.tx_complete.wait() + print(frame.tx_complete.data.sim_time_sfd) + To receive data with a `GmiiSink`, call `recv()` or `recv_nowait()`. Optionally call `wait()` to wait for new receive data. data = await gmii_sink.recv() @@ -156,6 +163,13 @@ To send data into a design with an `MiiSource`, call `send()` or `send_nowait()` # wait for operation to complete (optional) await mii_source.wait() +It is also possible to wait for the transmission of a specific frame to complete by passing an event in the tx_complete field of the `GmiiFrame` object, and then awaiting the event. The frame, with simulation time fields set, will be returned in the event data. Example: + + frame = GmiiFrame.from_payload(b'test data', tx_complete=Event()) + await mii_source.send(frame) + await frame.tx_complete.wait() + print(frame.tx_complete.data.sim_time_sfd) + To receive data with an `MiiSink`, call `recv()` or `recv_nowait()`. Optionally call `wait()` to wait for new receive data. data = await mii_sink.recv() @@ -238,6 +252,13 @@ To send data into a design with an `RgmiiSource`, call `send()` or `send_nowait( # wait for operation to complete (optional) await rgmii_source.wait() +It is also possible to wait for the transmission of a specific frame to complete by passing an event in the tx_complete field of the `GmiiFrame` object, and then awaiting the event. The frame, with simulation time fields set, will be returned in the event data. Example: + + frame = GmiiFrame.from_payload(b'test data', tx_complete=Event()) + await rgmii_source.send(frame) + await frame.tx_complete.wait() + print(frame.tx_complete.data.sim_time_sfd) + To receive data with an `RgmiiSink`, call `recv()` or `recv_nowait()`. Optionally call `wait()` to wait for new receive data. data = await rgmii_sink.recv() @@ -318,6 +339,13 @@ To send data into a design with an `XgmiiSource`, call `send()` or `send_nowait( # wait for operation to complete (optional) await xgmii_source.wait() +It is also possible to wait for the transmission of a specific frame to complete by passing an event in the tx_complete field of the `XgmiiFrame` object, and then awaiting the event. The frame, with simulation time fields set, will be returned in the event data. Example: + + frame = XgmiiFrame.from_payload(b'test data', tx_complete=Event()) + await xgmii_source.send(frame) + await frame.tx_complete.wait() + print(frame.tx_complete.data.sim_time_sfd) + To receive data with an `XgmiiSink`, call `recv()` or `recv_nowait()`. Optionally call `wait()` to wait for new receive data. data = await xgmii_sink.recv()