Closed diantaowang closed 2 weeks ago
"Program order" is the sequence of a single hart's dynamic instruction stream.
The example you gave is more complicated than is necessary to demonstrate the CoRR requirement. Consider this simpler one:
hart 0 | hart 1 |
---|---|
(a) li t0, 1 |
(c) lw a0,0(s0) |
(b) sw t0,0(s0) |
(d) lw a1,0(s0) |
The three legal outcomes are a0=a1=0, a0=a1=1, and a0=0/a1=1. a0=1/a1=0 is not a legal outcome because (c) precedes (d) in the global memory order.
Thanks! I got it.
The original text is as follows:
b
is a store, anda
andb
access overlapping memory addressesa
andb
are loads,x
is a byte read by botha
andb
, there is no store tox
betweena
andb
in program order, anda
andb
return values forx
written by different memory operationsa
is generated by an AMO or SC instruction,b
is a load, andb
returns a value written bya
I can't understand the rule-2 (the load-load situation).
a
andb
in program order...”. What the meaning of "program order"? Furthermore, does it refers to the program order on a single hart, or the program order on all harts? I think it refers to the program order on a single hart.x
written by different memory operations? Please give an example.I guess that:
li t0, 2
li t0, 1
sw t0,0(s0)
sw t0,0(s0)
lw a0,0(s0)
lw a1,0(s0)
Global memory order (d)(f)(b)(e) is prohibited because (e) and (f) return values from the same address written by different memory operations.
Thanks!