You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ulp: add documentation for JUMPS instruction conditions
Hardware implements conditions LE, LT, GE, and conditions EQ and GT
are implemented in the assembler by emitting two JUMPS instructions
with other conditions.
Copy file name to clipboardExpand all lines: docs/en/api-guides/ulp_instruction_set.rst
+20-1Lines changed: 20 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -512,10 +512,29 @@ Note that when accessing RTC memories and RTC registers, ULP coprocessor has low
512
512
- *Condition*:
513
513
- *EQ* (equal) – jump if value in stage_cnt == threshold
514
514
- *LT* (less than) – jump if value in stage_cnt < threshold
515
+
- *LE* (less or equal) - jump if value in stage_cnt <= threshold
515
516
- *GT* (greater than) – jump if value in stage_cnt > threshold
517
+
- *GE* (greater or equal) — jump if value in stage_cnt >= threshold
516
518
517
519
**Cycles**
518
-
2 cycles to execute, 2 cycles to fetch next instruction
520
+
Conditions *LE*, *LT*, *GE*: 2 cycles to execute, 2 cycles to fetch next instruction
521
+
522
+
Conditions *EQ*, *GT* are implemented in the assembler using two **JUMPS** instructions::
523
+
524
+
// JUMPS target, threshold, EQ is implemented as:
525
+
526
+
JUMPS next, threshold, LT
527
+
JUMPS target, threshold, LE
528
+
next:
529
+
530
+
// JUMPS target, threshold, GT is implemented as:
531
+
532
+
JUMPS next, threshold, LE
533
+
JUMPS target, threshold, GE
534
+
next:
535
+
536
+
Therefore the execution time will depend on the branches taken: either 2 cycles to execute + 2 cycles to fetch, or 4 cycles to execute + 4 cycles to fetch.
537
+
519
538
520
539
**Description**
521
540
The instruction makes a jump to a relative address if condition is true. Condition is the result of comparison of count register value and threshold value.
0 commit comments