Shop OBEX P1 Docs P2 Docs Learn Events
Propeller (Main memory) — Parallax Forums

Propeller (Main memory)

sanketsanket Posts: 28
edited 2009-09-30 06:35 in Propeller 1
Hello every one,
I just want to know that, Is the main memory of propeller is byte addressable or word addressable?
I mean do we need increment the program counter by 1 or by 4?
Because generally, Main memory is always byte addressable and PC needs to incremented by 4.
Does the main memory of the propeller has instruction register (IR) in the architecture?

Comments

  • jazzedjazzed Posts: 11,803
    edited 2009-09-29 06:38
    Main memory is accessible in byte, word, and long from Spin or PASM.
    There is no native stack pointer (SP) or program counter (PC) register accessible by users.
    The Spin VM keeps track of PC, SP, and "variable base" for objects and can be hacked.

    PASM uses long instructions only, so one could say the "PC" is incremented by a long offset or 4 bytes.
    Added: While the above may be conceptually correct for a piece of normal memory, the source and destination fields of an instruction count the register locations in contiguous natural numbers. In other words COG memory is an array of 512 long registers accessed with index 0 through 511.

    Post Edited (jazzed) : 9/29/2009 7:16:25 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-29 07:58
    Hub memory is byte-addressed. Words and longs have to be aligned on 2- and 4-byte boundaries, respectively, to be transferred whole to and from the cogs. To transfer successive pieces of data, the hub address has to be incremented by the size, in bytes, of the entities being accessed: by 1 for bytes; 2, for words, 4 for longs.

    -Phil
  • sanketsanket Posts: 28
    edited 2009-09-29 17:40
    Thanks for the reply,
    But in which register does processor store the 32- bit main memory data when we read something from main memory?
    generally, its stores in Instruction register but for propeller architecture where these 4 byte exactly being stored when we fetch the data from the main memory?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-29 17:53
    When you read data from the hub to a cog, you transfer the data directly into any of its writable memory locations. There's no "transfer register" involved. The destination address of the transfer is part of the instruction (i.e. rdbyte, rdword, or rdlong). Remember also that cog "registers" and cog "instruction memory" are the same, and self-modifying code is the rule for calls and indexed addressing. The architecture is "two-address" Von Neumann in every sense of the word, so there's no accumulator bottleneck.

    -Phil
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-29 18:34
    ...and this is probably my favorite feature of the Propeller. I find it very limiting to go back to other load, operate, store processors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-09-29 19:04
    Hello Sanket,

    you seem to stay AWAY from the manual. If you read the manual carefully you can answer 90% of your questions yourself.

    best regards

    Stefan
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-29 19:20
    Stefan,

    I was going to save that comment for his next question; but, yes, Sanket, Stefan is right: the manual is your friend! smile.gif

    -Phil
  • KyeKye Posts: 2,200
    edited 2009-09-29 19:52
    Maybe its not in his native language.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • jazzedjazzed Posts: 11,803
    edited 2009-09-29 20:33
    Maybe it's just a test to see how nice we are [noparse]:)[/noparse]
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-29 21:39
    So the Masters is in Sociology, not Technology!

    [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • sanketsanket Posts: 28
    edited 2009-09-30 06:33
    Hello everyone,
    I had not ask to test any one?
    And i got really stuck and i also gone through the manual and this point could not cleared by me so, i asked you guys just to get help.
    That pure intension for this question is to clear that point.
    I would like to thank all of you for spending your precious time.
    I wish, i don't have any more doubts remained and thats why i will not give you stress any more.

    Thank You once again for your help

    Sanket Shah
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-30 06:35
    No stress, Sanket! smile.gif And please don't hesitate to post any more questions you might have.

    -Phil
Sign In or Register to comment.