How atomic is TESTSET?

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

How atomic is TESTSET?

Postby alexrp » Sat Dec 14, 2013 7:40 pm

The architecture manual says that TESTSET is atomic, but how atomic is it? Is it only atomic with respect to other Epiphany cores, or is it atomic with respect to host cores, for instance? This is pretty significant when writing to external memory.
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: How atomic is TESTSET?

Postby aolofsson » Sat Dec 14, 2013 11:10 pm

TESTSET instruction is only atomic when used together with the "epiphany memory" (the distributed chunks of 32KB per core) and does not work on memory outside the Epiphany chip (like DRAM) unless the atomic functionality is implemented within that memory.
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: How atomic is TESTSET?

Postby alexrp » Sun Dec 15, 2013 12:05 am

Does it raise an exception of some kind if used on unsupported memory? Or what exactly happens?

Another thing for the manual. ;)
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: How atomic is TESTSET?

Postby over9000 » Sun Dec 15, 2013 4:28 am

over9000
 
Posts: 98
Joined: Tue Aug 06, 2013 1:49 am

Re: How atomic is TESTSET?

Postby alexrp » Thu Dec 19, 2013 4:13 am

@aolofsson can you confirm that @over9000 is correct in assuming that normal memory accesses to invalid memory will result in undefined behavior?
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: How atomic is TESTSET?

Postby aolofsson » Thu Dec 19, 2013 7:03 pm

Yes, for all practical purposes memory access to unmapped memory (read or write) will cause unpredictable behavior and most likely will cause the system to hang.
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: How atomic is TESTSET?

Postby alexrp » Fri Dec 20, 2013 4:39 am

Two more questions:

1. How would I reset a core that's stuck reading unmapped memory? (This should probably be clarified in the manual too, where it just says that a core will most likely need to be reset.)
2. What happens if a core reads from the two reserved local memory banks? Undefined behavior? Or will it work, but just not be very future-proof? This should probably be documented (in some capacity) too.
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: How atomic is TESTSET?

Postby aolofsson » Thu Jan 02, 2014 3:50 am

1.) We will publish a recipe for resetting a core that is as safe as possible. One of our interns struggled with this task over the summer, it's not straightforward.

Not sure I understand what you mean by the two local reserved memory banks?

2.) The local memory from 0x00000000 to 0x000EFFFF is aliased so reading/writing to any location in this range will work. Address bits [19:15] are simply ignored in the access logic. Behavior should be defined, but code will not be future proof for chips with more memory. (although 19:16=1111 means an MMR access)
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: How atomic is TESTSET?

Postby alexrp » Thu Jan 02, 2014 3:57 am

By reserved memory banks I mean local addresses 0x00008000 and 0x000F0800.
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 19 guests