0% found this document useful (0 votes)
109 views3 pages

Gem5 Practice

This document describes an assignment to simulate a multicore architecture using the gem5 simulator. It provides the configuration details for 4 questions that vary cache parameters like size, associativity, block size, and benchmarks. For each question, the correct answer is given along with the detailed gem5 simulation command and output.

Uploaded by

Rama Devi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views3 pages

Gem5 Practice

This document describes an assignment to simulate a multicore architecture using the gem5 simulator. It provides the configuration details for 4 questions that vary cache parameters like size, associativity, block size, and benchmarks. For each question, the correct answer is given along with the detailed gem5 simulation command and output.

Uploaded by

Rama Devi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

NPTEL Online Certification Course

Multicore Architecture: Storage and Interconnects


gem5 practice assignment
Indian Institute of Technology Guwahati

* Build ALPHA ISA with gem5.opt binary by invoking RUBY module and
MESI Two Level coherence
protocol.
* Simulate in syscall emulation mode using se.py

Base Configuration:
Number of cores/CPUs : 1
L1-I cache (size / associativity) : 16 kB / 2-way
L1-D cache (size / associativity) : 16 kB / 2-way
L2 cache (size / associativity) : 256 kB / 4-way
Cache-line / Cache-block size : 32 B
Main memory size : 1 GB
Benchmark : bzip2
Instruction count : 100000

1. In base configuration, change the Cache-line/Cache-block size to 64B. What will


be the L1-I
cache MPKI?
a) 2.95 - 3.15 b) 1.95 - 2.15 c) 4.80 - 5.00 d) 2.75 - 2.90
Correct answer: (a)
Detailed solution:
./build/ALPHA/gem5.opt configs/example/se.py --ruby --num-cpus=1 --
l1i_size=16kB --
l1d_size=16kB --l1i_assoc=2 --l1d_assoc=2 --l2_size=256kB --l2_assoc=4 --
cacheline_size=64
--mem-size=1GB --bench=bzip2 –maxinsts=100000
system.ruby.l1_cntrl0.L1Icache.demand_misses 306
L1-I mpki(miss per kilo instructions)= (306/100000)*1000 = 3.06 (3.06 is exact
answer)

2. In base configuration, change the L2 cache size to 512kB and benchmark to namd.
What will be
the L2 cache MPKI?
a) 20.5 - 22.5 b) 14.5 - 16 c) 284 - 287 d) 12.5 -13.5
Correct answer: (b)
Detailed solution:
./build/ALPHA/gem5.opt configs/example/se.py --ruby --num-cpus=1 --
l1i_size=16kB --
l1d_size=16kB --l1i_assoc=2 --l1d_assoc=2 --l2_size=512kB --l2_assoc=4 --
cacheline_size=32 --
mem-size=1GB --bench=namd –maxinsts=100000
system.ruby.l2_cntrl0.L2cache.demand_misses 1487
L2-mpki= (1487/100000)*1000= 14.87 (14.87 is exact answer)

3. In base configuration, change number of cpus to 2, L2 cache to 1MB/ 8-way,


cache line to 128B,
benchmark to namd-leslie3d and maximum instructions to 200000.
Find the value of:
(No. of L1-I cache misses in core-1) / (No. of L1-I cache misses in core-2)
a) 1.15 – 1.25 b) 1.25 -1.35 c) 1.35 – 1.45 d) 1.45-1.55
Correct answer: (a)
Detailed solution:
./build/ALPHA/gem5.opt configs/example/se.py --ruby --num-cpus=2 --
l1i_size=16kB --
l1d_size=16kB --l1i_assoc=2 --l1d_assoc=2 --l2_size=1MB --l2_assoc=8 --
cacheline_size=128 --
mem-size=1GB --bench=namd-leslie3d –maxinsts=200000
system.ruby.l1_cntrl0.L1Icache.demand_misses 2535
system.ruby.l1_cntrl1.L1Icache.demand_misses 2092
So, 2535/2092= 1.21 (1.21 is exact answer)

4. In base configuration, change number of cpus to 4, L2 cache to 1MB/ 8-way,


cache line to 64B,
benchmark to namd-leslie3d-bzip2-lbm and maximum instructions to 200000. Find
the value of:
(No. of L1-I cache misses in core-1 + No. of L1-I cache misses in core-2)/ (No. of
L1-I cache
misses in core-3 + No. of L1-I cache misses in core-4)
a) 8.95 – 9.15 b) 7.25 -7.45 c) 8.35 – 8.55 d) 6.95-7.15
Correct answer: (d)
Detailed solution:
./build/ALPHA/gem5.opt configs/example/se.py --ruby --num-cpus=4 --
l1i_size=16kB --
l1d_size=16kB --l1i_assoc=2 --l1d_assoc=2 --l2_size=1MB --l2_assoc=8 --
cacheline_size=64 --
mem-size=1GB --bench=namd-leslie3d-bzip2-lbm --maxinsts=200000
system.ruby.l1_cntrl0.L1Icache.demand_misses 2948
system.ruby.l1_cntrl1.L1Icache.demand_misses 2502
system.ruby.l1_cntrl2.L1Icache.demand_misses 306
system.ruby.l1_cntrl3.L1Icache.demand_misses 466
So, (2948+2502) / (306+466) = 7.059 (7.059 is exact answer)

You might also like