Transistor level emulation
-
zeroone
- Posts: 939
- Joined: Mon Dec 29, 2014 1:46 pm
- Location: New York, NY
Transistor level emulation
Does Visual6502 simulate any of the analog characteristics of the circuit elements? Or, it is an idealized switching level simulation (i.e. the transistors act like perfect relay switches that are opened or closed)?
-
lidnariq
- Site Admin
- Posts: 11802
- Joined: Sun Apr 13, 2008 11:12 am
Re: Transistor level emulation
No, it does not implement analog or asynchronous behavior. (Visual6502 is not SPICE, nor is it clear that emulating the entire chip in that manner is useful, as opposed to identifying a situation where that would be useful and simulating that subset. e.g. visual6502wiki:6502 Opcode 8B)
-
zeroone
- Posts: 939
- Joined: Mon Dec 29, 2014 1:46 pm
- Location: New York, NY
Re: Transistor level emulation
Thanks.lidnariq wrote:No, it does not implement analog or asynchronous behavior. (Visual6502 is not SPICE,
How many transistors are in the CPU and PPU combined? Graph traversal (a flood-fill) for voltage propagation runs at O(n). Shouldn't we be able to run a switch-level simulation at real-time speed by just looping between voltage propagation and flipping switches?
The simulation is incomplete?lidnariq wrote:nor is it clear that emulating the entire chip in that manner is useful, as opposed to identifying a situation where that would be useful and simulating that subset. e.g. visual6502wiki:6502 Opcode 8B)
-
lidnariq
- Site Admin
- Posts: 11802
- Joined: Sun Apr 13, 2008 11:12 am
Re: Transistor level emulation
6502 is about 3500. 2A03 is about 10000. 2C02 is about 16000.zeroone wrote:How many transistors are in the CPU and PPU combined?
For each simulator, look at transdefs.js
So? It also doesn't simulate individual electrons or the effects of gamma rays or defects from nuclear radiation.zeroone wrote:The simulation is incomplete?
The objective was never finding out what goes wrong when you undervolt or overclock a 6502, but rather to find out what behaviors are going on when it's operating as designed. The entire point of digital design is that you can make these assumptions and get a working object. The extra bits of the 2A03 and 2C02 are also almost entirely compliant too, with the exception of the OAM DRAM and the video DAC.
Anyway, it's almost impossible to accurately simulate the analog or dynamic behavior of something when it's removed from its context. If you're chasing down analog coupling between the PPU's video signal and XAA behavior, it's extremely unlikely that anything you find can be extrapolated to anything else—not even another NES mainboard.
-
Myask
- Posts: 965
- Joined: Sat Jul 12, 2014 3:04 pm
Re: Transistor level emulation
How does the 2A03 not having the BCD hooked up affect 8B:XAA? Do we know?lidnariq wrote:No, it does not implement analog or asynchronous behavior. (Visual6502 is not SPICE, nor is it clear that emulating the entire chip in that manner is useful, as opposed to identifying a situation where that would be useful and simulating that subset. e.g. visual6502wiki:6502 Opcode 8B)
-
zeroone
- Posts: 939
- Joined: Mon Dec 29, 2014 1:46 pm
- Location: New York, NY
Re: Transistor level emulation
That's not what I meant. You said:lidnariq wrote:So? It also doesn't simulate individual electrons or the effects of gamma rays or defects from nuclear radiation.
The objective was never finding out what goes wrong when you undervolt or overclock a 6502, but rather to find out what behaviors are going on when it's operating as designed. The entire point of digital design is that you can make these assumptions and get a working object. The extra bits of the 2A03 and 2C02 are also almost entirely compliant too, with the exception of the OAM DRAM and the video DAC.
Anyway, it's almost impossible to accurately simulate the analog or dynamic behavior of something when it's removed from its context. If you're chasing down analog coupling between the PPU's video signal and XAA behavior, it's extremely unlikely that anything you find can be extrapolated to anything else—not even another NES mainboard.
If the simulation were capable of running at real-time speeds, why wouldn't that be useful for an emulator?lidnariq wrote:nor is it clear that emulating the entire chip in that manner is useful
-
Dwedit
- Posts: 5256
- Joined: Fri Nov 19, 2004 7:35 pm
Re: Transistor level emulation
Because you get a space heater in addition to an emulated NES, whereas with a far simpler emulator, you don't heat up a house.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
-
lidnariq
- Site Admin
- Posts: 11802
- Joined: Sun Apr 13, 2008 11:12 am
Re: Transistor level emulation
It doesn't: in the 2A03 the BCD mode was disabled by removing a single connection so that the adjustment logic believes the D flag is always clear.Myask wrote:How does the 2A03 not having the BCD hooked up affect 8B:XAA? Do we know?
-
zeroone
- Posts: 939
- Joined: Mon Dec 29, 2014 1:46 pm
- Location: New York, NY
Re: Transistor level emulation
The primary motivators are accuracy and simplicity. If a switch-level transistor model can be made to run in real-time, then building an emulator would just involve dealing with the chip pins. In principle it should be possible to run efficiency because the algorithm is parallelizable. It can take advantage of multiple cores. Maybe it can even run on the GPU. Why hasn't this been attempted yet?Dwedit wrote:Because you get a space heater in addition to an emulated NES, whereas with a far simpler emulator, you don't heat up a house.
-
3gengames
- Formerly 65024U
- Posts: 2284
- Joined: Sat Mar 27, 2010 12:57 pm
Re: Transistor level emulation
Because it's not needed for accurate emulation. Period.
-
rainwarrior
- Posts: 8764
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
Re: Transistor level emulation
Doesn't Visual 6502 already take like 30 minutes per frame? What more reason do you need?zeroone wrote:Why hasn't this been attempted yet?
-
Drag
- Posts: 1707
- Joined: Mon Sep 27, 2004 2:57 pm
Re: Transistor level emulation
Transistor-level emulation is extremely low-level emulation, and is more useful for engineers when it's time to physically open an NES up and poke at it to figure out some specific ill-understood behavior. However, as we better understand the way the NES works, we can directly simulate the results and completely skip all of the internal bit-flipping, which is what allows emulators to run in real time and not consume 100% of the CPU and GPU's cores. That's why this hasn't been attempted yet.zeroone wrote:The primary motivators are accuracy and simplicity. If a switch-level transistor model can be made to run in real-time, then building an emulator would just involve dealing with the chip pins. In principle it should be possible to run efficiency because the algorithm is parallelizable. It can take advantage of multiple cores. Maybe it can even run on the GPU. Why hasn't this been attempted yet?
If this were a pet project just to see if something like this could be made possible, then sure, try it out. It would prove to be a pretty big challenge though.
-
Zepper
- Formerly Fx3
- Posts: 3262
- Joined: Fri Nov 12, 2004 4:59 pm
- Location: Brazil
Re: Transistor level emulation
Mother of God... 
-
zeroone
- Posts: 939
- Joined: Mon Dec 29, 2014 1:46 pm
- Location: New York, NY
Re: Transistor level emulation
Ouch. I'll still try to investigate further, but that doesn't sound hopeful.rainwarrior wrote:Doesn't Visual 6502 already take like 30 minutes per frame? What more reason do you need?
-
provably
- Posts: 10
- Joined: Tue Dec 15, 2015 3:50 am
Re: Transistor level emulation
To have a truly accurate emulator, we need to formally prove its correctness in respect to Visual2A03/2C02.