6502 in Logisim

Topics pertaining to the emulation or simulation of the 65xx microprocessors and their peripheral chips.
User avatar
org
Posts: 201
Joined: 22 Jun 2012
Contact:

6502 in Logisim

Post by org »

Hi, we have completed the 6502 circuit design in Logisim.

https://github.com/emu-russia/breaks/tr ... 02_logisim

There are two options there: for classic Logisim 2.7.1 (6502.circ) and for Logisim Evolution 3.7.2 (6502_Evo.circ).

The schematics kind of works and all main processor parts are implemented, but it obviously still needs to be debugged.

Probably, it will be interesting for someone and we will finish it together :)
Attachments
alu_logisim.png
6502_logisim_big.png
6502 addict
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: 6502 in Logisim

Post by BigEd »

Bravo!
User avatar
org
Posts: 201
Joined: 22 Jun 2012
Contact:

Re: 6502 in Logisim

Post by org »

We are making some progress.

The 6502 in Logisim successfully passes the BRK sequence and executes the first few instructions. Some kind of problem with the JSR. We are working on it.

https://github.com/emu-russia/breaks/tr ... 02_logisim

Next to it is visual6502.hex in Logisim format, which can be loaded into RAM.

Also there is a script bin2hex.py, which converts binary files into Logisim format.
Attachments
6502_logisim_bogus_board.jpg
6502 addict
User avatar
org
Posts: 201
Joined: 22 Jun 2012
Contact:

Re: 6502 in Logisim

Post by org »

All problems have been eliminated. The 6502 now works in Logisim as well.
6502 addict
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: 6502 in Logisim

Post by BigEd »

Hurrah! Anything interesting about the difficulty with JSR?
User avatar
org
Posts: 201
Joined: 22 Jun 2012
Contact:

Re: 6502 in Logisim

Post by org »

Nothing new :) Again there were problems with the bi-directional transistors used for SB/DB and SB/ADH commands. I had to do a little hack for the logisim, which does not support bidirectional connections, to account for the "dirty" buses.
6502 addict
joelnoche
Posts: 11
Joined: 15 Mar 2022

Re: 6502 in Logisim

Post by joelnoche »

@org, I am a college teacher at a Philippine university and I would like to assign as an undergraduate student project the task of converting your Logisim design into a Digital design. (The Digital software is the one at https://github.com/hneemann/Digital.) It will be made very clear in the documentation and presentation that the Logisim design was made by you. Is this all right with you?
User avatar
org
Posts: 201
Joined: 22 Jun 2012
Contact:

Re: 6502 in Logisim

Post by org »

No problem, but it's better to mention the `Breaks` project on GitHub (https://github.com/emu-russia/breaks) rather than me, since it's a team effort :)
6502 addict
joelnoche
Posts: 11
Joined: 15 Mar 2022

Re: 6502 in Logisim

Post by joelnoche »

@org, thank you very much. I'll show you their work when they're finished (a few months from now).
User avatar
org
Posts: 201
Joined: 22 Jun 2012
Contact:

Re: 6502 in Logisim

Post by org »

joelnoche wrote:
@org, thank you very much. I'll show you their work when they're finished (a few months from now).
Good luck to your students! I'm very curious what they will do :)
6502 addict
joelnoche
Posts: 11
Joined: 15 Mar 2022

Re: 6502 in Logisim

Post by joelnoche »

@org, my students downloaded the Logisim circuit currently available at github, and they're getting errors when they run the Logisim circuit. The 6502 circuit has wires that are "red" and in error (SB OUT, DB OUT, etc.). Has this been fixed?
User avatar
org
Posts: 201
Joined: 22 Jun 2012
Contact:

Re: 6502 in Logisim

Post by org »

Yes, the 6502.circ works well.
Maybe they downloaded the "Evo" version (for Logisim Evolution), which may still contain bugs since it hasn't been updated in a while.
Attachments
6502_circ.jpg
6502 addict
joelnoche
Posts: 11
Joined: 15 Mar 2022

Re: 6502 in Logisim

Post by joelnoche »

If I'm not mistaken, the file named 6502.circ currently at https://github.com/emu-russia/breaks/tr ... 02_logisim, when opened in Logisim, looks like below.
Attachments
This seems to be an older version of the circuit.
This seems to be an older version of the circuit.
User avatar
org
Posts: 201
Joined: 22 Jun 2012
Contact:

Re: 6502 in Logisim

Post by org »

I get it. You are looking at the state after the very first half cycle (PHI1), during which 6502's behavior is Undefined.

This is due to the fact that the command latches for the lower part are only updated during PHI2, so on the first half-cycle of PHI1 the lower part "goes crazy", as almost all latches issue down all commands at once.

It is enough to perform one more half-cycle and the processor stabilizes.
6502 addict
User avatar
org
Posts: 201
Joined: 22 Jun 2012
Contact:

Re: 6502 in Logisim

Post by org »

See more about very first half-cycle here: https://github.com/emu-russia/breaks/bl ... ops/brk.md
6502 addict
Post Reply