[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/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/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/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 - call the epiphany program many times without e_reset

call the epiphany program many times without e_reset

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

call the epiphany program many times without e_reset

Postby howardhh » Mon Mar 09, 2015 6:18 am

Hi all,

I want to call the program in epiphany core many times from the host side, but how to do this without using "e_reset" each time?
If I use "e_reset_group(&dev)" before "e_start_group(&dev)", it works. While it doesn't work without "e_reset", why?
howardhh
 
Posts: 28
Joined: Fri Aug 22, 2014 1:50 am

Re: call the epiphany program many times without e_reset

Postby mikebell » Mon Mar 09, 2015 9:45 am

mikebell
 
Posts: 41
Joined: Thu Jan 08, 2015 9:46 pm

Re: call the epiphany program many times without e_reset

Postby howardhh » Mon Mar 09, 2015 2:18 pm

Dear Mike,

Really thank you!

I have done as your suggestion, and it works!
howardhh
 
Posts: 28
Joined: Fri Aug 22, 2014 1:50 am

Re: call the epiphany program many times without e_reset

Postby huxuesong » Tue Mar 31, 2015 3:53 am

huxuesong
 
Posts: 3
Joined: Thu Mar 12, 2015 12:33 pm

Re: call the epiphany program many times without e_reset

Postby etim » Wed Oct 14, 2015 12:05 pm

I would also like to see a full example of this strategy in action.
etim
 
Posts: 22
Joined: Sat Jun 27, 2015 6:08 pm

Re: call the epiphany program many times without e_reset

Postby MiguelTasende » Thu Oct 29, 2015 6:14 pm

Having some similar problems.

In my case I need to call "e_load_group", for my program to work repeated times.

That is terrible, as the loading process takes more than 30 times the amount of time that the actual processing needs.
I think I wasn't able to make the interrupt mechanism work properly. Will try to study it more...
MiguelTasende
 
Posts: 51
Joined: Tue Jun 30, 2015 12:44 pm

Re: call the epiphany program many times without e_reset

Postby timpart » Fri Oct 30, 2015 1:45 pm

The program resumes execution immediately the idle rather than calling main () again. Variables are unchanged by the idleness.

Any interrupt would end the idle state, so an alternative is to use the USER interrupt. The code is similar. This then keeps the SYNC interrupt available if you want to use the SYNC instruction for wired-OR.

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

Re: call the epiphany program many times without e_reset

Postby MiguelTasende » Wed Nov 04, 2015 3:17 pm

Thanks Tim. I'll try the "interrupts code" later.

By now, I made a code that uses polling on both sides. It works, and gave no problem inside the same program (execute a loop that calls many times the Epiphany "interesting" code).

I found an interesting thing though, when trying to execute from a different program (which was my objective initially).

I wrote a very small script init.sh that initializes and loads the Epiphany program, using the e-utils.
Then I wrote the host program, and forgot about loading and initialization. Tried to use the minimum commands (if possible "just put that shared byte in one to tell the Epiphany to start").

I knew I would still have to call "e_open" to get the e_epiphany_t device reference.
I found that I also had to call "e_init", or communication with the Epiphany wouldn't be possible.
I am calling "e_close" but I didn't find it relevant.

Now: "e_finalize".... If I did call that one, the program wouldn't be able to execute more than once.

More in general, with those functions, I am always having doubts about which ones of them affect only the ARM Host (getting pointers to places in the Epiphany, reserving Host memory, etc..), and which ones affect the Epiphany also. I think it is important to differientiate both (I would initially consider that "e-hal" init functions shouldn't affect the Epiphany, but the "e_finalize" seem to do so; at least it is my temporary conlcusion).
MiguelTasende
 
Posts: 51
Joined: Tue Jun 30, 2015 12:44 pm

Re: call the epiphany program many times without e_reset

Postby sebraa » Wed Nov 04, 2015 10:15 pm

As far as I have seen (please correct me), e_init() and e_finalize() enable or disable the Epiphany clock, respectively. Obviously, after e_finalize(), there can't be any communication to the Epiphany unless you call e_init() again.

You need to call e_init(), e_open() in the beginning (but an additional e_system_reset() won't hurt), and it is a good idea to call e_close() and e_finalize() at the end of your program. These functions don't need to be called anywhere else, even if you want to reload the cores with a different application.

When starting a core, its startup code (from crt0.o) is run, which will produce a working C environment (setup stack pointer, initialize .bss and newlib, etc.) - this startup code will then call into main(). Since .data does not get copied from e.g. ROM, it gets overwritten while your program executes, and even a full reset will not reset globally initialized variables. So you'd need to reload the core anyway.

You should assume that all e-hal functions affect the Epiphany. After all, it is the Epiphany hardware abstraction and manages elementary functionality like turning the chip on/off, reading/writing special registers and memory, generating events (resets, interrupts) on specific cores etc.
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: call the epiphany program many times without e_reset

Postby MiguelTasende » Thu Nov 05, 2015 1:27 pm

MiguelTasende
 
Posts: 51
Joined: Tue Jun 30, 2015 12:44 pm

Next

Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 13 guests

cron