-
在 gem5/config/common/Caches.py 新增L3Cache
-
在 gem5/config/common/CacheConfig.py
-
在 gem5/config/common/Options.py 中新增一條 option
-
在 gem5/src/mem/XBar.py 中新增L3XBar這個class (從L2XBar複製過來)
-
在 gem5/src/cpu/BaseCPU.py 中
-
重新編譯
scons EXTRAS=../NVmain build/X86/gem5.opt
-
重新編譯後執行時 option 加上 --l3cache 即可調用 l3 cache
- command:
./build/X86/gem5.opt -d ../q2_out configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/benchmark/quicksort --cpu-type=TimingSimpleCPU --caches --l2cache --l3cache --mem-type=NVMainMemory --nvmain-config=../NVmain/Config/PCM_ISSCC_2012_4GB.config > ../q2_out/log
- command
./build/X86/gem5.opt -d ../q3_out/2_way/ configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/benchmark/quicksort --cpu-type=TimingSimpleCPU --caches --l2cache --l3cache --l3_assoc=2 --l1i_size=32kB --l1d_size=32kB --l2_size=128kB --l3_size=512kB --mem-type=NVMainMemory --nvmain-config=../NVmain/Config/PCM_ISSCC_2012_4GB.config > ../q3_out/2_way/log
- 適當調整大小讓l3 cache 的 miss rate 有變化
- miss rate
- command
./build/X86/gem5.opt -d ../q3_out/full_way/ configs/example/se.py -c tests/test-progs/hello/bin/x86/linux/benchmark/quicksort --cpu-type=TimingSimpleCPU --caches --l2cache --l3cache --l3_assoc=1 --l1i_size=32kB --l1d_size=32kB --l2_size=128kB --l3_size=512kB --mem-type=NVMainMemory --nvmain-config=../NVmain/Config/PCM_ISSCC_2012_4GB.config > ../q3_out/full_way/log
- 適當調整大小讓l3 cache 的 miss rate 有變化
- miss rate
-
這裡用2-way asscoiative
-
在 gem5/config/common/Caches.py
-
command-original policy
./build/X86/gem5.opt -d ../q4_out/lru/ configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/benchmark/quicksort --cpu-type=TimingSimpleCPU --caches --l2cache --l3cache --l3_assoc=2 --l1i_size=32kB --l1d_size=32kB --l2_size=128kB --l3_size=512kB --mem-type=NVMainMemory --nvmain-config=../NVmain/Config/PCM_ISSCC_2012_4GB.config > ../q4_out/lru/log
-
command-frequency based policy
./build/X86/gem5.opt -d ../q4_out/lfu/ configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/benchmark/quicksort --cpu-type=TimingSimpleCPU --caches --l2cache --l3cache --l3_assoc=2 --l1i_size=32kB --l1d_size=32kB --l2_size=128kB --l3_size=512kB --mem-type=NVMainMemory --nvmain-config=../NVmain/Config/PCM_ISSCC_2012_4GB.config > ../q4_out/lfu/log
Q5 - Test the performance of write back and write through policy based on 4-way associative cache with isscc_pcm(15%)
-
write back
- command:
./build/X86/gem5.opt -d ../q5_out/wirte_back/ configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/benchmark/multiply --cpu-type=TimingSimpleCPU --caches --l1d_assoc=4 --l1i_assoc=4 --l2cache --l2_assoc=4 --l3cache --l3_assoc=4 --l1i_size=32kB --l1d_size=32kB --l2_size=128kB --l3_size=512kB --mem-type=NVMainMemory --nvmain-config=../NVmain/Config/PCM_ISSCC_2012_4GB.config > ../q5_out/log
-
write through
- 在 write hit 後,生成 writeclean packet 送給 writebacks,writeclean 會一路往下 writeback 直到 memory
- gem5/src/mem/cache/base.cc 的 BaseCache::access 中加入以下程式碼
if (blk->isWritable()) { PacketPtr writeclean_pkt = writecleanBlk(blk, pkt->req->getDest(), pkt->id); writebacks.push_back(writeclean_pkt); }
- command:
./build/X86/gem5.opt -d ../q5_out/wirte_back/ configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/benchmark/multiply --cpu-type=TimingSimpleCPU --caches --l1d_assoc=4 --l1i_assoc=4 --l2cache --l2_assoc=4 --l3cache --l3_assoc=4 --l1i_size=32kB --l1d_size=32kB --l2_size=128kB --l3_size=512kB --mem-type=NVMainMemory --nvmain-config=../NVmain/Config/PCM_ISSCC_2012_4GB.config > ../q5_out/log