From this patent: (US3987418A, now found here) which compares to the 6502 (as seen at visual6502): ...much less than I expected! I'm shocked!
Visualizing the 6502
BigEd wrote:
... interested in the 6800, because I'd like to see what similarities and differences exist ...
From this patent: (US3987418A, now found here) which compares to the 6502 (as seen at visual6502): ...much less than I expected! I'm shocked!
Last edited by BigEd on Sun Dec 24, 2023 2:34 pm, edited 4 times in total.
BigEd wrote:
BigEd wrote:
... interested in the 6800, because I'd like to see what similarities and differences exist ...
gd&r, Hias
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
ElEctric_EyE wrote:
What are the I5x pullouts from the die?
I notice the patent text refers to many other patent applications submitted in the same timeframe, including on interrupts and on instruction look-ahead. One of the circuits I intend to investigate in the 6502 simulator is the lookahead - it looks like the databus is inspected and some pre-decode signals derived during the fetch cycle. If that's right, then it's stealing some nanoseconds from the external access time. It's possible this trick is inherited from the 6800.
I do have more named signals available than the released version of the simulator has - I imagine there'll be an update before long. I don't yet have the identities of the PLA outputs or the datapath control inputs, but I'll get them. We'll need a way to display or tabulate changes on all these signals too - presently I'm doing that by adhoc modifications to the javascript (pasted into the console at runtime)
Here's a curiousity - this 65816 programming book has a die photo on the cover and it looks like a stretch-limo version of 6502. The datapath appears to be double length not double width:
Edit: replace lost imageshack-hosted image with attachment
Edit: replace lost imageshack-hosted image with attachment
Last edited by BigEd on Fri Dec 13, 2013 12:37 pm, edited 1 time in total.
update: smaller, faster, can load and run programs
The visual simulator just got faster and smaller (must be Moore's law)
There's also now a more low-level advanced interface, and by passing an appropriate URL you can load and run a short test program:
http://visual6502.org/JSSim/expert.html ... =60&r=0020
That particular program answers the riddle:
Q. When is the stack pointer not the stack pointer?
In this 'graphics=false' mode you can use the 'Show chip layout' button to explore the chip layout, where each conductor is coloured according to the logic level as the simulation progresses. '>' to zoom in, click and drag to pan.
Thanks to Greg, Barry and Brian for many of the new features.
Cheers
Ed
Edit: update link from pre-release to released area
There's also now a more low-level advanced interface, and by passing an appropriate URL you can load and run a short test program:
http://visual6502.org/JSSim/expert.html ... =60&r=0020
That particular program answers the riddle:
Q. When is the stack pointer not the stack pointer?
In this 'graphics=false' mode you can use the 'Show chip layout' button to explore the chip layout, where each conductor is coloured according to the logic level as the simulation progresses. '>' to zoom in, click and drag to pan.
Thanks to Greg, Barry and Brian for many of the new features.
Cheers
Ed
Edit: update link from pre-release to released area
Last edited by BigEd on Wed Nov 10, 2010 8:35 pm, edited 1 time in total.
My first post here! Thanks a lot to the whole team for such an astounding piece of work; it's fascinating to see what's going on.
That's a curious thing that SP is trashed while executing a JSR (actually, I noticed this yesterday when I was playing about with 'expert mode', and thought it was some kind of bug in the frontend!). I wonder why it does that?
I have a question - what is the 'tcstate' column? First of all, I guessed it was the timer state (as sent to the PLA), but given that it barely changes (for example, during the JSR) and would be better represented as a series of bits, I guess not.
That's a curious thing that SP is trashed while executing a JSR (actually, I noticed this yesterday when I was playing about with 'expert mode', and thought it was some kind of bug in the frontend!). I wonder why it does that?
I have a question - what is the 'tcstate' column? First of all, I guessed it was the timer state (as sent to the PLA), but given that it barely changes (for example, during the JSR) and would be better represented as a series of bits, I guess not.
Welcome!
Note that SP isn't trashed, it's borrowed for the LSB while the PC is written to the stack. During those writes, the value of SP must be decremented, so it spends a few cycles in the ALU - leaving the SP register free as a temporary!
The tcstate presentation is a bug, I'm afraid. It should show values like 011111, 101111 and so on, but I added the bits instead of concatenating them. There's a fix in the works!
(If you feel intrepid, you can find your browser's Javascript Console, get it to print out busToString, and adjust it to read
which is code you can find on github
)
You should then see something like this tabulation:
Cheers!
Ed
edit: SP is of course decremented, not incremented, for a push
Note that SP isn't trashed, it's borrowed for the LSB while the PC is written to the stack. During those writes, the value of SP must be decremented, so it spends a few cycles in the ALU - leaving the SP register free as a temporary!
The tcstate presentation is a bug, I'm afraid. It should show values like 011111, 101111 and so on, but I added the bits instead of concatenating them. There's a fix in the works!
(If you feel intrepid, you can find your browser's Javascript Console, get it to print out busToString, and adjust it to read
Code: Select all
function busToString(busname){
// takes a signal name or prefix
// returns an appropriate string representation
if(busname=='cycle')
return cycle>>1;
if(busname=='pc')
return busToHex('pch') + busToHex('pcl');
if(busname=='p')
return readPstring();
if(busname=='tcstate')
return ['clock1','clock2','t2','t3','t4','t5'].map(busToHex).join("");
return busToHex(busname);
}
)
You should then see something like this tabulation:
Code: Select all
cycle ab db rw sync pc a x y s p ir tcstate pd adl adh sb alu alucin alua alub alucout aluvout dasb
0 0000 a9 1 1 0000 aa 00 00 fd nv-bdIZc 00 011111 ff 00 00 ff 00 0 ff 00 0 0 ff
0 0000 a9 1 1 0000 aa 00 00 fd nv-bdIZc 00 011111 56 01 00 ff ff 0 ff 00 0 0 ff
1 0001 00 1 0 0001 aa 00 00 fd nv-bdIZc a9 100111 56 01 00 ff ff 0 ff ff 0 0 ff
1 0001 00 1 0 0001 aa 00 00 fd nv-bdIZc a9 100111 ff 02 00 ff fe 0 ff ff 1 0 ff
2 0002 20 1 1 0002 00 00 00 fd nv-bdIZc a9 011111 ff 02 00 00 fe 0 00 00 1 0 00
2 0002 20 1 1 0002 00 00 00 fd nv-bdIZc a9 011111 df 03 00 00 00 0 00 00 0 0 00
3 0003 10 1 0 0003 00 00 00 fd nv-bdIZc 20 110111 df 03 00 00 00 0 00 00 0 0 00
3 0003 10 1 0 0003 00 00 00 fd nv-bdIZc 20 110111 ef fd 01 ff 00 0 00 00 0 0 ff
4 01fd 00 1 0 0004 00 00 00 10 nv-bdIZc 20 111011 ef fd 01 10 00 0 00 fd 0 0 10
4 01fd 00 1 0 0004 00 00 00 10 nv-bdIZc 20 111011 ff fd ff ff fd 0 00 fd 0 0 ff
5 01fd 00 0 0 0004 00 00 00 10 nv-bdIZc 20 111101 ff fd ff ff fd 0 ff fd 0 0 ff
5 01fd 00 0 0 0004 00 00 00 10 nv-bdIZc 20 111101 ff fc ff ff fc 0 ff fd 1 0 ff
6 01fc 00 0 0 0004 00 00 00 10 nv-bdIZc 20 111110 ff fc ff ff fc 0 ff fc 1 0 ff
6 01fc 04 0 0 0004 00 00 00 10 nv-bdIZc 20 111110 fb 04 00 fb fb 0 ff fc 1 0 fb
7 0004 00 1 0 0004 00 00 00 10 nv-bdIZc 20 101111 fb 04 00 fb fb 0 fb 00 1 0 fb
7 0004 00 1 0 0004 00 00 00 10 nv-bdIZc 20 101111 ff 10 ff fb fb 0 fb 00 0 0 fb
8 0010 e8 1 1 0010 00 00 00 fb nv-bdIZc 20 011111 ff 10 00 fb fb 0 00 00 0 0 fb
8 0010 e8 1 1 0010 00 00 00 fb nv-bdIZc 20 011111 17 11 00 00 00 0 00 00 0 0 00
Ed
edit: SP is of course decremented, not incremented, for a push
Last edited by BigEd on Fri Oct 08, 2010 11:40 am, edited 1 time in total.
BigEd wrote:
Note that SP isn't trashed, it's borrowed for the LSB while the PC is written to the stack. During those writes, the value of SP must be incremented, so it spends a few cycles in the ALU - leaving the SP register free as a temporary!
BigEd wrote:
The tcstate presentation is a bug, I'm afraid. It should show values like 011111, 101111 and so on, but I added the bits instead of concatenating them. There's a fix in the works!
RichTW wrote:
BigEd wrote:
The tcstate presentation is a bug, I'm afraid. It should show values like 011111, 101111 and so on, but I added the bits instead of concatenating them. There's a fix in the works!
Note also that in the Sync cycle, the IR still holds the previous instruction and the machine is still acting on that. It's a simplification (at best) to think of this as T0 of the instruction being fetched. From the point of view of the programmer's model it's good enough, but if you insist on thinking that way down at the microarchitectural level, you might conclude that the 6502 can't be built!
Cheers
Ed
Edit: spello
Last edited by BigEd on Sat Apr 16, 2011 4:57 pm, edited 1 time in total.
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
yes, at least in the sense that the netlists already get downloaded and used by your browser when you visit the site!
Now, what you actually download are javascript files, with some comments, which between them tell you which transistors are connected to which nets, and gives you some names for some of those nets - including the pads of course.
What you don't get is a netlist in a recognisable form, like SPICE or Verilog. Also, you're getting transistors, not logic gates. Some of the transistors form easily recognisable logic gates, but some don't, because there are some non-obvious but efficient ways of building shared busses and latch structures.
If there were a good standard format for transistor level netlists someone could probably rustle up a conversion fairly easily. Irsim seems like the right sort of (free) simulator, but I don't know anything about the netlist formats it supports.
What did you have in mind? (Those transistor-level tricks make it tricky to see how to port to an FPGA.)
Now, what you actually download are javascript files, with some comments, which between them tell you which transistors are connected to which nets, and gives you some names for some of those nets - including the pads of course.
What you don't get is a netlist in a recognisable form, like SPICE or Verilog. Also, you're getting transistors, not logic gates. Some of the transistors form easily recognisable logic gates, but some don't, because there are some non-obvious but efficient ways of building shared busses and latch structures.
If there were a good standard format for transistor level netlists someone could probably rustle up a conversion fairly easily. Irsim seems like the right sort of (free) simulator, but I don't know anything about the netlist formats it supports.
What did you have in mind? (Those transistor-level tricks make it tricky to see how to port to an FPGA.)
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA