Make cache 2-way associative

Tue, 06 Apr 2010 18:27:55 +0100

author
Philip Pemberton <philpem@philpem.me.uk>
date
Tue, 06 Apr 2010 18:27:55 +0100
changeset 7
0a26167af7e1
parent 6
a8e459b24c31
child 9
0eb235b23d55

Make cache 2-way associative

Switched from Direct Mapped to 2-Way Set Associative caches. Should boost speed
a bit.

lm32_include.v file | annotate | diff | revisions
     1.1 --- a/lm32_include.v	Mon Apr 05 21:00:31 2010 +0100
     1.2 +++ b/lm32_include.v	Tue Apr 06 18:27:55 2010 +0100
     1.3 @@ -52,14 +52,14 @@
     1.4  // CFG_ICACHE_ASSOCIATIVITY=1 => disaster, CPU will not work at all
     1.5  // Works 100% OK with expensive synthesizers.
     1.6  `define CFG_ICACHE_ENABLED
     1.7 -`define CFG_ICACHE_ASSOCIATIVITY   1
     1.8 +`define CFG_ICACHE_ASSOCIATIVITY   2
     1.9  `define CFG_ICACHE_SETS            512
    1.10  `define CFG_ICACHE_BYTES_PER_LINE  4
    1.11  `define CFG_ICACHE_BASE_ADDRESS    32'h0
    1.12  `define CFG_ICACHE_LIMIT           32'h7FFF_FFFF
    1.13  
    1.14  `define CFG_DCACHE_ENABLED
    1.15 -`define CFG_DCACHE_ASSOCIATIVITY   1
    1.16 +`define CFG_DCACHE_ASSOCIATIVITY   2
    1.17  `define CFG_DCACHE_SETS            512
    1.18  `define CFG_DCACHE_BYTES_PER_LINE  4
    1.19  `define CFG_DCACHE_BASE_ADDRESS    32'h0