https://github.com/simmsb/p4haskell
P4 backend in haskell
https://github.com/simmsb/p4haskell
compiler cuda gpu p4 p4c p4language
Last synced: about 1 month ago
JSON representation
P4 backend in haskell
- Host: GitHub
- URL: https://github.com/simmsb/p4haskell
- Owner: simmsb
- License: mit
- Created: 2019-09-27T14:57:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-19T00:02:19.000Z (about 5 years ago)
- Last Synced: 2025-01-07T08:19:21.408Z (over 1 year ago)
- Topics: compiler, cuda, gpu, p4, p4c, p4language
- Language: Haskell
- Homepage:
- Size: 888 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# p4haskell
A GPU-accelerated back end for the PR programming language.
# Usage
1. The first step is to compile a p4 program with the GPU back end present in my
fork of the p4c compiler[^1], and dump the AST, for example:
`./build/backends/gpu/p4c-gpu port-forwarding.p4 --toJSON port-forward.json`
2. The next step is to use this compiler to generate a CUDA file, for example:
`stack run -- -i firewall.json > kernel.cu`
3. The final step is to place this CUDA file into the runtime[^2] as
`src/kernel.cu`, and compile the runtime using `cargo build --release`. The
runtime can then be executed using `sudo env
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
target/release/dpdk-gpu-test -s payload_1024.pcap`
[^1]: https://github.com/simmsb/p4c
[^2]: https://github.com/simmsb/dpdk-testing-stuff