6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 2:25 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Feb 28, 2017 8:10 pm 
Offline

Joined: Sun Jan 08, 2017 12:07 am
Posts: 11
I'm currently writing a VHDL 6502 core for an FPGA. I'm trying to stay as true to the original microarchitecture as possible in my design, and have been using this block diagram to do so. I'm currently working on the control logic for implementing absolute addressing. I have PCL, PCH, ABL, and ABH registers, as shown in the block diagram. However, I'm unsure as to how I should "save" the lower byte of the effective address used in absolute addressing. I can't hold it in ABL, since I need to load that with the incremented value of PC to retrieve the upper byte of the effective address on the next cycle. I could simply create another intermediate register to hold the lower byte, but I'm wondering how the original 6502 handled this issue before I go changing the microarchitecture, as I'm not gleaning anything from looking at the block diagram. Anyone here know?


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 28, 2017 8:34 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
It's often useful to look at some traces in visual6502.

Here we see that the LSB (the first operand byte) passes through the ALU:
http://www.visual6502.org/JSSim/expert. ... 22ad1122ea

So there's your answer - values can take a trip through the ALU to be safe for a cycle.

Edit: I couldn't get to your image link, but I assume you're using Donald Hanson's block diagram.
http://visual6502.org/wiki/index.php?ti ... ck_Diagram


Last edited by BigEd on Tue Feb 28, 2017 9:01 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 28, 2017 8:44 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
I don't know the answer; but although tedious, it may be helpful to see how others have done it:


(These are from the "65-family processors, history, HDL, emulators" section of my links page which has hundreds of 6502 links.) Edit: I see Ed posted while I was writing.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 28, 2017 9:01 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Thanks Garth - extra pointers always helpful!


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 28, 2017 9:50 pm 
Offline

Joined: Sun Jan 08, 2017 12:07 am
Posts: 11
Thanks very much, both of you!


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 28, 2017 9:54 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Good luck with your project - do post updates as you make progress!


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 01, 2017 12:31 am 
Online
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
CitizenSnips wrote:
I'm trying to stay as true to the original microarchitecture as possible in my design, and have been using this block diagram to do so.

Best of luck with your project!

If you haven't already, you should consider the bidirectional nature of the two sets of pass MOSFET's. An actual 6502 exploits the MOSFET's ability to pass a signal in either direction (as can be seen if you explore various visual6502 simulations).

Directly implemented in silicon, the pass transistors are a shortcut that simplifies the design. Unfortunately that's not the case in the FPGA context. This isn't intended to discourage you. I'm just pointing out that using the original 6502 as your roadmap may drastically complicate matters, contrary to what one might expect.

AFAIK only one of the 19 cores in Garth's list models the pass transistors; all the other cores use unidirectional signal paths, which of course map much more easily to FPGA. The exception is Andrew Holme's core, which he describes here and which is the subject of this forum thread.

(BTW, CitizenSnips, it's not necessary to use third-party sites for posting images. On this forum you have the option of including images as attachements to your post. :) )

cheers,
Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 01, 2017 2:08 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
Dr Jefyll wrote:
... (BTW, CitizenSnips, it's not necessary to use third-party sites for posting images. On this forum you have the option of including images as attachements to your post. :) )

cheers,
Jeff

... as a spammer did early this morning (UTC-8) with much vigor, until Garth or Ed chopped him or her off at the ankles. Thanks, guys, I like to keep my porn in a separate frame of mind. ;-)

Mike B.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 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: