Shop OBEX P1 Docs P2 Docs Learn Events
Should the next Propeller be code-compatible? — Parallax Forums

Should the next Propeller be code-compatible?

cgraceycgracey Posts: 14,256
edited 2010-01-06 15:47 in Propeller 1
Big question here that I didn't think I'd be asking anyone...
·
·
Should the next Propeller be:
·
A) kept code-compatible with the current Propeller
·
········································· -or-
·
B) made a little different to better accommodate the expanded memory
·
·
In any case, the next Propeller will have 256KB+ of SRAM, analog-capable pins, many additional assembly instructions, improved CTRs and Video, etc. These can all be cleanly implemented in ways that don't break current Spin and assembly code. For example, there are new pointer modes for the RDxxxx/WRxxxx instructions that can reach beyond the current 16-bit address space.·Compatibility would require a non-flat memory map, with the normal 32KB RAM + 32KB ROM followed by a new 256KB RAM + 256KB ROM.
·
The advantage of code-compatibility is that you get an immediate speed improvement, without having to make any changes to your code. Then, you can begin taking advantage of the new features. The new 256KB RAM would be very usable for screen buffers and such, but not necessarily for Spin code.
·
The advantage of breaking compatibility is that you get one flat memory map that kind of clears the slate on legacy issues. We wouldn’t need LOG and SINE tables in ROM anymore, since each cog would have its own CORDIC system. The new RAM would be realized contiguously, so Spin would need to be modified to handle the extra address space. This would require minor changes to some Spin and assembly code.
·
So, which do you think is better: compatibility or clean slate?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Chip Gracey
Parallax, Inc.
«13456727

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-08-28 00:36
    compatibility..

    Is it possible that there might be a hardware switch to select between these options?

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with a Propeller Protoboard?
    Check out: Introduction to the Proboard & Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • MovieMakerMovieMaker Posts: 502
    edited 2008-08-28 00:41
    You have to go forward. So go forward. But, as state earlier, a switch to have best of both worlds is a GREAT idea.tongue.gif
  • science_geekscience_geek Posts: 247
    edited 2008-08-28 00:42
    i may be new and still a patawan but i have to say that it should be compatible, one thing i have trouble with is getting used to something totally new after just getting one thing started
  • Ed ParsonsEd Parsons Posts: 31
    edited 2008-08-28 00:43
    I think someone suggested at the Expo the possibility of breaking code-compatibility, but having some macros or something to run on old code to update it to the current code. I don't know how difficult that would be, but it sounded like a good idea to me. I personally think it would be a shame to make the next Prop's performance or capabilities suffer to maintain backwards compatibility. Are you going to have to ask if you should maintain code-compatibility with Prop I in the future when you're working on Prop 17?
  • william chanwilliam chan Posts: 1,326
    edited 2008-08-28 00:45
    If we look to the SX history, we note that the PIC compatible (4 cycles per instruction) mode was only used for a short while.
    After that, Nobody uses the compatible mode anymore, everybody would always opt for the Turbo mode.

    All the paging and banking around could be an additional debugging and support headache.

    Go for a clean slate.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • tpw_mantpw_man Posts: 276
    edited 2008-08-28 00:48
    I think you should break compatibility, but either have a special compiler that adjusts automatically, a program that aids with fixing it, or a hardware switch.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I am 1011, so be surprised!


    Advertisement sponsored by dfletch:
    Come and join us on the Propeller IRC channel for fast and easy help!
    Channel: #propeller
    Server: irc.freenode.net or freenode.net
    If you don't want to bother installing an IRC client, use Mibbit. www.mibbit.com
    tongue.gif
  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-28 00:49
    One solution already mentioned for the RAM/ROM address space difficulty would be to have a flat architecture with RAM at the beginning of the address space and ROM at the end of the address space however many bits in an address. It might be useful to leave a hole between RAM and ROM for future improvements in RAM or ROM size. The bootloader would optionally copy the "compatibility" portion of the ROM to the 2nd 32K of RAM for use by Prop I programs. Prop II programs would have some kind of indicator in the binary file so the bootloader or other loader could copy the ROM to the 2nd 32K of RAM only if the indicator is missing (to default to Prop I conventions).

    The bootloader and program loader could also use this indicator to choose between a Spin I or Spin II interpreter if there was a reason to have two interpreters.

    The only reason for a "hardware switch" would be if the cog instruction set would need incompatible differences between the two modes. That doesn't seem necessary.

    My bias would be to provide upward compatibility as much as possible without restricting the new features (like forcing the memory map to be Prop I compatible), fix as much of the differences in software as possible (like having two Spin interpreters and copying part of ROM to the 2nd 32K of RAM when needed)

    Post Edited (Mike Green) : 8/28/2008 12:58:22 AM GMT
  • mirrormirror Posts: 322
    edited 2008-08-28 00:51
    Start with a clean slate. Avoid the Intel segment mess! If a recompile of existing source code gets us close to a working solution, then I'll be happy.

    The Propeller II is much more than just a faster Propeller I - perhaps it should have another name.

    I think there will be many who continue using the Propeller I as it is still a highly capable processor. The Propeller II is not a "desperately needed" chip, it's just that we're all excited about what the next generation of an already great chip will be able to achieve.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • bmentinkbmentink Posts: 107
    edited 2008-08-28 00:53
    I would go for the "clean slate" approach. Designing for compatability is the "Windoze" approach, and look how the hardware/software has
    suffered as a result ....

    I don't mind some slight pain to port Propeller I to Propeller II if that gives me a leap in hardware spec.
    ( .... As long as you don't stray too far from the current brilliant cog concept that is smilewinkgrin.gif )

    My 2c worth ..
  • Paul Sr.Paul Sr. Posts: 435
    edited 2008-08-28 01:04
    Option B seems to make sense in the interest of progress. [noparse][[/noparse]From a hardware standpoint]

    Isn't is really about the "Prop Tool" though? It would seem to make sense to expand/enhance it such that it handles whichever Prop you are working with appropriately.

    Edit: looks like Mike already made a similar point while I was fighting with Firefox' refusal to allow me to "submit" my response! I agree Mike!

    Post Edited (Paul Sr.) : 8/28/2008 1:14:32 AM GMT
  • ImageCraftImageCraft Posts: 348
    edited 2008-08-28 01:06
    Most programs are either PASM Cog programs, or large Spin (and hopefully C) programs right? In the former case, the programs are small and any changes should be doable, and in the latter case, the details will be hidden by and Spin and C compilers.

    IMHO, having a flat memory model outweighs any advantage of backward compatibility.
  • RaymanRayman Posts: 14,851
    edited 2008-08-28 01:09
    I thought you'd already decided A based on the demo at the unofficial expo...

    Anyway, the Prop2 is sounding to me like an evolution, not a revolution. So, I'd have to say A would be the best pick.

    PS: I think I'd rather see 64-bits and more COG RAM...
  • potatoheadpotatohead Posts: 10,261
    edited 2008-08-28 01:10
    Break it, but break it in a way that limits future breaking due to scale changes. Overbuild a little in the bit fields and planning, if you have to this time. Frankly, I was expecting this as the larger memory size is a problem for the current instruction set.

    That way, we've got the current Propeller and it's body of code, and the newer, faster design (series maybe) that has somewhat different code.

    Parallax plans to continue selling the existing Propeller for quite some time, meaning that code will continue to have a home for quite some time. It's a great chip, and it's very friendly in a lot of ways. From here, the new scale will break some of that friendliness, and that's a good thing going forward. The larger scale and speed will make it applicable for more tasks and maybe more commercial in nature. (code protection, etc...) Not that the current Propeller isn't capable --that goes without saying.

    With new features, there are gonna be code rewrites as people want to optimize and leverage those. Why not leverage that natural activity then?

    The next jump is a significant one too! Seems a pity to hobble it and break the straightforward design approach we all like so much. I don't think compatibility is worth it in the very longer term, and both chips are for the very longer term, right?

    I'll bet with the activity seen here, translators will be available in a short time, meaning code can move from one body to another without serious difficulty. That difficulty will always be there, as people will want to do both. Let software handle that. I think we all will be surprised at how that goes.

    New projects, on the new chip won't have to suffer if the instruction set is clean like it is right now. IMHO, that's a big draw worth keeping.

    The problem I see with the hardware switch is that there will be lots of code that assumes the switch is one way or the other way. Breaks the lego style object reuse model and that's just not worth doing. Segmenting the memory is a kludge, but it won't split the code and could lead to more objects that work with both chips.

    I'm really torn on that as a larger body of Propeller code is good.

    The scale differences suggest to me that this is more of a feel good than anything else though. The differences in the two chips will rapidly manifest themselves, splitting the code anyway, so why not make the most of the split? That's where I'm ending up.

    New users can just jump in with either Propeller. It's a bit of a split to move from one to another, but it would be anyway, so I think that's a wash too in the longer term.



    (spank me, if you must, but I gotta ask for a simple means to sync the video generators so they can be used at the same time, on the same pins, overlay style It's not very doable right now, and I wish it was!)


    Edit: Since there will be a split of some kind, it is now completely justified to enhance the Prop Tool to handle in-line directives. Nothing fancy, just a few options that will be needed to allow people to write one file that boils down to an executable on either chip, if that's the intent. A side benefit is closing that gap for those who have been needing it on the more complex efforts. The greater scale will take things in that direction anyway, so now's the time!

    Doing that would preserve another big draw and that's being able to put lots of stuff in one file in the Propeller tool. IMHO, that's one to keep.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net

    Post Edited (potatohead) : 8/28/2008 1:18:45 AM GMT
  • cgraceycgracey Posts: 14,256
    edited 2008-08-28 01:12
    The new cogs will run old code just fine. The big issue is how to handle the increased memory. If you know how the assembly COGINIT instruction works, you can see the problem of having no more bits in the D register to specify both the launch address and PAR address. Also, for Spin·to work in a greater map, some·nice congruities will be disrupted, like the use of a·single long to pack two memory addresses. Spin would likely need to be·made 24-bit aware, costing another byte, which yuckies up the·clean tables that start each object. Simple index shifts by 2 will need to become multiplies by 6. Of course, we can blow out to 32 bits and overcome this, but it gets wasteful with memory. Maybe 32 bits is the way to go for addressing. It keeps things fast and simple, but bigger than necessary. This is a dilemma!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-08-28 01:14
    My vote is for 'B' - clean slate.

    Once we understand the small differences, I am sure someone will write a source conversion program to at least identify (and maybe fix) the incompatibilities.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-08-28 01:17
    Seems to me the clean slate is the way to go up to a point.

    I know this would be complicate the ide but why couldn't there be a constant that is set in the main object that would specify the propeller type that the compiler would use to do its error checks and compiling.

    Which current instructions would be obsolete? It seems that at compile time they could be converted if propII was specified.

    If I understand the wrlong example, you would still use wrlong with propII not?

    With the amount of rom available does it matter if there is a sin cos table in there?
  • potatoheadpotatohead Posts: 10,261
    edited 2008-08-28 01:24
    I think going to the 32 bits is worth the pain.

    This jump will end up a bit less than optimal, but there are some mitigating circumstances. The multiple for on chip ram is larger than that for the added address bits. That's a net gain, and if done kludge free, will tee things up for Prop III.

    For data, it's up to the user, so almost completely a gain there. Non issue, IMHO.

    Is there an option to incorporate the simpler addressing via unused or redundant condition / instruction bits? Guess that's going back to the hardware switch, but it would be a conditional one per instruction, leaving people the option to use it for memory optimization, if they need it, but not so forced as a global switch would be. Muddies the instruction set some, but perhaps that's not so bad?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
  • Mike HuseltonMike Huselton Posts: 746
    edited 2008-08-28 01:25
    My vote is for a clean slate.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH - Electronics: Engineer - Programming: Professional
  • cgraceycgracey Posts: 14,256
    edited 2008-08-28 01:33
    The current cog assembly language instruction set is not going to be altered. All the new instructions were fit into what was slated to become MUL/MUL/ENC/ONES for the next chip. The only difference to old code would be that the address used in RDxxxx/WRxxxx instructions is now more than 16-bit-aware (if compatibility is broken, otherwise no change). The other thing that would have to change is the pointer conduit for COGINIT. The S input might have to convey PAR, while D would convey launch address. It's not that big of a deal, really. Many program would require no alteration.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • cgraceycgracey Posts: 14,256
    edited 2008-08-28 01:35
    potatohead said...
    I think going to the 32 bits is worth the pain.

    This jump will end up a bit less than optimal, but there are some mitigating circumstances. The multiple for on chip ram is larger than that for the added address bits. That's a net gain, and if done kludge free, will tee things up for Prop III.
    I think you're right about the 32 bits. Who knows - maybe someday we'll have an external memory interface for hub accesses. It certainly would open things up wide.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-28 01:36
    The benefits of compatibility are only temporary. The benefits of flat memory last a lifetime. I've endured enough Balkanized memory (not mentioning any names,SXof course) to last another lifetime.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • Beanie2kBeanie2k Posts: 83
    edited 2008-08-28 01:37
    As someone who has suffered through the 64K barrier (Intel), the 640K barrier (DOS), the Chip RAM barrier (Amiga), the 32MB(?), 512MB, and 2GB hard disk barriers (Microsoft), the VGA barrier (IBM), and probably a few others, I would say go for at least the flat memory model, and for the 32 bit addressing if at all possible. IMHO backwards compatibility is for cheapskates and people who live in the past, and the most often regretted words uttered in the computer industry are "We never thought we'd ever use that much memory".
  • cgraceycgracey Posts: 14,256
    edited 2008-08-28 01:38
    Phil Pilgrim (PhiPi) said...
    The benefits of compatibility are only temporary. The benefits of flat memory last a lifetime. I've endured enough Balkanized memory (not mentioning any names,SXof course) to last another lifetime.

    -Phil

    Yeah, you're right! I thought the same thing about the 'temporary' benefit of compatibility. Maybe we should just blow out to 32 bits and be done with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • kuronekokuroneko Posts: 3,623
    edited 2008-08-28 01:42
    FWIW, go for a clean slate.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-08-28 01:45
    Your initial message left me with the impression that a lot of the current .spin would
    become incompatible, which would bother me because of all the effort that has
    been put forward. However *if* a bulk of it would be compatible, then by all means
    press forward...

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with a Propeller Protoboard?
    Check out: Introduction to the Proboard & Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • potatoheadpotatohead Posts: 10,261
    edited 2008-08-28 01:56
    "external memory interface for hub accesses"

    Exactly the kind of thing you don't want to leave off the table today. (and wouldn't that be cool)

    Since assembly isn't gonna be all that different, (good, because that's what is hard) that leaves SPIN. I think the elegance penalty is probably mitigated by the additional speed to be had overall. Plus, it's roomy enough for C / LMM programs to do their thing. That's a lot of options really.

    I want to second Mike's idea of the memory hole. Nobody wants to manage the different ROM locations years from now, right?

    Simple and sweet says, RAM at the bottom, ROM at the top. Of course, that's a BIG HOLE, but addresses are addresses and it sort of follows the do it once idea. That way, newer ROM builds down, RAM builds up until someday Parallax fills it with the Propeller MEGA or something.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
  • Mark SwannMark Swann Posts: 124
    edited 2008-08-28 01:56
    Clean Slate! Go to full 32-bits.

    Mark
  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-28 01:59
    In terms of COGINIT, splitting the PAR value out would be the most useful. It would also allow the use of byte addresses and arbitrary values for the PAR value. Ideally, you'd pack the NEW flag in the sign bit and COGID number in the lower bits of the upper byte of the starting address long and have the full 32 bits of the PAR value available to initialize the PAR register.
  • hippyhippy Posts: 1,981
    edited 2008-08-28 02:04
    Split RAM with ROM or a hole in it would be a nightmare IMO.

    I'd accept that if there were a run-time bit which could be set to switch in and out of compatibility mode but if there's only one mode, flat memory with ROM at top end is my preference. You really don't want to destroy the elegant design do you ?

    I have made some comments on this subject before, especially with current users who have chosen to use 16-bit Spin word variables to hold pointers. One problem is that the PropTool doesn't allow conditional compilation so it's not possible to code for both, using long now wastes space, using word creates problems for the future. My preference is for a new type "addr" which is 16-bit or 32-bit depending on some PropTool / source setting or other. That plus ChipVer helps make code compatible between Mk I and Mk II.

    My opinion is that it's up to the programmer to make sure their code is compatible with both versions and as long as PropTool supports that there should be no problems. The unacceptable situation would be having to keep two separate code bases.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-08-28 02:07
    Hey, I'm in the woods anyway and battling my way through Spin, pin by pin. I'll take the clean slate. I've got nothing to lose! devil.gif
Sign In or Register to comment.