This is some understanding I would like to document while reading the source code of ZSim. ZSim is a very good simulator for the architecture study, employing clever techniques like binary instrumentation to be more accurate and faster than the alternatives such as gem5. However, it has limited documentation. Reading and understanding the source code to be able to modify and extend the ZSim simulator requires some hard work.
init.cpp
This is where the simulation system gets built according to configuration file. I find that going from this file helps a lot in understanding the ZSim tool.
Here are some definitions to bear in mind while reading the init.cpp. It would be helpful if you have a sticky notes tool than can always stay on top.
- unordered_map<string, vector<vector
>> childMap; - unordered_map<string, CacheGroup*> cMap;
- typedef vector<vector<BaseCache*ยป CacheGroup;
CacheGroup has two-level, one for config..caches another for config..banks childMap has two-level vector because first level capture the concatenation between caches and the second level captures the interleave information between the caches.
Stay tuned for the udpates.