-
Notifications
You must be signed in to change notification settings - Fork 0
Xtensa dev #2
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
base: master
Are you sure you want to change the base?
Xtensa dev #2
Conversation
Initial Cadence patch
|
Thanks @ianstcdns, last commit is fixed the issue. Looks like algorithm has been broken. I will look at it. If you want to test, you can run openocd from the esp application main directory with |
|
@ianstcdns this command So, for the upstream we don't need to spend time to fix it. I will investigate it in parallel. |
| XT_REG_IDX_AR13, | ||
| XT_REG_IDX_AR14, | ||
| XT_REG_IDX_AR15, | ||
| XT_REG_IDX_AR16, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ianstcdns Can you please clarify, what is the problem with keeping all the definitions here, so that I can use them in the rtos_xxx_stackings?
|
Hi, Erhan,
The problem is that the XT_REG_* definitions in xtensa_regs.h are much fewer than before—only the core set of registers common to all configurations is defined now. All other registers (e.g. zero-overhead loop, MAC, FPU, etc.) are now dynamically detected from the .cfg TCL definitions and added to xtensa_optregs[] (which contains all core-specific registers not in the now-shorter xtensa_regs[]). It’s worth noting that the order of xtensa_optregs[] may differ depending on the config, and matches the order of how these registers are specified in the .cfg file.
I’m not entirely sure how the RTOS code uses these offsets, but you may want to define them at runtime instead of compile-time so they match what is now done in xtensa_write_dirty_registers() and xtensa_fetch_all_regs()…where the first XT_NUM_REGS refer to xtensa_regs[] indices and the remaining refer to xtensa_optregs[] indices (with XT_NUM_REGS subtracted).
The other, perhaps easier, option is to define them in an esp-core-specific file such that they match the order in the .cfg file. Maybe this is a reasonable first-step to getting this part of the code functional?
Thoughts/suggestions welcome.
Thanks,
--ian
From: Erhan Kurubas ***@***.***>
Sent: Tuesday, May 31, 2022 3:06 AM
To: erhankur/openocd-esp32 ***@***.***>
Cc: Ian Thompson ***@***.***>; Mention ***@***.***>
Subject: Re: [erhankur/openocd-esp32] Xtensa dev (PR #2)
EXTERNAL MAIL
@erhankur commented on this pull request.
________________________________
In src/target/xtensa/xtensa_regs.h<https://urldefense.com/v3/__https:/github.com/erhankur/openocd-esp32/pull/2*discussion_r885450679__;Iw!!EHscmS1ygiU1lA!G_qRfek7FdE-ETu45-puBdEB8uPs9LaW3GNo_sSG9tAr3ckXQ3rcHuu6QtSjvvA0tU-L7IXUTSdnAHIR91hSrg$>:
@@ -40,152 +44,23 @@ enum xtensa_reg_id {
XT_REG_IDX_AR13,
XT_REG_IDX_AR14,
XT_REG_IDX_AR15,
- XT_REG_IDX_AR16,
@ianstcdns<https://urldefense.com/v3/__https:/github.com/ianstcdns__;!!EHscmS1ygiU1lA!G_qRfek7FdE-ETu45-puBdEB8uPs9LaW3GNo_sSG9tAr3ckXQ3rcHuu6QtSjvvA0tU-L7IXUTSdnAHL79is6Pg$> Can you please clarify, what is the problem with keeping all the definitions here, so that I can use them in the rtos_xxx_stackings?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/erhankur/openocd-esp32/pull/2*pullrequestreview-990180397__;Iw!!EHscmS1ygiU1lA!G_qRfek7FdE-ETu45-puBdEB8uPs9LaW3GNo_sSG9tAr3ckXQ3rcHuu6QtSjvvA0tU-L7IXUTSdnAHK_m1S7KQ$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AYE3N6MZWLAJS27CBJZHUT3VMXP7LANCNFSM5XFGYD2Q__;!!EHscmS1ygiU1lA!G_qRfek7FdE-ETu45-puBdEB8uPs9LaW3GNo_sSG9tAr3ckXQ3rcHuu6QtSjvvA0tU-L7IXUTSdnAHK-Z91p-A$>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
|
The other, perhaps easier, option is to define them in an esp-core-specific file such that they match the order in the .cfg file. Maybe this is a reasonable first-step to getting this part of the code functional? Yes this is probably the way I will go in the first place. And my 2nd question; How did you generate the |
|
Our RI.8 and newer tools generate these files automatically, based on the core’s config library. You’d need to run “xt-gdb --dump-oocd-config” from your xtensa shell. You don’t need to software-upgrade your core—as long as you use the new xt-gdb and point it at an existing config through the --xtensa-system parameter, that should allow you to generate one. Or, if you can point me to where I can download your Xtensa configs (not the Espressif tools wrappers), I can try to generate them for you.
Also, thanks for the code format fixes. I’ll pull these down on our end. If there are more clean-ups you’ve found that Antonio/Tomas want to see, I’m happy to make those too. Really appreciate it.
…--ian
From: Erhan Kurubas ***@***.***>
Sent: Tuesday, May 31, 2022 8:37 AM
To: erhankur/openocd-esp32 ***@***.***>
Cc: Ian Thompson ***@***.***>; Mention ***@***.***>
Subject: Re: [erhankur/openocd-esp32] Xtensa dev (PR #2)
EXTERNAL MAIL
The other, perhaps easier, option is to define them in an esp-core-specific file such that they match the order in the .cfg file. Maybe this is a reasonable first-step to getting this part of the code functional?
Yes this is probably the way I will go in the first place.
And my 2nd question;
How did you generate the xtensa-core-esp32s2.cfg ? What was your source for the register list and how did you mask them properly ? I would like to check and do for the others.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/erhankur/openocd-esp32/pull/2*issuecomment-1142296649__;Iw!!EHscmS1ygiU1lA!EQZ4uz8uQEFyceFPYesKf-rkWxk7X94MRqThEbJg3FOlyYZS_F-ORno1wB4eJiajLiTjr7uKV48CbLp_lN27Og$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AYE3N6N7VSXMV3CZATL5Z53VMYW2DANCNFSM5XFGYD2Q__;!!EHscmS1ygiU1lA!EQZ4uz8uQEFyceFPYesKf-rkWxk7X94MRqThEbJg3FOlyYZS_F-ORno1wB4eJiajLiTjr7uKV48CbLrsjbddsg$>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
|
If there are more clean-ups you’ve found that Antonio/Tomas want to see, I’m happy to make those too. Really appreciate it. Probably yes, some more formatting, type checks, casting needs to be resolved. I'll switch to your own branch, make changes and create a PR there. Then you can directly create a patch for the upstream. Can you please update it with my latest patchset 44 and formatting I made here? |
|
I’ll also pull in your patchset 44 and push back to your github/xtensa-dev. I should be able to get that done later today.
I was planning to wait to submit our patch upstream until your 6940 review gets merged. It seems like it’s getting pretty close now…or do you think that may still take a while to wrap up?
Thanks,
--ian
From: Erhan Kurubas ***@***.***>
Sent: Tuesday, May 31, 2022 11:00 AM
To: erhankur/openocd-esp32 ***@***.***>
Cc: Ian Thompson ***@***.***>; Mention ***@***.***>
Subject: Re: [erhankur/openocd-esp32] Xtensa dev (PR #2)
EXTERNAL MAIL
I_f there are more clean-ups you’ve found that Antonio/Tomas want to see, I’m happy to make those too. Really appreciate it._
Probably yes, some more formatting, type checks, casting needs to be resolved. I'll switch to your own branch, make changes and create a PR there. Then you can directly create a patch for the upstream.
Can you please update it with my latest patchset 44 and formatting I made here?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/erhankur/openocd-esp32/pull/2*issuecomment-1142442715__;Iw!!EHscmS1ygiU1lA!BVmxCrIanl-3YWFk0VTMMQ_GSB2Gf3UmvAl0_TsCFzIz1UKomzbsHUDuEvVdjO0mgFAEiSnf_WlSwHZFKLrIvg$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AYE3N6KXP4SREZMBDYVKSCTVMZHR7ANCNFSM5XFGYD2Q__;!!EHscmS1ygiU1lA!BVmxCrIanl-3YWFk0VTMMQ_GSB2Gf3UmvAl0_TsCFzIz1UKomzbsHUDuEvVdjO0mgFAEiSnf_WlSwHYyyiqItw$>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
|
6940 will be merged at the weekend I guess. Finally, there is nothing to do. Actually before create your patch, I would like to push the guys for ESP32 review. It has SMP support and with ESP32-S2 it will be a good base for the other upcoming patches such as semihosting, flash support, FreeRTOS support.. And I don't think review will take much time as 6940. Of course, In the meantime, we can get your xtensa patch ready. What do you think? |
|
How extensive is the S2 review relative to 6940? What I’m hoping to accomplish is to get all of our and your changes accepted well before their code freeze date, which might be in 3 months. If you think it’s realistic for the S2 review to be merged within a couple of weeks then I’m fine with waiting on our generic xtensa patch. Guessing there will be too many conflicts to have both in Gerrit at the same time?
From: Erhan Kurubas ***@***.***>
Sent: Tuesday, May 31, 2022 11:33 AM
To: erhankur/openocd-esp32 ***@***.***>
Cc: Ian Thompson ***@***.***>; Mention ***@***.***>
Subject: Re: [erhankur/openocd-esp32] Xtensa dev (PR #2)
EXTERNAL MAIL
6940 will be merged at the weekend I guess. Finally, there is nothing to do.
Actually before create your patch, I would like to push the guys for ESP32 review. It has SMP support and with ESP32-S2 it will be a good base for the other upcoming patches such as semihosting, flash support, FreeRTOS support.. And I don't think review will take much time as 6940.
And the other reason, they spent a lot of time for the xtensa review in 6940. With your new patch, we will almost drop all previous code base and will ask them another round of reviews. I think a small xtensa break would be better.
Of course, In the meantime, we can get your xtensa patch ready.
What do you think?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/erhankur/openocd-esp32/pull/2*issuecomment-1142513286__;Iw!!EHscmS1ygiU1lA!HRT013NnE3_HxaqxD6FPlrxzTmgrwk8KCJX53iQTpIo8XCfBEWODBT_aIlsCS3Tn-cWcXtkaHjKS77P8G3VKgA$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AYE3N6OOO2V4D3WBHXFMX2TVMZLPFANCNFSM5XFGYD2Q__;!!EHscmS1ygiU1lA!HRT013NnE3_HxaqxD6FPlrxzTmgrwk8KCJX53iQTpIo8XCfBEWODBT_aIlsCS3Tn-cWcXtkaHjKS77Nym0uxDg$>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
|
Comparing to line count, it is %60 less. 5154 to 1981. During freeze, review will go ahead with the limited workforce but nothing will be merged. To be realistic, I am expecting around 1 year for all Espressif patches. |
Stubbed out TIE/user registers with misc0 contents
#0 0x10c41485f in __asan_memcpy+0x1af (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x4285f)
#1 0x10ab3dcfd in buf_cpy binarybuffer.c:60
#2 0x10ab2774b in rtos_generic_stack_read rtos.c:664
#3 0x10aac3ed9 in freertos_get_thread_registers_from_stack FreeRTOS.c:1148
#4 0x10aab2ea2 in freertos_get_thread_reg_list FreeRTOS.c:1238
#5 0x10aab32b1 in freertos_get_thread_reg FreeRTOS.c:1269
#6 0x10aabe903 in freertos_get_tasks_details FreeRTOS.c:797
espressif#7 0x10aab270f in freertos_update_threads FreeRTOS.c:1060
espressif#8 0x10ab1d66e in rtos_thread_packet rtos.c:395
espressif#9 0x10ab1bad2 in gdb_thread_packet rtos.c:191
espressif#10 0x10aa4643d in gdb_input_inner gdb_server.c:3547
espressif#11 0x10aa3d534 in gdb_input gdb_server.c:3743
espressif#12 0x10aa8e565 in server_loop server.c:566
espressif#13 0x1099f6e66 in openocd_thread openocd.c:380
espressif#14 0x1099f685e in openocd_main openocd.c:419
espressif#15 0x1099f52b1 in main main.c:40
espressif#16 0x7fff6bf78cc8 in start+0x0 (libdyld.dylib:x86_64+0x1acc8)
Pull Request Template
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Type of change
User Impact
Please describe the impact of this change. This can be a list of positive and/or negative impacts.
Performance Impact
Please describe any relevant performance impact of this change. This can be positive or negative impact. How did you characterize/test the performance impact?
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Hardware Configuration:
Software Configuration:
Checklist: