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
fix peripheral register read/write for larger ULP addresses
When register addresses less than or equal to 0x3ff are given to the
reg_rd and reg_wr opcodes, these addresses should be used unmodified
as the address in the machine instruction.
In our implementation we split the 10 bit address field of the machine
instruction into two fields, namely "addr" for the lower 8 bits and
"periph_sel" for the upper 2 bits.
We already had a mechanism for determining the periph_sel part for
"full" addresses (e.g. 0x3ff48000), but for direct (ULP) addresses, we
always set periph_sel to 0 instead of using the upper 2 bits from the
given address. This commit fixes that.
Note 1: In binutils-esp32ulp, they don't split the address into these 2
fields but simply put the direct ULP address into a single combined
field of 10 bits, which has the same effect. See: https://github.com/espressif/binutils-esp32ulp/blob/249ec34/gas/config/tc-esp32ulp_esp32.c#L145
Note 2: In the "macro approach" in esp-idf for creating ULP code, they
also use the split field approach (I assume our implementation is
modelled after that) and they also don't handle direct (ULP) addresses
correctly (or seemingly at all). See: https://github.com/espressif/esp-idf/blob/9d34a1c/components/ulp/include/esp32/ulp.h#L349
This commit contributes to being able to eventually assemble the
esp32ulp_ranges.s test from binutils-esp32ulp. It addresses this line:
https://github.com/espressif/binutils-esp32ulp/blob/249ec34/gas/testsuite/gas/esp32ulp/esp32/esp32ulp_ranges.s#L136
0 commit comments