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

Documentation seems wrong about ULP FSM's JUMPR instruction (IDFGH-9574) #10923

Closed
3 tasks done
agarof opened this issue Mar 6, 2023 · 1 comment
Closed
3 tasks done
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@agarof
Copy link

agarof commented Mar 6, 2023

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

There seems to have been an erroneous change in the ULP JUMPR instruction's documentation in v4.4.

In the ESP32 v4.3.4 documentation

Conditions LT, GE, LE and GT: 2 cycles to execute, 2 cycles to fetch next instruction
Conditions LE and GT are implemented in the assembler using one JUMPR instructions:
[...]
Conditions EQ is implemented in the assembler using two JUMPR instructions:

In the ESP32 v4.4.4 documentation

Conditions EQ, GT and LT: 2 cycles to execute, 2 cycles to fetch next instruction Conditions LE and GE are implemented in the assembler using two JUMPR instructions:

The ESP32 v5.0.1 documentation seems unchanged from v4.4.4.

Using a very minimal ulp program, I checked what code was generated for the ESP32 chip in both v4.3.4 and v5.0.1, which resulted in identical output for both versions.

    .text
    jumpr stop,1,CONDITION
stop:
    halt

Here are the code sections of the resulting bin.S files:
CONDITION = lt:

.byte 0x75, 0x6c, 0x70, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x82
.byte 0x00, 0x00, 0x00, 0xb0

CONDITION = gt:

.byte 0x75, 0x6c, 0x70, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x82
.byte 0x00, 0x00, 0x00, 0xb0

CONDITION = le:

.byte 0x75, 0x6c, 0x70, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x82
.byte 0x00, 0x00, 0x00, 0xb0

CONDITION = ge:

.byte 0x75, 0x6c, 0x70, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x82
.byte 0x00, 0x00, 0x00, 0xb0

CONDITION = eq:

.byte 0x75, 0x6c, 0x70, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x05, 0x82
.byte 0x01, 0x00, 0x03, 0x82, 0x00, 0x00, 0x00, 0xb0

The eq version is one instruction (4 bytes) longer than the others, matching the v4.3.4 documentation.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Mar 6, 2023
@github-actions github-actions bot changed the title Documentation seems wrong about ULP FSM's JUMPR instruction Documentation seems wrong about ULP FSM's JUMPR instruction (IDFGH-9574) Mar 6, 2023
@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development Status: In Progress Work is in progress and removed Status: Opened Issue is new Status: Selected for Development Issue is selected for development labels Mar 8, 2023
@sudeep-mohanty
Copy link
Collaborator

Hi @agarof,
Thanks for bringing this discrepancy to our notice. Indeed, the description for JUMPR instruction for esp32 has been incorrect since v4.4. We will be updating the docs shortly and also back port the changes. Thank you!

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Mar 13, 2023
espressif-bot pushed a commit that referenced this issue Mar 14, 2023
…uctions

This commit updates the incorrect description for the JUMPR and JUMPS
instructions for ULP FSM on esp32/s2/s3.

Closes #10923
espressif-bot pushed a commit that referenced this issue Mar 16, 2023
…uctions

This commit updates the incorrect description for the JUMPR and JUMPS
instructions for ULP FSM on esp32/s2/s3.

Closes #10923
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants