6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Apr 19, 2024 12:59 am

All times are UTC




Post new topic Reply to topic  [ 213 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15  Next
Author Message
 Post subject: Re: Breaking 6502 apart
PostPosted: Thu Jul 04, 2013 6:15 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 899
org wrote:
I updated my PLA utility...

Is org's PLA utility (from Jul 2012) still around? The url does not work...


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sun Jul 07, 2013 3:22 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Decoder can be found here :

http://breaknes.com/files/6502/decoder.htm

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Fri Aug 09, 2013 7:12 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Hello everyone, long time no see )

Please help me to analyse this circuit :
Image

And logic representation :
Image

The problem is following: as you know, PHI1/PHI2 is lag a little over input PHI0. But 6502 documentation says PHI1/PHI2 also have a slighty extended low period, to ensure that PHI1 and PHI2 are never high at the same time.

Can someone simulate this circuit and check for PHI1/PHI2 timing diagram ?

It should be someting like that :
Image

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Fri Aug 09, 2013 1:24 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
Hi Org
please check against this circuit, which looks more plausible: viewtopic.php?f=1&t=2412#p24074

I followed the instructions at viewtopic.php?p=13550#p13550 and was able to capture these images of a simulation of the 6502 netlist (as found in Peter Monta's github project):
Attachment:
cclk-rising.png
cclk-rising.png [ 30.94 KiB | Viewed 2478 times ]

Attachment:
cclk-falling.png
cclk-falling.png [ 31.87 KiB | Viewed 2478 times ]


The nodenames & numbers are from the visual6502 netlist.

Cheers
Ed


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Mon Aug 12, 2013 11:16 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
My friend, more enlightened in the hardware stuff said it is "asymmetric cascade inverter", which delays the rising edge, so it seems that the lower level of PHI1/PHI2 is longer than the upper.

This mean Balazs clock envelopes are slighty incorrect.

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Wed Aug 14, 2013 7:00 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Removed all circuits from circuitlab. Dont like it greedy politics.

Image

Now converting all circuits into sPlan format and doing double check.

Latest circuitlab circuits can be found here (may be outdated in near future) : http://breaknes.com/files/6502/6502_circuitlab.zip (2 MB)

Also I want to introduce project wiki : http://wiki.breaknes.com (currently only on russian)

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sat Aug 17, 2013 7:08 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Revised approach to the device debugger. Now its made in the form of a scalable circuit image layout with controls located on top of it and also scaled along with a picture.
Simulated module passing list of "triggers" to the core, which can be controlled through debug interface.
Going to make it as tabbed interface for different parts, when I get rid with Qt :)

Execution simply made by pressing "Next Step" button, which execute "Step" procedure of simulated ciruit and toggles input clock.


Attachments:
breaks_debug2.jpg
breaks_debug2.jpg [ 94.24 KiB | Viewed 2369 times ]
breaks_debug.jpg
breaks_debug.jpg [ 197.03 KiB | Viewed 2369 times ]

_________________
6502 addict
Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Wed Sep 25, 2013 9:13 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Hi :) I put my latest circuits here


Attachments:
regs_logic.jpg
regs_logic.jpg [ 53.54 KiB | Viewed 2326 times ]
branch-logic.jpg
branch-logic.jpg [ 101.51 KiB | Viewed 2326 times ]
regs_nice.jpg
regs_nice.jpg [ 27.95 KiB | Viewed 2326 times ]
branch_nice.jpg
branch_nice.jpg [ 47 KiB | Viewed 2326 times ]
6502_context.jpg
6502_context.jpg [ 167.76 KiB | Viewed 2326 times ]

_________________
6502 addict
Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Wed Sep 25, 2013 6:22 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
Hanson's diagram shows SB also connecting to ADH through pass gates...


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Thu Sep 26, 2013 5:03 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
It exist :
Image

_________________
6502 addict


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Thu Sep 26, 2013 6:43 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
Oh! I didn't see it...


Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Fri Sep 27, 2013 10:38 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Nice decoder circuit.


Attachments:
decoder_nice.jpg
decoder_nice.jpg [ 775.64 KiB | Viewed 2245 times ]

_________________
6502 addict
Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sun Oct 26, 2014 7:10 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Complete 6502 interrupt processing circuit.

And short description.

Input pads /NMI, /IRQ, /RES are saved in input triggers.

Interrupt generation circuit additionally requires 6 and 7 cycles (since they do not arrive from decoder) (control signals BRK6E and BRK7). Control signal BRK6E begins during the PHI2 of 6th cycle and ends during PHI1 of 7th cycle (overlap 6 and 7 cycle). This is done in order to determine the edge of the signal /NMI. Edge detection of /NMI based on classic edge detect circuit (two cross-coupled RS-triggers).

The signal /RES is further saved on the RESET FLIP/FLOP, as it is required for other random logic circuits (in particular for a special control of R/W pad during reset).

The fact of the arrival of any interrupt reflected on B-flag, the output of which (B_OUT) forces the processor to execute BRK instruction (opcode 0x00). Thus developers unified processing of all interrupts.

Last small circuit generates an interrupt address (or vector) (control lines 0/ADL0, 0/ADL1 and 0/ADL2), which is reflected on 3 bits of the address bus.

The interesting thing is affection of BR2 (Branch T2) and T0 (Execute Cycle 0) control lines on interrupt detection (IRQ CHECK).

In case you wish to play with it in Logisim, you can grab it from SVN:
https://code.google.com/p/breaks/source ... 2/INT.circ

PS. All D-latches are level-triggered. Those one with invertor are PHI1 driven (and in turn PHI2 driven without it).


Attachments:
111.png
111.png [ 12.61 KiB | Viewed 1964 times ]
INT.png
INT.png [ 54.93 KiB | Viewed 1965 times ]

_________________
6502 addict
Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Mon Nov 03, 2014 12:24 am 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Random logic + Dispatcher.

Everything seems to work fine :mrgreen:

Next step : connect all things together, try to execute some instruction and examine controls to bottom part.


Attachments:
RANDOM.png
RANDOM.png [ 407.18 KiB | Viewed 1924 times ]

_________________
6502 addict
Top
 Profile  
Reply with quote  
 Post subject: Re: Breaking 6502 apart
PostPosted: Sat Nov 08, 2014 1:50 pm 
Offline
User avatar

Joined: Fri Jun 22, 2012 7:39 am
Posts: 201
Here we go !

Complete top part 6502 simulation in discrete logic elements!

https://code.google.com/p/breaks/source ... ANDOM.circ

Enjoy :mrgreen:

Sadly its impossible to simulate full 6502 in Logisim, since it doesn't support bidirectional wires and I have no clue how to implement bus-to-bus connections there.

I'm going to implement it in Verilog, check on CPLD and rewrite on C, for my emulator project.

PS. I fixed some bugs in random logic, check updated version in attach.


Attachments:
RANDOM.png
RANDOM.png [ 409.96 KiB | Viewed 1883 times ]
6502_top1.png
6502_top1.png [ 64.16 KiB | Viewed 1883 times ]

_________________
6502 addict
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 213 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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: