Parallax Forums
  HomeLog InRegisterCommunity CalendarSearch the ForumHelp
   
Parallax Forums > Public Forums > Propeller Chip > How program memory is loaded?  Forum Quick Jump
 
New Topic Post Reply Printable Version
[ << Previous Thread | Next Thread >> ] | Show Newest Post First ]

inaki
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Jan 2005
Total Posts : 262
 
   Posted 2/24/2006 5:56 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
I am somewhat confused after reading the Early Propeller Chip Documentation.
 
I understand from the documentation that at a given time a COG can access 512 entries of program memory. Is that right ?
The manual says that when a COG is rebooted it loads its memory registers from the main memory and then starts to run at $000.
The PC is 9 bits register so it is clear that it cannot be anything bigger than 512.
 
So, I wonder what happens when one wants to execute more than 512 instructions in sequence. Does the COG continue to load more instructions from main RAM ? The contents must be loaded by hand ? What happens to the old contents of program memory?
 
On the other hand, is it possible to jump or call between addresses that are more than 512 instructions appart ?
 
 
 
 
 


 

Back to Top
 

Martin Hebel
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Jul 2004
Total Posts : 1108
 
   Posted 2/24/2006 6:19 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
You have to remember that when talking about Spin, the program resides in the shared RAM (32K). The cog (512) only holds the spin intepreter. If ASM is used, the interpeter is not loaded or dumped and the machine code is placed directly into a cog.

-Martin


Martin Hebel
Back to Top
 

daniel
.



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Jul 2004
Total Posts : 220
 
   Posted 2/24/2006 6:31 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
inaki said...
So, I wonder what happens when one wants to execute more than 512 instructions in sequence. Does the COG continue to load more instructions from main RAM ? The contents must be loaded by hand ? What happens to the old contents of program memory?
 
On the other hand, is it possible to jump or call between addresses that are more than 512 instructions appart ?
As I read the prelim doc, it would seem possible, but danger fraught, to do so.
 
a. The COG is stated to have all 512 instructions transferred into its memory space whein it is initialized.  Once this initial transfer happens, the prelim docs imply that no further "automatic" transfer takes place.
 
b. Specific SharedRAM Content can be loaded into the COG, one byte/word/longword at a time via HUB instructions.
 
c. The destination of that transfer in the COG is overwritten by the new content.
 
d. And here is the adventurous part.  The COG could be written to, while it is executing some portion of its already loaded code, could have interleaved HUB instructions to preload the next part of the execution path.  Intended jumps into this not-yet-loaded portion of the routine (and thus, in a global sense possibly greater than 512 instructions away, but always within the 512 instructions of the COG in a local sense) would have to be "delayed" until it was "loaded".
 
I think I'd try real hard to stay within 512 instructions native to the COG.
 
Daniel
 
 
Back to Top
 

Loopy Byteloose
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Aug 2004
Total Posts : 3142
 
   Posted 2/26/2006 8:35 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Daniel,
Regarding part d.
-- Are you thinking that you can possibly have half a program in one COG and the other half in a second COG? Then, you try to say ahead of the busy COG by changing in phases.


"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
                                                                       Warm regards,      G. Herzog [ 黃鶴 ] in Taiwan

Back to Top
 
[ << Previous Thread | Next Thread >> ]
New Topic Post Reply Printable Version
 
Forum Information
Currently it is Friday, November 20, 2009 11:13 PM (GMT -8)
There are a total of 393,738 posts in 55,521 threads.
In the last 3 days there were 82 new threads and 702 reply posts. View Active Threads
Who's Online
This forum has 17687 registered members. Please welcome our newest member, mark09.
49 Guest(s), 2 Registered Member(s) are currently online.  Details
BradC, SRLM