Thursday, January 6, 2011

Cache Configuration for Multicore Multithread system in Multi2Sim

Multi2Sim is a simulation framework for superscalar, multithreaded, and multicore processors. It is an application-only tool, which allows one or more applications to be run on top of it without booting an operating system first. This little tip is not about multi2sim and its functionalities which can be found at http://www.multi2sim.org/wiki/index.php5/Main_Page . This post talks about writing cache configuration files for multicore multithreaded benchmarks that are to be simulated.

As a precursor to my post, to all those who were in search of cache configuration files for multi2sim and those who could not get the head and tail of the config file in the documentation here's a configuration I used to simulate my project:

[ CacheGeometry il1geo ]                        [ CacheGeometry dl1geo ]
Sets = 128                                        Sets = 128
Assoc = 4                                         Assoc = 4
BlockSize = 32                                    BlockSize = 32
Latency = 2                                       Latency = 2
Policy = LRU                                      Policy = LRU

[ CacheGeometry l2geo ]
Sets = 256
Assoc = 8
BlockSize = 64
Latency = 20

[ Net net-0 ]                                   [ Net net-1 ]
Topology = Bus                                    Topology = Bus
LinkWidth = 32                                    LinkWidth = 32

[ Cache dl1 ]                                   [ Cache il1 ]
Geometry = dl1geo                                 Geometry = il1geo
LoNet = net-0                                     LoNet = net-0

[ Cache l2 ]                                    [ MainMemory ]
Geometry = l2geo                                  HiNet = net-1
HiNet = net-0                                     BlockSize = 64
LoNet = net-1                                     Latency = 200

[ Node 0 ]
Core = 0
Thread = 0
ICache = il1
DCache = dl1

For the multithreaded applications on multicore machines or even singlecore machine the documentation is not very clear. So after spending some time with debugging 1 final lightbulb moment struck me when I deciphered the error it was showing me and thus this cache config file is more of an experimental touch rather than a technical masterstroke. Below is a slight modification of the above config for a multithreaded context file which is easy to write following the documentation. Cache config file for multicore multithreaded application basically involves Nodes = Cores x Threads, where Cores is the set of Cores and Threads are the set of Threads and 'x' represents cartesian product of the sets.


[ CacheGeometry il1geo ]                        [ CacheGeometry dl1-0geo ]
Sets = 128                                        Sets = 128
Assoc = 4                                         Assoc = 4
BlockSize = 32                                    BlockSize = 32
Latency = 2                                       Latency = 2
Policy = LRU                                      Policy = LRU

[ CacheGeometry dl1-1geo ]                      [ CacheGeometry l2geo ]
Sets = 128                                        Sets = 256
Assoc = 4                                         Assoc = 8
BlockSize = 32                                    BlockSize = 64
Latency = 2                                       Latency = 20
Policy = LRU                                                     

[ Net net-0 ]                                   [ Net net-1 ]
Topology = Bus                                    Topology = Bus
LinkWidth = 32                                    LinkWidth = 32

[ Cache dl1-0 ]                                 [ Cache il1-0 ]
Geometry = dl1-0geo                               Geometry = il1geo
LoNet = net-0                                     LoNet = net-0

[ Cache dl1-1 ]                                 [ Cache il1-1 ]
Geometry = dl1-0geo                               Geometry = il1geo
LoNet = net-0                                     LoNet = net-0

[ Cache l2 ]                                    [ MainMemory ]
Geometry = l2geo                                  HiNet = net-1
HiNet = net-0                                     BlockSize = 64
LoNet = net-1                                     Latency = 200

[ Node 0/0 ]                                    [ Node 0/1 ]
Core = 0                                          Core = 0
Thread = 0                                        Thread = 1
ICache = il1-0                                    ICache = il1-1
DCache = dl1-0                                    DCache = dl1-1

[ Node 1/0 ]                                    [ Node 1/1 ]
Core = 1                                          Core = 1
Thread = 0                                        Thread = 1
ICache = il1-0                                    ICache = il1-1
DCache = dl1-0                                    DCache = dl1-1

I could never conclude this topic without reiterating how good Multi2Sim was for my project and how bad its code documentation is. Yet, of all the simulator that are currently being used for simulation, some very expensive and far from open-source to some which just dont compile, Multi2Sim has been the best to improve the functionalities and testing them very efficiently a Linux machine. The benchmarks are a bit rigid but the flexibility and ease makes Multi2Sim a very effective tool.

No comments:

Post a Comment