6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 16, 2024 6:18 pm

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: large cache and DRAM
PostPosted: Sun Jan 28, 2018 4:33 pm 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 279
Location: Placerville, CA
C16with64K wrote:
Apparently cardridges for video consoles could not keep up with the speed of CPUs and the 6502 in snes needed to be throttled down.

They could, it just cost more so not all games did it.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 01, 2018 2:33 pm 
Offline

Joined: Wed Oct 06, 2010 9:05 am
Posts: 95
Location: Palma, Spain
Dr Jefyll wrote:
According to one line of reasoning (BigEd could provide the references for this) the 6502 was originally intended to have two accumulators. But they found this would've resulted in too large (and hence too expensive) a chip. So a brutally ruthless decision was made. The chip got very rudely downsized quite late in its development -- leaving some gaping holes in the opcode map.

That's an interesting theory I've never heard before. Ed, can you provide references for this? :)


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 01, 2018 4:20 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
By my rough count, there are about 75 opcodes in the NMOS map which use register A as a source, implied source, or destination. This seems to imply that it is at least plausible (if not practical) that a full-featured register B could have been added to the NMOS map ... and maybe even a tiny bit of room would have been left over for a few 'c02 enhancements like BRA, PHX, PLY, STZ ...

Maybe it would have been more practical to just add a simple XBA instruction ... lots of bang for the buck there ...

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 01, 2018 7:51 pm 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10980
Location: England
I'd forgotten the reference which Jeff picked up, about the two accumulators, but with a little prompting I've found it, and quoted with permission over here:
viewtopic.php?p=58458#p58458


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 01, 2018 8:28 pm 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 679
I wonder if their 2-accumulator design had "A = A op B" style instructions. If not, then yeah a XBA would cover plenty. (And you might as well go for XAC, XAD, XAH, XAL ... ;) )

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 01, 2018 9:56 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
White Flame wrote:
I wonder if their 2-accumulator design had "A = A op B" style instructions.
Maybe, but that's a different theory than the one posed by Segher Boessenkool. "My strong suspicion is that originally the 6500 had *two* accumulators, and the instructions with low bits 11 were like those that now have 01, but for reg B instead of reg A."

White Flame wrote:
If not, then yeah a XBA would cover plenty. (And you might as well go for XAC, XAD, XAH, XAL ... ;) )
Yup. And yup. :)

_________________
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: Fri Feb 02, 2018 4:23 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Quote:
My strong suspicion is that originally the 6500 had *two* accumulators, and the instructions with low bits 11 were like those that now have 01, but for reg B instead of reg A.
For my own interest I started marking up the NMOS opcode map to get a sense of this. And I might as well share the result for any others who are also interested.

All the instructions in the "low bits 01" columns involve accumulator A (and I copied these into the "low bits11" columns). But a few instructions involving A are not in these columns. I marked these using a different color. It's not obvious what the corresponding B Accumulator opcodes would be, but things may've gotten juggled after the B Accumulator was deleted. Segher's theory remains plausible, I'd say.


Attachments:
2 accumulators maybe.png
2 accumulators maybe.png [ 173.54 KiB | Viewed 3385 times ]

_________________
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  
 Post subject: Re: large cache and DRAM
PostPosted: Sun Feb 04, 2018 3:43 am 
Offline

Joined: Wed Jun 26, 2013 9:06 pm
Posts: 56
C16with64K wrote:
DRAM refresh cycles are driven by the VIC-II in the C64. It's the basis for the arrangement. The CPU runs at half the speed of the memory in order to let memory access appear instantanous. This saves circuitry for arbitration. I still think it's a bad idea that the VIC can steal memory cycles from the CPU. For wide words a faster clock means better utilisation of the transistors doing the grunt work. But clock generation and distribution comes at some cost. Also some chips from MOS were prone to overheating. I am sure that a basically low clock rate allows lower supply voltage and higher resistance in the pull-up resistors keeping the current consumption low. If we would use the 6502 in an embedded application, it would be nice to add DRAM refresh. It may be that branches within a cached loop lead to pipeline stalls and a cycle where the 6502 does not access memory. This could be used for refresh. For this the refresh counter would be allowed to stay some ns behind schedule. Of course this means that there are is no cycle timed code. If one uses it for a woz-machine for example, the disk controller would have to generate the DRAM access.

If we could employ a large on-chip cache, bus width cost goes down (no more pins). Then use ARM. Apparently cardridges for video consoles could not keep up with the speed of CPUs and the 6502 in snes needed to be throttled down. They could have used an ARM with large on chip cache and try to eliminate some of their co-processors. It was 1991 after all. Amiga came out 1985.

The biggest problem with the SNES is that developers who were used to 68000 tried way too hard to force the 65816 to do 32-bit number crunching and long addressing.


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 04, 2018 10:16 pm 
Offline

Joined: Wed Mar 02, 2016 12:00 pm
Posts: 343
C16with64K wrote:
And for RISC: I do not understand how you could read and write on the same bus in one cycle. We do not have enough die area for two busses. At most there could be two sets of registers each which their own bus. For example Akkumulator latches the output from ALU. Everything else is on bus. But then how could AX be used as source and target in every 8bit CPU? There need to be two and a bridge to toggle between them. Two busses do not seem that more complicated. This reduces code space.


I tried to make a small core with 6502-like instructions (Nano6502) that do all instructions in one cycle, except the first one.. I hope to extend it over time to be more 6502 or 65816-like, but it is prioritized on speed, so its a slow development.

Basically, I prefetch the data byte and have separate data and code space. Memory is also dual-port so it can be read and written to within the same cycle. The prefetch does happen a half cycle in advance, so its stricktly pipelining that, but its only visible on the first instruction after reset.

The nice thing about single cycle instructions is that zeropage becomes more like 256 registers...

Oh, and all data is fetched as 16 bits, so only two-byte instructions (at the moment). Hope to change that.


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 05, 2018 4:10 am 
Offline

Joined: Wed Jun 26, 2013 9:06 pm
Posts: 56
Would the index registers be 16-bit?


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 05, 2018 9:54 pm 
Offline

Joined: Wed Mar 02, 2016 12:00 pm
Posts: 343
Aaendi wrote:
Would the index registers be 16-bit?


16-bit instructions, meaning 8-bits opcode + 8-bits data/address. But it can be whatever you need it to be, its fairly easy to build upon: http://forum.6502.org/viewtopic.php?f=10&t=4980


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

All times are UTC


Who is online

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