[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - DMA interrupts

DMA interrupts

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

Moderator: aolofsson

DMA interrupts

Postby mipt98 » Mon Jul 29, 2013 12:23 am

Let's say cores 0 and 1 execute different programs (master/slave type), and core 0 writes to core 1 through DMA0 channel. Is it possible to raise interrupt on core 1 as soon as the data transfer is complete? Seems that E_DMA0_INT is not of big help here...
-Ivan
mipt98
 
Posts: 17
Joined: Sat May 25, 2013 12:39 am

Re: DMA interrupts

Postby hewsmike » Mon Jul 29, 2013 12:47 am

You need to do this in ( your ) software by means of a flag of some sort. Thus the receiving core needs to check the value of that to know when the transfer is finished. This flag will be set by the sending core. The key trick is to have the flag memory location accessed via an atomic instruction that has exclusive access ( briefly ) to said location ( as that technique will avoid various perils ).

The TESTSET instruction has such semantics and you can enact, say, a variety of spin-lock which employs busy waiting by the receiving core.

Cheers, Mike.
hewsmike
 
Posts: 85
Joined: Mon Dec 17, 2012 3:20 am

Re: DMA interrupts

Postby hewsmike » Mon Jul 29, 2013 1:26 am

NB : The TESTSET instruction cannot address below 0x00100000 ie. the memory associated with the core/processor which issued the instruction. So this puts the flag in the receiving node's memory, suitably associated with a transfer buffer being written to.

The receiving node will set this flag to indicate a 'ready for transfer' state, when that becomes true the sending node will set the flag to a 'being transferred' state ( ie. contents of buffer not yet valid ), which when the transfer is finalised sets the flag's value to 'transfer completed' ( buffers contents now valid for use ). When the receiving core wants more data, it'll set the flag to 'ready for transfer' again, etc ...

This is one suitable solution ( off the top of my head ), there may be others of course. :D

Cheers, Mike.

( edit ) IIRC there was an important correction to the manual as regards the description of TESTSET, which doesn't change my answer, but will make more sense if you have it. Can't remember right now .....

( edit ) TESTSET correction
hewsmike
 
Posts: 85
Joined: Mon Dec 17, 2012 3:20 am

Re: DMA interrupts

Postby hewsmike » Mon Jul 29, 2013 5:14 am

Does anyone have a little flag on their letter boxes anymore? Meaning a physical letterbox outside their house, with a rotatable flag that the postman sets to 'up' position indicating mail has been delivered. When you empty the box - after having recurrently glanced at the flag from inside the house, to see if it's worth going out to pickup the mail - then you reset the flag to 'down'. This is the idea I'm roughly after, with the added refinement of a 'filling' phase.

Cheers, Mike.
hewsmike
 
Posts: 85
Joined: Mon Dec 17, 2012 3:20 am

Re: DMA interrupts

Postby timpart » Mon Jul 29, 2013 6:37 am

It seems there is a not yet fully tested feature to make the DMA cause an interrupt on the remote core (different to the local core ones).

Flags on mail boxes are just an American thing. I guess it is due to land being very cheap and there is a long path from property boundary to front door. The mailbox is on the boundary and the flag lets the householder know it is worth making the trip to it.

Tim
timpart
 
Posts: 302
Joined: Mon Dec 17, 2012 3:25 am
Location: UK

Re: DMA interrupts

Postby hewsmike » Mon Jul 29, 2013 7:54 am

Well I guess an interrupt mechanism would avoid busy waiting, allowing the receiving core to ( asynchronously ) check a flag set by the interrupt call. Else you'd have to create distinct paths ( or jumps from ) within the interrupt handler per DMA target - perhaps not wise nor readily extensible. Thanks for that reference 8-)

Cheers, Mike.
hewsmike
 
Posts: 85
Joined: Mon Dec 17, 2012 3:20 am

Re: DMA interrupts

Postby mipt98 » Mon Jul 29, 2013 9:51 pm

E_MESSAGE_INT works!!! Thanks Tim! First I was going to do as Mike suggested -- setting flags and polling, then was thinking about raising soft interrupts after DMA transaction, but then message interrupts fixed everything. So luckily, the feature got released right when it became needed!
-Ivan
mipt98
 
Posts: 17
Joined: Sat May 25, 2013 12:39 am

Re: DMA interrupts

Postby aolofsson » Mon Jul 29, 2013 11:01 pm

Nice!! Can't wait to properly release the updated architecture spec with all the new features. Soon...

Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: DMA interrupts

Postby timpart » Tue Jul 30, 2013 7:07 am

timpart
 
Posts: 302
Joined: Mon Dec 17, 2012 3:25 am
Location: UK

Re: DMA interrupts

Postby hewsmike » Tue Jul 30, 2013 11:24 am

@Tim

My reading is much the same. The DMA will plough on asynchronously of the processor - as it no doubt should - so when or even IF the 'channel complete' interrupt is serviced you cannot then assume that the DMA register contents refer to the completed transfer that triggered said interrupt.

Cheers, Mike.

( edit ) Also one has to hope that a higher priority interrupt doesn't want to use DMA either ..... meaning that if it does, even in the absence of chaining, you still won't see the 'right' values in the DMA registers by the time your DMA interrupt service gets to proceed. You could prevent such nesting ( don't follow the initial context save to stack with GIE ) but now you're perverting interrupt priority. Geez Louise I hope we never do multi-threading ! :-)
hewsmike
 
Posts: 85
Joined: Mon Dec 17, 2012 3:20 am

Next

Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 90 guests