Aug 25, 2021
01:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 25, 2021
01:09 AM
Hi,
As per Tasking User Manual ( pg- 82 ) : __imaskldmst is an intrinsic atomic function. But if assembly instructions are checked, imask and ldmst are 2 separate atomic functions. So I have 2 queries on this -
1. How to make sure " __imaskldmst " is really an atomic function ? Similarly for imask, ldmst [ Any method of testing ? I have TC375TP board and Lauterbach debugger hardware with me ]
2. I understand that an atomic function while executing won't service any interrupt during its due process of functioning. Is this understanding correct? For instance, " __imaskldmst " is an atomic function
with 2 instructions i.e inst A, inst B. While __imaskldmst is called and inst A is being performed, an interrupt is serviced at the same very instant. Will the interrupt be serviced at the very moment or will be serviced after
inst B is completed. [Same scenario if ldmst is used instead of __imaskldmst , what would be the expected result ?]
3. Looking to use atomic functions for Multicore implementations. Any specific reading materials/tutorials that can be suggested for a better understanding of these concepts. It would be really helpful for some help here.
**To know the no of instructions, I am using the assembly file and also the performance counter to check. [ Kindly suggest other methods, if this is wrong or if the number of instructions of these functions can be found from manual ]
Thanks !!!
As per Tasking User Manual ( pg- 82 ) : __imaskldmst is an intrinsic atomic function. But if assembly instructions are checked, imask and ldmst are 2 separate atomic functions. So I have 2 queries on this -
1. How to make sure " __imaskldmst " is really an atomic function ? Similarly for imask, ldmst [ Any method of testing ? I have TC375TP board and Lauterbach debugger hardware with me ]
2. I understand that an atomic function while executing won't service any interrupt during its due process of functioning. Is this understanding correct? For instance, " __imaskldmst " is an atomic function
with 2 instructions i.e inst A, inst B. While __imaskldmst is called and inst A is being performed, an interrupt is serviced at the same very instant. Will the interrupt be serviced at the very moment or will be serviced after
inst B is completed. [Same scenario if ldmst is used instead of __imaskldmst , what would be the expected result ?]
3. Looking to use atomic functions for Multicore implementations. Any specific reading materials/tutorials that can be suggested for a better understanding of these concepts. It would be really helpful for some help here.
**To know the no of instructions, I am using the assembly file and also the performance counter to check. [ Kindly suggest other methods, if this is wrong or if the number of instructions of these functions can be found from manual ]
Thanks !!!
2 Replies
Aug 26, 2021
06:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 26, 2021
06:08 AM
See 2.10.3 Store Bit and Bit Field on page 42 of TriCore_TC162P_core_architecture_vol2of2_Instruction_set.pdf for a better example of how IMASK and LDMST work together.
IMASK merely sets up the mask and value; LDMST is the actual atomic Load-Modify-Store instruction. If an interrupt occurs between the IMASK and LDMST instructions, the registers should be saved and restored by the interrupt handler (as usual).
For more information on atomic operations, see 2.4 Semaphores and Atomic Operations on page 20 of TriCore_TC162P_core_architecture_volume_1_of_2.pdf. The details for each instruction are in volume 2.
IMASK merely sets up the mask and value; LDMST is the actual atomic Load-Modify-Store instruction. If an interrupt occurs between the IMASK and LDMST instructions, the registers should be saved and restored by the interrupt handler (as usual).
For more information on atomic operations, see 2.4 Semaphores and Atomic Operations on page 20 of TriCore_TC162P_core_architecture_volume_1_of_2.pdf. The details for each instruction are in volume 2.
Oct 04, 2021
03:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 04, 2021
03:55 AM
Hello Wrangler,
Sorry for the late response on this thread. Went through the documentation and have an additional query. Please help!
Let suppose I want to perform a &= 0xFE using imaskldmst .
Initial value for a, a = 0x20
Imask operation, imask -> a & 0xFE = 0x20 [ bitoffset is 0 ,width is 1 ]
In meantime, an interrupt is serviced and value of a is updated as a= 0x21.
When ldmst is performed after the interrupt is serviced, my understanding is ldmst would function on value a = 0x20 and not a= 0x21. This would also overwrite the value of a i.e 0x21 is overwritte by 0x20 after the imaskldmst operation.
Hence I am loosing the a= 0x21 value which was acheived in the interrupt.
This is my understanding. Please correct me wherever I have gone wrong.
Motive is, the serviced interrupt value i.e a= 0x21, should be available for next cycle of operation.
Thanks !!
Sorry for the late response on this thread. Went through the documentation and have an additional query. Please help!
Let suppose I want to perform a &= 0xFE using imaskldmst .
Initial value for a, a = 0x20
Imask operation, imask -> a & 0xFE = 0x20 [ bitoffset is 0 ,width is 1 ]
In meantime, an interrupt is serviced and value of a is updated as a= 0x21.
When ldmst is performed after the interrupt is serviced, my understanding is ldmst would function on value a = 0x20 and not a= 0x21. This would also overwrite the value of a i.e 0x21 is overwritte by 0x20 after the imaskldmst operation.
Hence I am loosing the a= 0x21 value which was acheived in the interrupt.
This is my understanding. Please correct me wherever I have gone wrong.
Motive is, the serviced interrupt value i.e a= 0x21, should be available for next cycle of operation.
Thanks !!
This widget could not be displayed.