My 32-Bit-CPU (with GPU)

An area for asking questions, making suggestion, share ideas and place circuit examples.
Post Reply
Volvagia
Posts: 15
Joined: Sat Jul 12, 2014 3:42 am
Location: Österreich ("Austria")

My 32-Bit-CPU (with GPU)

Post by Volvagia »

I'm named it "Heart of Gold", like the Space ship.

The CPU contains two internal 32 bit-busses which conntect the components together. I know on this design it's impossible to pipelining, but I think its easier. On the raising edge of the clock cycle the cpu controller prepare the next step, on the falling edge he update the control lines. The Instructions are 32 bit long too, and are splitted in 4 Parts:

31...0
| 6 bit Instruction identifier || 16 bit immediate argument part || 5 bit register identifier || 5 bit other register identifier |

On startup, the BIOS ROM is mounted on Address 0 to 0xFF. All read accesses come from the BIOS, so all read accesses are on (address (mod) 256) on BIOS. But write accesses are direct performed on the RAM. On the BIOS I would clear the VRAM and read an Programm to RAM, but maybe I done anything wrong or my Core2Duo is to slow, the simulation on max speed is to slow to perform this on each startup. The BIOS get disabled if the CPU write anything to address 0xFFFF. The current BIOS do this on address 0xFF, so the program execution start on address 0x100. The VRAM is mounted on address 0x800 - 0xFFF. For simplity, this Part of the Main Memory is never used.
The Parts of the Circuit are connected by a 8 Bit unidirectional Bus. The CPU send a request, the target Part answer maybe.
The CPU support 8 different Interrupt requests. Are interrupts enabled and an interrupt occured, the CPU jump to the interrupt address (interrupt id * 0x20 -> 0, 0x20, 0x40, 0x60...0xE0) and disable interrupts immediate. On Reset, interrupts are disabled.
The GPU support two modes. On "Alpha mode", the GPU draw internal hardcoded letters, where each letter is mounted to his ASCII value. Current, only uppercase letters are implemented. On "Direct mode" each 8 bit data symbolize 8 Pixel on the s/w-display (1 is white). The GPU need for each full display repaint 8.192 clock cycles. After this, the GPU do 8.192 clock cycles nothing to simulate a vblank. While VBlank, the CPU can access the VRAM. If the CPU access the VRAM in GPU repaint task, the receiving Bits of the CPU are undefined. On entering the VBlank, the GPU fire an IRQ. On reset, the GPU start in Alpha mode and get active if the BIOS get disabled.

I think that was all. Current the main RAM contain only a ad hoc test application.


Update 1: Fixed 2 Bugs. There was a small mistake on entering Interrupts on the CPU and the GPU fired in the second cycle after reset an IRQ.


Thank you for reading.

¹ Condition mode:
If i is set, it jump only if ((j is reset and z is set) or (j is set and c is set)).
In other words, i activate the jump and j = 0 for zero or j = 1 for carry condition.
Truth table: (in the case of it's a conditionable jump instruction)

Code: Select all

i|j|c|z|do jump
0|x|x|x|Y	
1|0|x|0|N
1|0|x|1|Y	
1|1|0|x|N
1|1|1|x|Y	
Attachments
hog compressed.zip
(378.87 KiB) Downloaded 646 times
hog.CircuitProject
(3.52 MiB) Downloaded 761 times
Instructions.Png
Instructions.Png (45.68 KiB) Viewed 9115 times
Last edited by Volvagia on Sat Mar 14, 2015 11:04 pm, edited 1 time in total.
User avatar
admin
Site Admin
Posts: 407
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: My 32-Bit-CPU (with GPU)

Post by admin »

Thank you for sharing nice project. It is very impressive.
I am thinking how to make program to run circuits faster, so hopefully in the one of the next version speed will be bearable for such huge projects.
Volvagia
Posts: 15
Joined: Sat Jul 12, 2014 3:42 am
Location: Österreich ("Austria")

Re: My 32-Bit-CPU (with GPU)

Post by Volvagia »

Thank you. I fixed 2 small Bugs.
User avatar
admin
Site Admin
Posts: 407
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: My 32-Bit-CPU (with GPU)

Post by admin »

How are you going to write programs for your CPU? I want to advertise some universal macro assembler that let you write programs for any CPU. You just define your commands in the same way you write the program itself. You can download it from https://bitbucket.org/EugeneLepekhin/fusion/downloads
You will need Fuzion.zip, which contains compiler and documentation for the language.
Post Reply