sporniket / ideas

My backlog of ideas, organized as a bunch of issues
0 stars 0 forks source link

[fpga] microcore POC that just increment the program counter #35

Open sporniket opened 1 year ago

sporniket commented 1 year ago

Let a fictitious CPU having :

steps

Power on

The register’s PC is zeroed, as well as the internal PC.

Main loop

Pseudo micro code

start: 
  move.l reg(PC),Bus(1)|ADALU(1) ;Bus(1) = address + execute on write ; ADALU(1) = first operand
  move.l #2,ADALU(2) ; ADALU(2) = second operand
  move.l #ADD,ADALU(3) ; ADALU(3) = operation + execute on write
  move.l ADALU(0),reg(PC) ; ADALU(0) = result
  wait Bus
  move.l Bus(0), Decoder(1) ; Bus(0) = data fetched ; Decoder(1) = opcode
  wait Decoder
  jmp Decoder(0) ; Decoder(0) = micro-rom address, returns 0