Why fixed addresses instead of variables?

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Why fixed addresses instead of variables?

Postby isk » Wed Aug 13, 2014 3:17 pm

Hi,

I'm wondering, why in many examples the row and column variables are pointer to explicit addresses and not normal variables?
E.g. in epiphany-examples/dma/dma_chain/src/e_dma_chain_test.c the code is something like:
.....
n_row = (unsigned *) 0x00006000;
n_col = (unsigned *) 0x00006004;
tran = 128;
p = 0x0000;

// Get the core id of the neighbour core
e_neighbor_id(E_NEXT_CORE, E_ROW_WRAP, n_row, n_col);
....

Why not something like:

unsigned n_row,n_col ;
tran = 128;
p = 0x0000;

// Get the core id of the neighbour core
e_neighbor_id(E_NEXT_CORE, E_ROW_WRAP, &n_row, &n_col);
....

Thank you
isk
isk
 
Posts: 4
Joined: Wed Aug 13, 2014 3:10 pm

Re: Why fixed addresses instead of variables?

Postby notzed » Sat Aug 16, 2014 1:39 am

I thought it might have something to do with the variables being in other cores and the esdk doesn't have any support for referencing remote variables symbolically.

But from that demo I can't see any reason it would have been coded that way in that instance.
notzed
 
Posts: 331
Joined: Mon Dec 17, 2012 12:28 am
Location: Australia

Re: Why fixed addresses instead of variables?

Postby aolofsson » Sat Aug 16, 2014 2:10 pm

No good reason for it...except maybe inexperience of programmer.:-)
Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 9 guests

cron