p4runtime-shell icon indicating copy to clipboard operation
p4runtime-shell copied to clipboard

Read the value of Register

Open igordptx opened this issue 4 years ago • 3 comments

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?

igordptx avatar Mar 30 '21 08:03 igordptx

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.

emdneto avatar Mar 31 '21 13:03 emdneto

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.

igordptx avatar Apr 02 '21 07:04 igordptx

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: https://github.com/p4lang/PI/issues/376

jafingerhut avatar Apr 02 '21 18:04 jafingerhut