This document describes the configuration file format and parsing behavior for Cache Simulator v1.4.1+.
The configuration parser supports both snake_case and camelCase key names for backward compatibility.
// snake_case (v1.2.x style)
{
"block_size": 64,
"write_policy": "WriteBack",
"replacement_policy": "LRU"
}
// camelCase (preferred)
{
"blockSize": 64,
"writePolicy": "WriteBack",
"replacementPolicy": "LRU"
}Both formats are automatically normalized to camelCase during parsing.
The parser converts snake_case keys to camelCase using the normalizeConfigKey() function:
| Input Key | Normalized Key |
|---|---|
block_size |
blockSize |
write_policy |
writePolicy |
replacement_policy |
replacementPolicy |
associativity |
associativity |
The parser validates keys against a known set:
size,associativity,blockSize,replacementPolicy,writePolicy
enabled,distance,degree,adaptive,forLevel
entries
startAddress,endAddress,name
Unrecognized keys generate warnings with suggestions:
[Config Warning] Unrecognized key 'blok_size' in section 'l1'. Did you mean 'blockSize'?
All example config files should specify version "1.4.0" or later:
{
"name": "My Configuration",
"version": "1.4.0",
"l1": { ... }
}User-defined memory regions for profiling:
{
"profilerRegions": [
{
"startAddress": "0x1000",
"endAddress": "0x2000",
"name": "Stack"
},
{
"startAddress": "0x10000",
"endAddress": "0x20000",
"name": "Heap"
}
]
}Config parsing is validated by integration tests:
tests/integration/config_parsing_test.cpp- Tests all 8 example JSON configs
- Verifies snake_case normalization