Circuit Simulator?

For discussing the 65xx hardware itself or electronics projects.
Post Reply
spinnaker
Posts: 15
Joined: 16 Nov 2009

Circuit Simulator?

Post 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?
kc5tja
Posts: 1706
Joined: 04 Jan 2003

Post 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.
Nightmaretony
In Memoriam
Posts: 618
Joined: 27 Jun 2003
Location: Meadowbrook
Contact:

Post 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/
"My biggest dream in life? Building black plywood Habitrails"
kc5tja
Posts: 1706
Joined: 04 Jan 2003

Post by kc5tja »

HUH! Very interesting. I'll be interested in pouring over that code at some point in the future.
Nightmaretony
In Memoriam
Posts: 618
Joined: 27 Jun 2003
Location: Meadowbrook
Contact:

Post 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....
"My biggest dream in life? Building black plywood Habitrails"
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Circuit Simulator?

Post by BigEd »

spinnaker wrote:
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
Post Reply