Difference between revisions of "ARM processor"

From Wiki at Neela Nurseries
Jump to: navigation, search
m (Make note of search for Armv8-M Architecture Reference Manual ID28092022)
m (^ Synchronization Primitives LDREX and STREX: - link to article by Raymond Chen)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
  
== OVERVIEW ==
+
== [[#top|^]] OVERVIEW ==
  
 
This page for notes on ARM processor architecture, and related ARM IP works.
 
This page for notes on ARM processor architecture, and related ARM IP works.
Line 14: Line 14:
 
<!-- comentario -->
 
<!-- comentario -->
  
== Advanced Hardware Bus AHB ==
+
== [[#top|^]] Advanced Hardware Bus AHB ==
  
 
ARM architecture and related IP, link to AHB paper by Rinku 1, Pawan Kumar Dahiya 2
 
ARM architecture and related IP, link to AHB paper by Rinku 1, Pawan Kumar Dahiya 2
  
 
*  https://www.iosrjournals.org/iosr-jvlsi/papers/vol7-issue4/Version-1/H0704015156.pdf
 
*  https://www.iosrjournals.org/iosr-jvlsi/papers/vol7-issue4/Version-1/H0704015156.pdf
 +
 +
<!-- comentario -->
 +
 +
== [[#top|^]] Synchronization Primitives LDREX and STREX ==
 +
 +
ARM Synchronization Primitives LDREX and STREX, split a normally atomic memory write operation and allow for checking whether other Processing Elements or "bus primaries" <i>(note 1)</i> are also accessing the given memory location.  From the short documentations linked below, it looks like LDREX updates local and global resource access monitors in certain ARM variants, and STREX either succeeds or fails based on checking one or both of those monitors, depending on whether the memory or resource is shared or not shared among multiple processing elements (PEs).
 +
 +
Article locally numbered (3) in the following list of URLs introduces a comparative concept in its text "The Data Memory Barrier existed before ARMv7 as a cp15 operation, but ARMv7 introduced a dedicated instruction, DMB."
 +
 +
<ul>
 +
*  (1) https://developer.arm.com/documentation/dht0008/a/ch01s02s01
 +
*  (2) https://developer.arm.com/documentation/dht0008/a/arm-synchronization-primitives/exclusive-accesses/exclusive-monitors
 +
*  (3) https://developer.arm.com/documentation/dht0008/a/arm-synchronization-primitives/exclusive-accesses/memory-barriers
 +
</ul>
 +
 +
Abbreviations:
 +
{| class="wikitable"
 +
|-
 +
|abbr ERG || Exclusive Reservation Granuale, refers to smallest memory regions which Exclusive Monitors are able to tag for exclusive access || ARM Developer docs
 +
|-
 +
|abbr SCU || Snoop Control Unit || ARM Developer docs
 +
|-
 +
|abbr&nbsp;KPCR || Kernel Processor Control Region || arm_assembler_primer.html
 +
|}
 +
 +
2023-04-17 Monday<br />
 +
 +
Searching for an example assembly code snippet calling `STREX` and branching conditionally based on result.  Search string is "arm assembly strex and branch example".  First found results include:
 +
 +
*  https://codemachine.com/articles/arm_assembler_primer.html
 +
*  https://developer.arm.com/documentation/dui0489/c/arm-and-thumb-instructions/memory-access-instructions/ldrex-and-strex
 +
Article by Raymond Chen:
 +
*  https://devblogs.microsoft.com/oldnewthing/20210614-00/?p=105307
 +
 +
Excerpt:
 +
<pre>
 +
    MOV r1, #0x1                ; load the 'lock taken' value
 +
try
 +
    LDREX r0, [LockAddr]        ; load the lock value
 +
    CMP r0, #0                  ; is the lock free?
 +
    STREXEQ r0, r1, [LockAddr]  ; try and claim the lock
 +
    CMPEQ r0, #0                ; did this succeed?
 +
    BNE try                    ; no - try again
 +
    ....                        ; yes - we have the lock
 +
</pre>
 +
 +
<!-- comentario -->
 +
 +
  
  
  
 
<!-- EOF -->
 
<!-- EOF -->

Latest revision as of 20:49, 17 April 2023

^ OVERVIEW

This page for notes on ARM processor architecture, and related ARM IP works.


ARM Architecture and Instruction Set Notes

[ ] . . . search for Armv8-M Architecture Reference Manual ID28092022


^ Advanced Hardware Bus AHB

ARM architecture and related IP, link to AHB paper by Rinku 1, Pawan Kumar Dahiya 2


^ Synchronization Primitives LDREX and STREX

ARM Synchronization Primitives LDREX and STREX, split a normally atomic memory write operation and allow for checking whether other Processing Elements or "bus primaries" (note 1) are also accessing the given memory location. From the short documentations linked below, it looks like LDREX updates local and global resource access monitors in certain ARM variants, and STREX either succeeds or fails based on checking one or both of those monitors, depending on whether the memory or resource is shared or not shared among multiple processing elements (PEs).

Article locally numbered (3) in the following list of URLs introduces a comparative concept in its text "The Data Memory Barrier existed before ARMv7 as a cp15 operation, but ARMv7 introduced a dedicated instruction, DMB."

Abbreviations:

abbr ERG Exclusive Reservation Granuale, refers to smallest memory regions which Exclusive Monitors are able to tag for exclusive access ARM Developer docs
abbr SCU Snoop Control Unit ARM Developer docs
abbr KPCR Kernel Processor Control Region arm_assembler_primer.html

2023-04-17 Monday

Searching for an example assembly code snippet calling `STREX` and branching conditionally based on result. Search string is "arm assembly strex and branch example". First found results include:

Article by Raymond Chen:

Excerpt:

    MOV r1, #0x1                ; load the 'lock taken' value
try
    LDREX r0, [LockAddr]        ; load the lock value
    CMP r0, #0                  ; is the lock free?
    STREXEQ r0, r1, [LockAddr]  ; try and claim the lock
    CMPEQ r0, #0                ; did this succeed?
    BNE try                     ; no - try again
    ....                        ; yes - we have the lock