SimpleIDE and Propware -- I'm missing something.

2»

Comments

  • DavidZemonDavidZemon Posts: 2,668
    edited 2016-05-03 - 16:27:43
    deleted
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    CI Server: http://david.zemon.name:8111/?guest=1
  • Heater.Heater. Posts: 21,213
    edited 2016-05-03 - 16:27:23
    greybeard,
    Propeller has registers??
    Certainly. A COG has 512 of them. It keeps it's data there, like the registers of any other CPU. It's instructions operate on those registers, like any other CPU.

    The only weird part is that a COG also executes it's instructions from those registers. And only those registers. Unlike any other CPU I know of.

    That's before we talk about the special purpose OUTA and other registers.

    All of that is still true even if you use the Prop Tool and PASM.

  • ersmith wrote: »
    No, that isn't correct for PropGCC. Arguments are passed in registers (at least the first 6 are), and the return address is placed in the "lr" register.

    @greybeard, Eric put "lr" in quotes because just like you already thought, the Propeller does not have a dedicated link register. However, GCC was never written with the intention of running on such a platform, it's unheard of! So, PropGCC reserves a few of the 496 registers in the Propeller and uses them to fool GCC into thinking that the architecture is a little more "normal."
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    CI Server: http://david.zemon.name:8111/?guest=1
  • Ah yes, sorry, the GCC "virtual" registers, maintained by the LMM virtual machine.
  • Some of the local memory in the cog is used as registers, because that's the kind of execution environment expected by GCC. It's the kind of detail you generally don't need to be aware of unless you're getting really close to the metal.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,201
    edited 2016-05-04 - 01:33:48
    heater wrote:
    Certainly. A COG has 512 of them. It keeps it's data there, like the registers of any other CPU. It's instructions operate on those registers, like any other CPU. The only weird part is that a COG also executes it's instructions from those registers. And only those registers. Unlike any other CPU I know of.
    Not so weird. It's a rather classic von Neumann architecture with a two-address instruction set that obviates the need for a separate accumulator.

    We've gotten so used to the PIC-like Harvard architectures that we tend to forget our von Neumann roots. :)

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Heater.Heater. Posts: 21,213
    edited 2016-05-04 - 10:49:52
    Phil,

    The way I look at it is that either:

    a) The Prop COG has no user accessible registers (Let's ignore the program counter), data and code all live in the same RAM. A memory to memory architecture as you say. That is pretty weird. Out of all the machines I have worked on from Motorola, Intel, MIPS, ARM, AVR, PDP/11, Locus 16, and others I forget I have not seen another machine like that.

    b) The Prop COG has 512 registers. That already weird by the huge number of registers, even RISCs only have 32 or 64. More weird because it can only execute code from within it's own register set.

    c) We give up and say the Prop COG does not have a register/RAM distinction. True but weird.

    In order to convince me it's "not so weird" you'll have to produce a list of processors that look like Propeller COGs that people may have heard of.

    Edit: The ZPU machine I write an emulation of for the Prop, Zog, had no registers. But then that was a weird stack based thing.

    Other edit: The Texas Instruments TMS9900 kept its registers in RAM. There was an internal, programmer accessible, register that pointed at the register set in RAM. So that was "memory to memory". But still the instruction set referred to registers.
Sign In or Register to comment.