MiSTer-devel / Arcade-Pong_MiSTer

Arcade: Atari Pong (1972) for MiSTer
GNU General Public License v2.0
6 stars 8 forks source link

Arcade-Pong_20200127 broken? #2

Open ghost opened 4 years ago

ghost commented 4 years ago

I cant see the ball at all. The score keeps ticking though.

sorgelig commented 4 years ago

well, core is very unstable. I've thought i found a working config which works on my MiSTer, but it seems not for everyone... This is good example that direct clone of discrete logic or old chips to FPGA doesn't work well. It needs to be adjusted for FPGA.

Eicar commented 4 years ago

Yes, I've learned this myself the hard way. This was my first real Verilog/FPGA project. My initial approach was to do a 1-to-1 transfer of the discrete logic to Verilog. There were multiple feedback loops that I had to break by inserting DFFs to get it working, however there are still some issues with derived clocks and mixing clock domains. I didn't understand what was going on then, but I've learned quite a bit now. Ideally the entire core should be rewritten using a single clock and re-write all the parts again based off the behavior of the original schematics instead of trying to copy it. This is probably the only way to get a 100% stable version. I'm planning to revisit this core at at later time, but right now I really don't have the time to do it.

Eicar commented 4 years ago

Oh, and gate propagation delay is also essential in the original design. If you don't pay attention to it, then the timing will be off and the ball will be flickering all over the place :) Part of the problem is in the horizontal counter that was implemented using ripple-counters in the original design.

sorgelig commented 4 years ago

In FPGA you can't control routing, so in general it's random. So propagation delay won't work in FPGA. This is why asynchronous clocks don't work well in FPGA. However delay can be emulated using counters/shifters. But probably you already know this.

Eicar commented 4 years ago

You are absolutely correct! I already simulate the analog parts of Pong (555 timers etc.) using counters etc. Thankfully I already made test benches for all the higher level components so re-writing those should be quite easy. Give me a couple of weeks and I will have a re-written fully synchronous and stable core.

sorgelig commented 4 years ago

I don't know if it was available in Pong originally or not, but is it possible to add option for wider paddles?

Eicar commented 4 years ago

I've started the rewrite... option for wider paddles are already implemented :)

dfilskov commented 1 month ago

Looking forward to an update :)