6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Sep 28, 2024 9:34 am

All times are UTC




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri Oct 14, 2016 5:54 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8403
Location: Midwestern USA
White Flame wrote:
RDY doesn't prevent writes, so it wouldn't be enough for a dirty cache line eviction write pause.

That's only the case with the NMOS 6502 family. CMOS implementations will halt on a write.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 15, 2016 7:48 am 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 674
There was something newer than the Commodore 64? See who's the Big Dumb Dinosaur now! ;)

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


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 14, 2016 9:10 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
I did some measurements this morning which might help inform the question of how and where to use caches for the 6502.

The context is the Matchbox CoPro hooked up to an Acorn BBC Micro. That is, a 64MHz FPGA programmed as a 65C02, with 64kByte of on-FPGA single-cycle RAM, and 1MByte of off-FPGA 5-cycle RAM.

The benchmark used is "clocksp", a Basic program exercising various types of code. The experiments involved remapping various bits of the memory space to the slower off chip memory. Looking at it the other way around, you get an indication of the possible benefit of putting a single-cycle cache in front of the slower memory.

  • With only fast RAM in play, as a baseline, clocksp reports 65.33MHz
  • Moving Basic ($8000 to $C000) from fast RAM to slow RAM: 17.48MHz
  • Also moving &2000 to &8000 to slow RAM: 17.37MHz
  • Also moving PAGE up to &2000: 17.10MHz
  • Moving everything from &0000 up to &E000 to slow RAM: 13.09MHz
  • Moving only the &0000 to &2000 area: 29.58MHz
  • Moving only the &0000 to &2000 area and setting PAGE to &2000: 30.57MHz

So, with slow RAM in play everywhere, we get 13MHz, more or less as expected. If we can keep page zero and the stack in fast RAM, we're up to 17MHz, which is substantially faster. If instead we could run our code from single-cycle on-chip cache, but only the code, we might get 30MHz.

That is to say: there's a big gain from speeding up instruction (and operand) reads. I would have expected zero page speedup to be more important, but on reflection I'm not surprised to see that's not so.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 15, 2016 7:29 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
It would be interesting to see how much you can save by adding an Output Enable signal so you can avoid slow RAM reads on idle cycles.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 15, 2016 8:09 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
Yes, it would! My guess is that there are not so many dead cycles that it would be a big win, but clearly there would be a win. (Any sketch of an idea as to how we'd construct the dead cycle signal in your core?)


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 15, 2016 9:08 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
You could start by adding the OE signal, and assert it in the REG states, so you can catch all the INX/DEX/TYA/CLC and friends. And of course, you'd have to incorporate the OE signal in your memory controller.

After that you can go through all the other states one by one.


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

All times are UTC


Who is online

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