Skip to content

Commit 7de8332

Browse files
committed
Changed directive id for set_seed and push_rand. Got rid of deprecated directives from documentation
1 parent b97c80e commit 7de8332

2 files changed

Lines changed: 15 additions & 42 deletions

File tree

Svc/FpySequencer/FpySequencerTypes.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ module Svc {
107107
STORE_ABS = 73
108108
STORE_ABS_CONST_OFFSET = 74
109109
POP_EVENT = 75
110-
SET_SEED = 77
111-
PUSH_RAND = 78
110+
SET_SEED = 76
111+
PUSH_RAND = 77
112112
}
113113

114114
enum DirectiveErrorCode : U8 {

Svc/FpySequencer/docs/directives.md

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -866,33 +866,7 @@ Pushes the current time, from the `timeCaller` port, to the stack.
866866

867867
**Requirement:** FPY-SEQ-010
868868

869-
## SET_FLAG (67)
870-
Pops a bool off the stack, and sets a command sequencer flag from the value.
871-
872-
| Arg Name | Arg Type | Source | Description |
873-
|----------|----------|--------|-------------|
874-
| flag_idx | U8 | hardcoded | Index of the flag to set |
875-
| value | bool | stack | Value to set the flag to |
876-
877-
| Stack Result Type | Description |
878-
| ------------------|-------------|
879-
| N/A | |
880-
881-
**Requirement:** FPY-SEQ-020
882-
883-
## GET_FLAG (68)
884-
Gets a command sequencer flag and pushes its value to the stack as `FW_SERIALIZE_TRUE_VALUE` or `FW_SERIALIZE_FALSE_VALUE`.
885-
| Arg Name | Arg Type | Source | Description |
886-
|----------|----------|--------|-------------|
887-
| flag_idx | U8 | hardcoded | Index of the flag to get |
888-
889-
| Stack Result Type | Description |
890-
| ------------------|-------------|
891-
| bool | The value of the flag |
892-
893-
**Requirement:** FPY-SEQ-020
894-
895-
## GET_FIELD (69)
869+
## GET_FIELD (67)
896870
Pops an offset (StackSizeType) off the stack. Takes a hard-coded number of bytes from top of stack, and then inside of that a second array of hard-coded number of bytes. The second array is offset by the value previously popped off the stack, with offset 0 meaning the second array starts furthest down the stack. Leaves only the second array of bytes, deleting the surrounding bytes.
897871

898872
| Arg Name | Arg Type | Source | Description |
@@ -907,7 +881,7 @@ Pops an offset (StackSizeType) off the stack. Takes a hard-coded number of bytes
907881

908882
**Requirement:** FPY-SEQ-019
909883

910-
## PEEK (70)
884+
## PEEK (68)
911885
Pops a StackSizeType `offset` off the stack, then a StackSizeType `byteCount`. Let `top` be the top of the stack. Takes the region starting at `top - offset - byteCount` and going to `top - offset`, and pushes this region to the top of the stack.
912886
| Arg Name | Arg Type | Source | Description |
913887
|----------|----------|--------|-------------|
@@ -920,7 +894,7 @@ Pops a StackSizeType `offset` off the stack, then a StackSizeType `byteCount`. L
920894

921895
**Requirement:** FPY-SEQ-009
922896

923-
## STORE_REL (71)
897+
## STORE_REL (69)
924898
Stores a value to a local variable at a runtime-determined offset relative to the current stack frame.
925899

926900
**Preconditions:**
@@ -948,7 +922,7 @@ Stores a value to a local variable at a runtime-determined offset relative to th
948922

949923
**Requirement:** FPY-SEQ-009
950924

951-
## CALL (72)
925+
## CALL (70)
952926
Performs a function call. Pops the target directive index from the stack, saves the return address and current frame pointer to the stack, then transfers control to the target.
953927

954928
**Preconditions:**
@@ -984,7 +958,7 @@ Performs a function call. Pops the target directive index from the stack, saves
984958

985959
**Requirement:** FPY-SEQ-009
986960

987-
## RETURN (73)
961+
## RETURN (71)
988962
Returns from a function call. Restores the caller's execution context and optionally returns a value.
989963

990964
**Preconditions:**
@@ -1033,7 +1007,7 @@ stack_frame_start (restored) stack top
10331007

10341008
**Requirement:** FPY-SEQ-009
10351009

1036-
## LOAD_ABS (74)
1010+
## LOAD_ABS (72)
10371011
Loads a value from an absolute address in the stack (used for global variables), and pushes it to the stack.
10381012

10391013
**Preconditions:**
@@ -1059,7 +1033,7 @@ Loads a value from an absolute address in the stack (used for global variables),
10591033

10601034
**Requirement:** FPY-SEQ-009
10611035

1062-
## STORE_ABS (75)
1036+
## STORE_ABS (73)
10631037
Stores a value to an absolute address in the stack (used for global variables), with the offset determined at runtime.
10641038

10651039
**Preconditions:**
@@ -1084,7 +1058,7 @@ Stores a value to an absolute address in the stack (used for global variables),
10841058

10851059
**Requirement:** FPY-SEQ-009
10861060

1087-
## STORE_ABS_CONST_OFFSET (76)
1061+
## STORE_ABS_CONST_OFFSET (74)
10881062
Stores a value to an absolute address in the stack (used for global variables), with a compile-time-known offset.
10891063

10901064
**Preconditions:**
@@ -1108,7 +1082,7 @@ Stores a value to an absolute address in the stack (used for global variables),
11081082

11091083
**Requirement:** FPY-SEQ-009
11101084

1111-
## POP_EVENT (77)
1085+
## POP_EVENT (75)
11121086
Pops a message size, message, and severity from the stack and emits an F Prime event.
11131087

11141088
**Preconditions:**
@@ -1143,7 +1117,7 @@ Pops a message size, message, and severity from the stack and emits an F Prime e
11431117
| message | bytes | stack | UTF-8 encoded message string. |
11441118
| severity | Fw.LogSeverity | stack | The event severity level. |
11451119

1146-
## SET_SEED (77)
1120+
## SET_SEED (76)
11471121
Pops a `U32` seed value from the stack and uses it to seed the sequencer's internal PRNG.
11481122

11491123
| Arg Name | Arg Type | Source | Description |
@@ -1155,11 +1129,10 @@ Pops a `U32` seed value from the stack and uses it to seed the sequencer's inter
11551129
| N/A | |
11561130

11571131

1158-
## PUSH_RAND (78)
1132+
## PUSH_RAND (77)
11591133
Pushes the next PRNG value to the stack.
1160-
If this is called without seed being set beforehand it will be automatically done based on current time.
1161-
Note that this function uses C++'s random library so it does not qualify as a CSPRNG and is thus not cryptographically secure.
1162-
[](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator)
1134+
If this is called without the seed being manually set beforehand, then the seed will be set based on the current time.
1135+
`PUSH_RAND` uses `std::mt19937` from C++'s random library, a deterministic non-cryptographic PRNG. It is suitable for repeatable pseudo-random values, simulations, randomized sequencing behavior, or tests, but it does not qualify as a [CSPRNG](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator) and is not suitable for cryptographic keys, secrets, authentication tokens, or security-sensitive randomness.
11631136
| Stack Result Type | Description |
11641137
| ------------------|-------------|
11651138
| U32 | The next pseudorandom 32-bit value from the sequencer's internal PRNG |

0 commit comments

Comments
 (0)