RC3200 CPU - 32bit cpu

All discussions related to the DCPU and in game hardware (equipment, vehicles)

RC3200 CPU - 32bit cpu

Postby Zardoz » Sun Oct 06, 2013 1:24 pm

As DarkSpartan asked by a 32 bit CPU, here is : https://gist.github.com/Zardoz89/6853939#file-rc3200-md
Code: Select all
SUMMARY
=======

 * 32 bit RISC CPU
 * 32 general purpose registers (R0 to R31)
 * Multiplication/Quotient register Y
 * Base Pointer (BP = R14) and Stack Pointer (SP = R15)
 * Flags Register (FLAGS)
 * Interrupt Address (IA)
 * IO address space of 8 bit
 * Little Endian


The best of all, is that is very simple, more that the RC1600 or the DCPU-16
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Re: RC3200 CPU - 32bit cpu

Postby Zardoz » Mon Oct 14, 2013 10:09 pm

I'm thinking doing some retouches on it :

Add a flag of Interrupt Enable (IE) to enable/disable interrupts. The side effect is that now will not be necessary push IA and set it to 0 when a program/OS needs to enter in a critical section, plus allow to set IA to 0 and keep it working.

Using a Interrupt Vector Table at address IA. A IV table, makes more easy to do daisy chaining of interrupt handlers, plus make more efficient handling interrupts. The only problem that I see is that limits the interrupt messages to the range 0-255 to keep a small footprint in RAM. Also I got the idea in the IRC channel of keeping the message value at same time that I used a IV table. The idea is using the LSB byte as IV index, and keep setting r0 to the message value, giving the best of both worlds, speed, easy of use, and more useful information in the interrupt.

What do you think abut both ideas ? Probably, I will add IE flag as is a very common feature.
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Re: RC3200 CPU - 32bit cpu

Postby Zardoz » Sat Nov 30, 2013 10:46 pm

The virtual computer based on RC3200 is actually usable to toy with it in : https://github.com/Zardoz89/RC3200-VM
I not tested if it compiles in Windows/Mac... And there space to improve the virtual keyboard as SDL2 here give me headaches with keycodes that not works as should be.

Hardware Enumeration :
Image

Type program :
Image
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Re: RC3200 CPU - 32bit cpu

Postby Gareth » Sun Dec 01, 2013 2:29 pm

This looks great!
Gareth
 
Posts: 76
Joined: Thu Aug 15, 2013 3:37 pm

Re: RC3200 CPU - 32bit cpu

Postby Zardoz » Wed Dec 04, 2013 8:26 pm

Basic quick write clock program using PIT (Programmable Interval Timer) TMR0 to generate interrupts every second... and sleeps between each interrupt.
https://www.youtube.com/watch?v=FTM04A5R8fY

Note: They way that I implemented it, at least compensates the instantaneous inaccuracy as the timer uses the CPU clock a time base, so the CPU speed mean accuracy reflects over the timer accuracy. Aka if the CPU is running at a mean speed of 101% then the clock will run at a 101% of speed. I'm thinking in adding some kind of RTC that can be used to get a time reference from the game time reference so this inaccuracy is not critical for time stamps, etc....
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Re: RC3200 CPU - 32bit cpu

Postby Zardoz » Fri Dec 06, 2013 10:05 pm

Today I was lazy, and I played a bit with shaders, getting a CRT like effect :

http://www.youtube.com/watch?v=JqCW7Wmhhr0

PD: If someone doubt that the RC3200 had colors ...
Image
Image
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Re: RC3200 CPU - 32bit cpu

Postby wrongu » Sat Dec 07, 2013 2:47 pm

That is beautiful. I would love to someday see a shader effect where the colors on the monitor illuminate the room.
wrongu
 
Posts: 46
Joined: Sun Sep 08, 2013 6:15 pm

Re: RC3200 CPU - 32bit cpu

Postby Gareth » Sun Dec 08, 2013 2:55 am

With all these CPU proposals, I think it would be awesome if a variety of CPUs were implemented in the game, with a huge mess of incompatibility. Just like the old days in real life!
Gareth
 
Posts: 76
Joined: Thu Aug 15, 2013 3:37 pm

Re: RC3200 CPU - 32bit cpu

Postby Krarl » Sun Dec 08, 2013 10:52 am

Welll variety sounds nice, but I don't think it'll work very well.
Probably it's going to be difficult enough getting good software for just one CPU.
But we'll see. :)
Krarl
 
Posts: 86
Joined: Tue Aug 13, 2013 5:39 pm
Location: Sweden

Re: RC3200 CPU - 32bit cpu

Postby Zardoz » Sun Dec 08, 2013 12:04 pm

Gareth wrote:With all these CPU proposals, I think it would be awesome if a variety of CPUs were implemented in the game, with a huge mess of incompatibility. Just like the old days in real life!

Actually the only live proposals are the DCPU-16 and the RC3200

I just run the benchmark and I can say that using the SLEEP instruction do a lot influence. clock.asm program that sleeps waiting each timer interrupt need around 1/4 of host CPU power to run the same number of VMs that type.asm program that are continuous polling the keyboard device.

type.asm (for ever loop polling)
Code: Select all
/benchmark ../asm/type.asm.bin
Opening file ../asm/type.asm.bin
Read 512 bytes and stored in ROM
Running 1000 CPUs !
Running 2000 cycles in 1.53988e+07 nS Speed of 129.88%

Running 2000 cycles in 1.5105e+07 nS Speed of 132.407%


clock.asm (all time sleeps and only wakeup to attend the interrupt)
Code: Select all
./benchmark ../asm/clock.asm.bin
Opening file ../asm/clock.asm.bin
Read 520 bytes and stored in ROM
Running 1000 CPUs !
Running 2000 cycles in 4.60594e+06 nS Speed of 434.222%

Running 2000 cycles in 4.67932e+06 nS Speed of 427.413%

Running 2000 cycles in 4.81189e+06 nS Speed of 415.637%
Yep, I have a blog : http://zardoz.es
Emulator DCPU-16 VM
User avatar
Zardoz
 
Posts: 359
Joined: Mon Aug 12, 2013 8:54 pm
Location: Spain

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 1 guest