Skip to content

Commit a5afc50

Browse files
authored
Add description with examples of simple_switch_CLI register access cmds (#1292)
Signed-off-by: Andy Fingerhut <[email protected]>
1 parent 892c421 commit a5afc50

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

docs/runtime_CLI.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,30 @@ The bmv2 value set implementation does *not* support match types other than
461461
exact.
462462

463463

464+
### register_read, register_write, register_reset
465+
466+
These commands allow you to access a P4 register, sometimes called a
467+
P4 register array, from the CLI.
468+
469+
To read a register named `myreg1` at index 5:
470+
```
471+
RuntimeCmd: register_read myreg1 5
472+
myreg1[5]= 27
473+
```
474+
475+
To write that same register at index 10 with a value of 42:
476+
```
477+
RuntimeCmd: register_write myreg1 10 42
478+
```
479+
480+
To write the values in _all_ indices of a register array `myreg` with
481+
the value 0:
482+
```
483+
RuntimeCmd: register_reset myreg1
484+
```
485+
486+
464487
```
465-
TODO: register_read
466-
TODO: register_reset
467-
TODO: register_write
468488
TODO: reset_state
469489
TODO: serialize_state
470490
TODO: set_crc16_parameters

0 commit comments

Comments
 (0)