6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 6:37 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: 6502 in Logisim
PostPosted: Thu May 19, 2022 1:28 am 
Offline

Joined: Tue Mar 15, 2022 6:33 am
Posts: 11
Thanks. I and my students will look into it.
Which version of the circuit is the most recent one, the one currently at GitHub (shown below left) or the one described in the documentation (Breaking NES Book 6502 Core Rev. B4) (shown below right)?


Attachments:
File comment: Which is the most recent version?
temp.png
temp.png [ 186.85 KiB | Viewed 2725 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 in Logisim
PostPosted: Thu May 19, 2022 9:46 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Both are an approximation of what is actually there.
Logisim does not support bidirectional connections, which are used in large numbers at the bottom of the processor (buses).

The one in the book contains no special "hacks" to handle bus conflicts.

You need to figure out on your own how best to simulate bidirectional connections in your program if it does not support inOut entities (in Verilog terms).

It is best to read carefully what is written on our wiki, I think all questions will disappear naturally :)

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 in Logisim
PostPosted: Thu May 19, 2022 2:50 pm 
Offline

Joined: Tue Mar 15, 2022 6:33 am
Posts: 11
@org, okay, thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 in Logisim
PostPosted: Mon Feb 19, 2024 10:18 pm 
Offline

Joined: Sun Jan 21, 2024 11:41 pm
Posts: 1
First of all, great work!

I stumbled upon a few things while recreating the schematic in KiCad/eeschema which I thought would be nice to share.

First, I noticed that the output databus is latched at the end of phase 1. That's apparently how Logisim RAM works. This is not the same as real hardware where the transaction takes place during phase 2 and ends when R/W goes high again.

Secondly, I noticed that the transfer of SB to AC on PHI2 only seems to work because of a hazard that occurs in Logisim. SB/AC and PHI2 are not supposed to ever be high at the same time, but there is a small window when PHI2 goes high before SB/AC goes low again.

Attachment:
ALU_AC_latch.png
ALU_AC_latch.png [ 6.9 KiB | Viewed 1007 times ]


This is a side effect of Logisim's simulation. Other simulations I ran (LCC, another ED simulation, and Verilator) failed to latch SB into AC. I fixed this by latching on SB/AC directly.

Thirdly, the BCD correction does not work. I traced it back to the following wrong connection:

Attachment:
bcd-fix.png
bcd-fix.png [ 2.76 KiB | Viewed 1007 times ]


/carry3 connects after the AND port. After that, the full 6502 Dormann test passes!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: