-
Notifications
You must be signed in to change notification settings - Fork 0
/
Current Thoughts on threading.txt
52 lines (45 loc) · 1.88 KB
/
Current Thoughts on threading.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Registers
Each core has own register file
ALU
Each core has ALU
Instructions
Instructions need to be updated to be 32 bits
**** Update Encoder
**** Update Decoder
DSB (Data Synchronization Barrier)
Will stall the pipeline until the memory and write back stage have completed and are Bubbling
Ensures that all operations before the barrier are observed before any operation after the barrier
Exclusive Memory
The load and store to memory will be atomic for the exclusive memory.
During the Decode stage, we check if any other cores is trying to also do an LDRX or STRX and give one core precedence to do it and stall the other cores.
LDREX - Load Exclusive. Load from a spot in memory and watch the address. Lock is broken if a store occurs at the address from an unexclusive stor or different process wrote to the address
STREX - Store Exclusive. Store a value into a spot in memory if the lock is still there. Returns success or failure
CLREX - Clear the exclusive lock on a memory address
* Only a single memory address can have a lock at a time
Atomics - Will stall the pipeline until the writeback phase has been completed for an instruction
- Atomic operations are macros!!!!!! We have use for macros
Store
Load
FetchAdd
FetchSub
FetchAnd
FetchOr
FetchXor
Exchange
CompareExchange
How an atomic operation genneraly work
DSB - Data Barrier
LDREX - Load the value exclusively
OPERATION - Perform the operation
STREX - Attempt to store it
CMP 0 - Was the storage successful
JNE - Try again if it failed
DSB - Data Barrier
Status
Instructions that update the status register cannot use the status register as a destination
Move is allowed to use the status register as a destination
Core Instructions
Yield - Set a bit in the signal register
WaitForSignal - Waits for a specific mask to be meet
Register
Core Signal Register