Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switchboard 0.0.17 SB-447 SB-450 SB-451 SB-452 #100

Merged
merged 12 commits into from
Aug 31, 2023
Merged

switchboard 0.0.17 SB-447 SB-450 SB-451 SB-452 #100

merged 12 commits into from
Aug 31, 2023

Conversation

sgherbst
Copy link
Contributor

@sgherbst sgherbst commented Aug 27, 2023

The PR introduces several new features:

  • 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 with umi_loopback(umi, N), where umi is a UmiTxRx object and N is the number of packets to send, which are generated randomly with random_umi_packet. You can also pass in your own sequence of packets to send with umi_loopback(umi, LIST_OF_UMI_PACKETS). To see an example, check out the updated examples/umi_fifo_flex/test.py.
  • Address alignment: random_umi_packet generates properly aligned addresses, and read/write check that addresses are aligned.
  • max_bytes parameter in random_umi_packet: if you pass the optional max_bytes parameter to random_umi_packet, it will not return packets with more than that number of data bytes. For example, you could set max_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 two PyUmiPacket objects, p and other, you can call p.merge(other), which will merge other into p according to the UMI merge rules. The method returns True if successful and False otherwise (in which case the merge is not performed).
  • The == and != operators are now implemented for PyUmiPacket objects. This makes it easier to implement some kinds of tests - to see one example, check out the updates to examples/umi_fifo/test.py.

Testing this PR

Change to the branch sgh/loopback.

$ git fetch
$ git checkout sgh/loopback
$ git pull
$ git submodule update --init

Reinstall the Python package.

$ pip install -e .

Update the dependencies used in the examples.

$ cd examples
$ ./get_deps.py

Try out examples, such as umi_fifo_flex.

$ cd umi_fifo_flex
$ make

Other updates

  • Bumped the version of umi and lambdalib in the examples folder
  • resolve() is used on paths in the examples folder

@sgherbst sgherbst changed the title Sgh/loopback switchboard 0.0.17 Aug 27, 2023
@sgherbst sgherbst requested a review from azaidy August 27, 2023 02:44
@sgherbst sgherbst changed the title switchboard 0.0.17 switchboard 0.0.17 SB-447 SB-450 SB-451 SB-452 Aug 27, 2023
@sgherbst sgherbst marked this pull request as ready for review August 27, 2023 02:47
@azaidy
Copy link
Collaborator

azaidy commented Aug 31, 2023

Can the latest umi repo with all bug fixes be used?

@sgherbst
Copy link
Contributor Author

@azaidy sure thing, just pushed that update.

Copy link
Collaborator

@azaidy azaidy left a comment

Choose a reason for hiding this comment

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

LGTM!

examples/umi_endpoint/testbench.sv Outdated Show resolved Hide resolved
@sgherbst sgherbst merged commit 780eef2 into main Aug 31, 2023
5 checks passed
@sgherbst sgherbst deleted the sgh/loopback branch August 31, 2023 21:54
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