Page 1 of 1
Circuit Simulator?
Posted: Fri Nov 20, 2009 9:09 pm
by spinnaker
There seem to be plenty of simulator / emulators out there for the 6502. But all of the programs I have found mimic a complete 6502 computer.
Are there an circuit simulators that allow me to build a 6502 based computer from the chip up? Add my own encoding. decoding, i/o etc. etc. ?
If so can anyone provide a link?
Hopefully a free one?
Posted: Sat Nov 21, 2009 5:45 am
by kc5tja
Probably the closest to that is my lib65816 package for Linux (it was once ported to Windows, but the Windows maintainer lost interest, and I can no longer guarantee that it'll compile). It concentrates solely on emulating a 65816 microprocessor, and leaves literally everything else up to you.
There are two problems with the package as it now stands:
(1) It's not productized -- you can't just "download, ./configure, make, make install" like most open source projects. It's actually pretty simple to configure and build if you're familiar with C/C++ development. However, if not, it will likely be somewhat foreign to you. Since only two other people beside myself have used it for anything non-trivial, there's really no incentive to productize it.
(2) Implementing the rest of your computer isn't as simple as "dropping in ICs." You actually have to write software that tracks cycles and "rolls forward" the machine state based on time discrepencies. This occurs for performance purposes; a genuinely cycle-by-cycle emulation of the processor and the rest of the computer would make the entire system run as slow as a SPICE simulation. This means you need to know how to implement or at least approximate your finished hardware in pure C/C++.
Let me know if you're interested, and I can provide further support.
Posted: Sat Nov 21, 2009 4:01 pm
by Nightmaretony
One interesting program that may provide ideas towards something bigger is DICE: Digital Integrated Circuit Emulator. It was written original to emulate the PONG arcade game which cannot be done in regular MAME since it uses no processor.
http://adamulation.blogspot.com/
Posted: Sat Nov 21, 2009 4:21 pm
by kc5tja
HUH! Very interesting. I'll be interested in pouring over that code at some point in the future.
Posted: Sat Nov 21, 2009 9:02 pm
by Nightmaretony
Source on the site, the TTL definitions knocked me. Methinks it can become an interesting tool when combined with a 6502 assembler/simulator....
Re: Circuit Simulator?
Posted: Thu Dec 17, 2009 3:47 pm
by BigEd
Are there an circuit simulators that allow me to build a 6502 based computer from the chip up? Add my own encoding. decoding, i/o etc. etc. ?
How would a logic simulator suit you? (In VLSI, we do huge amounts of logic simulation, and limited amounts of highly targetted circuit simulation. We also do static timing analysis, which means we need circuit simulation to characterise the logical components.) If you're mainly interested in getting the logical design right, and you have some kind of story for avoiding or fixing timing problems, then a logic simulator is the right tool.
There are several free
verilog simulators: Stephen Williams'
Icarus verilog is well thought of.
Arlet Ottens'
site has a
6502.v and also a
link to Rob Bird's.
Verilog models for 74 series are not so easy to find - but each should only be a dozen lines, if you only need the logical function.
Here's a 7402