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

advance() method is not working as expected #49

Open
harshgondaliya opened this issue Jun 1, 2020 · 2 comments
Open

advance() method is not working as expected #49

harshgondaliya opened this issue Jun 1, 2020 · 2 comments
Assignees

Comments

@harshgondaliya
Copy link

I am trying to advance the packet cursor by 8 bits using the code:
b.advance((bit<32>) 8).
This line of code is actually extracting the bits from the packet header and then
does not emit it back on the packet. I got to know this from the vivado.bash results.

Note: I am using a lookahead() method just before the advance().

@harshgondaliya
Copy link
Author

Similar code (lookahead() followed by advance() ) worked well for v1model architecture.
But, it fails for sume_switch architecture.

@harshgondaliya
Copy link
Author

harshgondaliya commented Jun 23, 2020

I have created a sample P4 code to test the working of advance() method.
I have attached gen_testdata.py, commands.txt, and test-advance.p4 files as .txt file.

This is the ERROR output of ./vivado.bash
I think the cursor is not working properly.

[3351992]  INFO: packet 1 tuple OK < tuple_out_digest_data, tuple_out_sume_metadata > = < 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000004010012 >
[3351992] ERROR: packet mismatch in packet 1 cycle 0
expected (tlast, tkeep, tdata) = (1, 0003ffff, 0000000000000000000000000000030001000000010101010101020202020202)
actual   (tlast, tkeep, tdata) = (1, 0000ffff, 0000000000000000000000000000000003000000010101010101020202020202)

gen_testdata.py.txt
commands.txt
test-advance.p4.txt

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

No branches or pull requests

2 participants