Shop OBEX P1 Docs P2 Docs Learn Events
turning an 8 bit into a 32 bit cpu — Parallax Forums

turning an 8 bit into a 32 bit cpu

Chris MicroChris Micro Posts: 160
edited 2009-06-19 03:44 in Propeller 1
turning an 8 bit into a 32 bit cpu

This morning I woke up and thought I could do something useless but interesting.

Here is the result

The goal is reached and the led blinks.. my Atmega runs now propeller code wink.gif

Comments

  • heaterheater Posts: 3,370
    edited 2009-06-15 20:54
    Damn, I knew I was doing something wrong emulating 8-bit CPUs on a 32-bitter[noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Robot FreakRobot Freak Posts: 168
    edited 2009-06-15 21:19
    WOW, this is great!! lol.gif

    Can you describe the current functionalities, and the ones you are working on?

    I've got an ATmega32 over here, so I'll give it a try.

    Keep up the good work!
  • Chris MicroChris Micro Posts: 160
    edited 2009-06-15 21:29
    file.php?id=92

    Well ...
  • Chris MicroChris Micro Posts: 160
    edited 2009-06-16 13:10
    ZiCog said...
    Damn, I knew I was doing something wrong emulating 8-bit CPUs on a 32-bitter[noparse]:)[/noparse]

    No, no, you can become much slower if you do it the other way burger.gif

    Now my Atmega runs 4 Cogs in parallel. It is now a quad core 32 bit controller. hop.gif
  • heaterheater Posts: 3,370
    edited 2009-06-16 14:00
    Cool, so if I make an emulation of the Atmega for the Prop we could run your emulator on it and have 4 COGs for the price of one[noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • BradCBradC Posts: 2,601
    edited 2009-06-16 14:07
    Stack overflow!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Eccles : How do I open the door?
    Bluebottle : You turn the knob on your side
    Eccles : I haven't got a knob on my side!
  • AleAle Posts: 2,363
    edited 2009-06-16 14:28
    heater: you can get 32 virtual COGs that way... That will give a new meaning to "Winblows: The power of yesterday in today's computers" lol.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit the home of pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
  • Chris MicroChris Micro Posts: 160
    edited 2009-06-16 17:00
    ZiCog said...
    Cool, so if I make an emulation of the Atmega for the Prop we could run your emulator on it and have 4 COGs for the price of one[noparse]:)[/noparse]

    Well,yes, that brings me to an idea: Compiling the emulator with Catalina and creating virtuall COGs

    With the remark of ALE you can have 8-1+32 = 39 Cogs

    isn't that great? lol.gif
  • heaterheater Posts: 3,370
    edited 2009-06-16 17:37
    OK this is getting to weird but...

    This thing is written in C right. Eventually I will have a 6809 emulator up and running on the Prop which will be running the CUBIX OS. Which just happens to have an 8085 emulator. Which could then run your COG emulator compiled for 8080. Which could then run....

    I love that picture of your atmega and LED by the way.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • SciNemoSciNemo Posts: 91
    edited 2009-06-16 17:43
    We are going to need some nice flowcharts soon.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Not the fish.
    sites.google.com/site/bitwinproject/
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-06-16 17:51
    Neat project!

    OBC

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

    Visit the: The Propeller Pages @ Warranty Void.
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2009-06-16 22:06
    Has anyone done an emulation of the propeller chip that runs on a PC?
  • mikedivmikediv Posts: 825
    edited 2009-06-16 23:33
    Chris Micro,, I just started to get into the Atmel chips I had never used them before I was wondering I also ordered a CordiumCorp Armlite it has an ARM7 processor I am confused though is this chip the same as the Atmel???
  • Chris MerckChris Merck Posts: 55
    edited 2009-06-17 00:15
    Yes Holly. Most notably GEAR, though it is not time-accurate for SPIN and is slower than real-time.
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2009-06-17 00:18
    @mikediv

    No, that chip is an ATmega32, an 8bit controller running at 16mips.
    Atmel does however make ARM7 chips.
  • Chris MicroChris Micro Posts: 160
    edited 2009-06-17 02:18
    lol, this thread seems to confuse some people smile.gif

    So, for the beginners: This project is just a fun project. There is no practical use yet to emulate a 32 core on an 8 bit core. Don't ask if you can buy another processor to make the same things as with the propeller.

    By not all the instructions of the propeller are implemented in the emulation. I implemented just the instructions necessary to run the led demo.

    I like the suggestion of ZiCog: Emulating on Emulator in another and to see how slow we can get but still working! I the emulators must be quite good if the can run a c-program of another processor without errors.

    Another idea which came do my mind: whats about virtual COGs ? Did anyone try to implement some in propASM? How many instructions would be necessary for one emulated instructions? How fast could it be? probably 10 times slower than the real COG?
  • heaterheater Posts: 3,370
    edited 2009-06-17 04:10
    "...emulators must be quite good if the can run a c-program of another processor without errors."

    Yes and no. C (and many other) compilers often do not use all of the possible instructions and addressing modes etc of their target CPU. The ZiCog emulator runs compiled C programs no problem but then it also passes 99% of the tests of a very stringent instruction set test program which compares instruction execution results against a real Z80.

    I'm hoping for the same level of accuracy for the 6809 emulator, just now I'm not sure how to create the tests though.

    If we can stack up the emulators we should do it, just for fun. How big is the COG emulator, in C lines and/or compiled atmega bytes?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-06-17 05:52
    Now what if...

    Cog 1 : ZiCog
    Cog 2 : MoCog
    Cog 3 : AtMega
    Cog 4 : 6502 Apple
    Cog 5 : 68008
    Cog 7 : Commodore

    Cog 0 : I/O handler

    smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • heaterheater Posts: 3,370
    edited 2009-06-17 06:04
    Yeah !

    ZiCog, MoCog and 6502 are under way. Who's volunteering for AtMega and 68008. I think I'm done with emulations in this lifetime.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Chris MicroChris Micro Posts: 160
    edited 2009-06-17 07:04
    Looking forward to the 6502 emulator smile.gif

    >If we can stack up the emulators we should do it, just for fun. How big is the COG emulator, in C lines and/or compiled atmega bytes?

    It is difficult to count the lines. All together the resulting file has between 2K and 4K depending on the optimization level given to the compiler.
    The COG emulation is in Cog.c.
    That would be fantastic to run it on the Z80 emulator.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2009-06-17 07:08
    Chris Micro said...
    Another idea which came do my mind: whats about virtual COGs ? Did anyone try to implement some in propASM? How many instructions would be necessary for one emulated instructions? How fast could it be? probably 10 times slower than the real COG?

    It's not really virtual cogs but you can do multitasking with either LMM or the LMM idea but using instructions in the cog space. There is an example attached that someone else wrote. You may be able to find the original thread if you do a search of the forums. You could write a full cog emulator though if you really wanted to. Could actually be interesting to implement memory protection and other things using it.
  • Chris MicroChris Micro Posts: 160
    edited 2009-06-18 17:59
    Hi stevenmess,

    thanks you for the file. Nice. A pity that it cannot process all assembler commands.
    Probably a work around would be possible with source and destination prediction.

    chris
  • mikedivmikediv Posts: 825
    edited 2009-06-18 20:31
    So guys can I ask are there any other MCU's that have 8 processors or parallel processors MCU chips or simply put anything like the the prop chip out there???
  • LeonLeon Posts: 7,620
    edited 2009-06-18 21:46
    XMOS:

    www.xmos.com

    Only four cores, but each can have up to eight hardware threads that can be treated like separate CPUs (100 MIPS or 50 MIPS each).

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • localrogerlocalroger Posts: 3,452
    edited 2009-06-19 00:32
    If you guys run this a couple more levels, you can use the VGA driver to run a mechanical plotter.
  • Chris MicroChris Micro Posts: 160
    edited 2009-06-19 03:44
    lol, it took me a while to understand to know what you mean smile.gif
    It is true, the speed would be sufficient for a mechanical plotter.

    But there are some simple tv-driver for the Atmegas. So if one of this is used, even to drive a display would be possible.
Sign In or Register to comment.