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

Read the value of Register #61

Open
igordptx opened this issue Mar 30, 2021 · 3 comments
Open

Read the value of Register #61

igordptx opened this issue Mar 30, 2021 · 3 comments

Comments

@igordptx
Copy link

Not sure if it is an issue, but I how do I read a register value outside the p4 program? Is it possible to do it from the p4runtime?

@emdneto
Copy link

emdneto commented Mar 31, 2021

I'm not sure if I understand your question, but you can try to create a register.h file for example, and include this file in the p4 program.

register.h to store hex.
#define REGISTER(N) {0:N(0xc1c15899)}
program.p4
#include "register.h"

You can also create tables for information parameters, and with that insert through p4runtime-shell.

@igordptx
Copy link
Author

igordptx commented Apr 2, 2021

Thank you. I understand how to define a register in the p4 program. I dont understand how to query its value from the runtime shell.

@jafingerhut
Copy link
Collaborator

If you are using p4runtime-shell with the simple_switch_grpc process, then its P4Runtime API support today does not support reading & writing registers via the P4Runtime API. Support would have to be added there before it could possibly work via p4runtime-shell, if I understand correctly: p4lang/PI#376

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

3 participants