v0.0.17: switchboard 0.0.17 SB-447 SB-450 SB-451 SB-452 (#100)
Updates:
- New
umi_loopback()
function that sends a sequence of UMI packets into a block and checks that the sequence coming back is equivalent under the split/merge rules. This can be used for testing UMI packet splitters, packet aggregators, etc. The simplest way to use it is withumi_loopback(umi, N)
, whereumi
is aUmiTxRx
object andN
is the number of packets to send, which are generated randomly withrandom_umi_packet
. You can also pass in your own sequence of packets to send withumi_loopback(umi, LIST_OF_UMI_PACKETS)
. To see an example, check outexamples/umi_fifo_flex/test.py
. - Address alignment:
random_umi_packet
generates properly aligned addresses, andread
/write
check that addresses are aligned. max_bytes
parameter inrandom_umi_packet
: if you pass the optionalmax_bytes
parameter torandom_umi_packet
, it will not return packets with more than that number of data bytes. For example, you could setmax_bytes
=16 if you want to generate packets that can be sent with a 128b data bus.- There is a new method,
merge()
available on UMI packets. For example, if you have twoPyUmiPacket
objects,p
andother
, you can callp.merge(other)
, which will mergeother
intop
according to the UMI merge rules. The method returnsTrue
if successful andFalse
otherwise (in which case the merge is not performed). - The
==
and!=
operators are now implemented forPyUmiPacket
objects. This makes it easier to implement some kinds of tests - to see one example, check outexamples/umi_fifo/test.py
.