emu-russia / dmgcpu

DMG CPU Reverse Engineering
Creative Commons Zero v1.0 Universal
29 stars 4 forks source link

Verify ALU #229

Closed ogamespec closed 8 months ago

ogamespec commented 8 months ago

Yeah, simple. Add a + b, make sure it works :) Write a test run for Icarus to check it. Let's NOT concentrate on the flag setting logic for now, it's complicated. Check CLA.

ogamespec commented 8 months ago

image

ogamespec commented 8 months ago

There seems to be extra carry crawling through all the guts somehow.

ogamespec commented 8 months ago

Took most of the ALU apart, but still 5+7 = 8 lol....

image

Let's move on.

ogamespec commented 8 months ago

I suspect there's a bug somewhere in the Carry generator.

ogamespec commented 8 months ago

Better: image

But still not very well (77+35=144): image

The bug was that the carry chain used carry complements instead of the actual carry values.

ogamespec commented 8 months ago

image

Issue in SET/RES/DAA random logic.

ogamespec commented 8 months ago

Fixed. image

ogamespec commented 8 months ago

@Rodrigodd,

Hi, I fixed 2 bugs in ALU.v, you might be interested.

image

image

Now the ALU should be adding things up correctly :)

Rodrigodd commented 8 months ago

Good work! I should be able the test the ALU when progressing more in the dmg-sim integration. I am focusing in running dmg-sim's quickboot.bin for now, which is currently stuck in writing to memory (#239).

ogamespec commented 8 months ago

Closing this one :)