Use key "addressmapping" instead of "CONGEN" in addressmapping configs
This commit is contained in:
@@ -182,7 +182,7 @@ Used fields:
|
||||
|
||||
```json
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"XOR": [
|
||||
{
|
||||
"FIRST": 13,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
28,
|
||||
29,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
13,
|
||||
14,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
27,
|
||||
28,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
13,
|
||||
14,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
28,
|
||||
29,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
13,
|
||||
14,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
26,
|
||||
27,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
13,
|
||||
14,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANKGROUP_BIT":[
|
||||
28,
|
||||
29
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"PSEUDOCHANNEL_BIT":[
|
||||
29
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"PSEUDOCHANNEL_BIT":[
|
||||
28
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
28,
|
||||
29,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
11,
|
||||
12,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
5,
|
||||
6,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
27,
|
||||
28,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
11,
|
||||
12,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
5,
|
||||
6,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
27,
|
||||
28,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"RANK_BIT":[
|
||||
30,
|
||||
31
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
13,
|
||||
14,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
25,
|
||||
26,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
12,
|
||||
13,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
25,
|
||||
26
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
11,
|
||||
12
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
23,
|
||||
24
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
11,
|
||||
12
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
26,
|
||||
27
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
11,
|
||||
12
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
27,
|
||||
28
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
12,
|
||||
13
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
24,
|
||||
25
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
11,
|
||||
12
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANK_BIT": [
|
||||
4,
|
||||
5
|
||||
|
||||
@@ -54,25 +54,20 @@ NLOHMANN_JSONIFY_ALL_THINGS(XorPair, FIRST, SECOND)
|
||||
struct AddressMapping
|
||||
{
|
||||
static constexpr std::string_view KEY = "addressmapping";
|
||||
static constexpr std::string_view INNER_KEY = "CONGEN";
|
||||
static constexpr std::string_view PATH = "addressmapping";
|
||||
static constexpr std::string_view SUB_DIR = "addressmapping";
|
||||
|
||||
struct ConGen {
|
||||
std::optional<std::vector<unsigned int>> BYTE_BIT;
|
||||
std::optional<std::vector<unsigned int>> COLUMN_BIT;
|
||||
std::optional<std::vector<unsigned int>> ROW_BIT;
|
||||
std::optional<std::vector<unsigned int>> BANK_BIT;
|
||||
std::optional<std::vector<unsigned int>> BANKGROUP_BIT;
|
||||
std::optional<std::vector<unsigned int>> RANK_BIT;
|
||||
std::optional<std::vector<unsigned int>> PSEUDOCHANNEL_BIT;
|
||||
std::optional<std::vector<unsigned int>> CHANNEL_BIT;
|
||||
std::optional<std::vector<XorPair>> XOR;
|
||||
} CONGEN;
|
||||
std::optional<std::vector<unsigned int>> BYTE_BIT;
|
||||
std::optional<std::vector<unsigned int>> COLUMN_BIT;
|
||||
std::optional<std::vector<unsigned int>> ROW_BIT;
|
||||
std::optional<std::vector<unsigned int>> BANK_BIT;
|
||||
std::optional<std::vector<unsigned int>> BANKGROUP_BIT;
|
||||
std::optional<std::vector<unsigned int>> RANK_BIT;
|
||||
std::optional<std::vector<unsigned int>> PSEUDOCHANNEL_BIT;
|
||||
std::optional<std::vector<unsigned int>> CHANNEL_BIT;
|
||||
std::optional<std::vector<XorPair>> XOR;
|
||||
};
|
||||
|
||||
NLOHMANN_JSONIFY_ALL_THINGS(AddressMapping, CONGEN)
|
||||
|
||||
NLOHMANN_JSONIFY_ALL_THINGS(AddressMapping::ConGen,
|
||||
NLOHMANN_JSONIFY_ALL_THINGS(AddressMapping,
|
||||
BYTE_BIT,
|
||||
COLUMN_BIT,
|
||||
ROW_BIT,
|
||||
|
||||
@@ -57,6 +57,8 @@ Configuration from_path(std::string_view path, std::string_view resourceDirector
|
||||
Unkown
|
||||
} current_sub_config;
|
||||
|
||||
// This custom parser callback is responsible to swap out the paths to the sub-config json files
|
||||
// with the actual json data.
|
||||
std::function<bool(int depth, nlohmann::detail::parse_event_t event, json_t &parsed)>
|
||||
parser_callback;
|
||||
parser_callback =
|
||||
@@ -84,6 +86,8 @@ Configuration from_path(std::string_view path, std::string_view resourceDirector
|
||||
current_sub_config = SubConfig::Unkown;
|
||||
}
|
||||
|
||||
// In case we have an value (string) instead of an object, replace the value with the loaded
|
||||
// json object.
|
||||
if (event == parse_event_t::value && current_sub_config != SubConfig::Unkown) {
|
||||
// Replace name of json file with actual json data
|
||||
auto parse_json = [&parser_callback,
|
||||
@@ -105,23 +109,15 @@ Configuration from_path(std::string_view path, std::string_view resourceDirector
|
||||
};
|
||||
|
||||
if (current_sub_config == SubConfig::MemSpec)
|
||||
parsed = parse_json(MemSpec::PATH, MemSpec::KEY, parsed);
|
||||
parsed = parse_json(MemSpec::SUB_DIR, MemSpec::KEY, parsed);
|
||||
else if (current_sub_config == SubConfig::AddressMapping)
|
||||
{
|
||||
parsed = parse_json(AddressMapping::PATH, AddressMapping::INNER_KEY, parsed);
|
||||
|
||||
if (!parsed.contains(AddressMapping::INNER_KEY)) {
|
||||
auto temp = parsed;
|
||||
parsed = json_t();
|
||||
parsed[AddressMapping::INNER_KEY] = temp;
|
||||
}
|
||||
}
|
||||
parsed = parse_json(AddressMapping::SUB_DIR, AddressMapping::KEY, parsed);
|
||||
else if (current_sub_config == SubConfig::McConfig)
|
||||
parsed = parse_json(McConfig::PATH, McConfig::KEY, parsed);
|
||||
parsed = parse_json(McConfig::SUB_DIR, McConfig::KEY, parsed);
|
||||
else if (current_sub_config == SubConfig::SimConfig)
|
||||
parsed = parse_json(SimConfig::PATH, SimConfig::KEY, parsed);
|
||||
parsed = parse_json(SimConfig::SUB_DIR, SimConfig::KEY, parsed);
|
||||
else if (current_sub_config == SubConfig::TraceSetup)
|
||||
parsed = parse_json(TraceSetupConstants::PATH, TraceSetupConstants::KEY, parsed);
|
||||
parsed = parse_json(TraceSetupConstants::SUB_DIR, TraceSetupConstants::KEY, parsed);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -150,7 +150,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM(ArbiterType, {{ArbiterType::Invalid, nullptr},
|
||||
struct McConfig
|
||||
{
|
||||
static constexpr std::string_view KEY = "mcconfig";
|
||||
static constexpr std::string_view PATH = "mcconfig";
|
||||
static constexpr std::string_view SUB_DIR = "mcconfig";
|
||||
|
||||
std::optional<PagePolicyType> PagePolicy;
|
||||
std::optional<SchedulerType> Scheduler;
|
||||
|
||||
@@ -59,7 +59,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM(StoreModeType, {{StoreModeType::Invalid, nullptr},
|
||||
struct SimConfig
|
||||
{
|
||||
static constexpr std::string_view KEY = "simconfig";
|
||||
static constexpr std::string_view PATH = "simconfig";
|
||||
static constexpr std::string_view SUB_DIR = "simconfig";
|
||||
|
||||
std::optional<uint64_t> AddressOffset;
|
||||
std::optional<bool> CheckTLM2Protocol;
|
||||
|
||||
@@ -194,7 +194,7 @@ NLOHMANN_JSONIFY_ALL_THINGS(
|
||||
struct TraceSetupConstants
|
||||
{
|
||||
static constexpr std::string_view KEY = "tracesetup";
|
||||
static constexpr std::string_view PATH = "tracesetup";
|
||||
static constexpr std::string_view SUB_DIR = "tracesetup";
|
||||
};
|
||||
|
||||
using TraceSetup = std::vector<
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace DRAMSys::Config {
|
||||
struct MemSpec
|
||||
{
|
||||
static constexpr std::string_view KEY = "memspec";
|
||||
static constexpr std::string_view PATH = "memspec";
|
||||
static constexpr std::string_view SUB_DIR = "memspec";
|
||||
|
||||
MemArchitectureSpecType memarchitecturespec;
|
||||
std::string memoryId;
|
||||
|
||||
@@ -46,27 +46,27 @@
|
||||
|
||||
AddressDecoder::AddressDecoder(const DRAMSys::Config::AddressMapping &addressMapping, const MemSpec &memSpec)
|
||||
{
|
||||
if (const auto &channelBits = addressMapping.CONGEN.CHANNEL_BIT)
|
||||
if (const auto &channelBits = addressMapping.CHANNEL_BIT)
|
||||
{
|
||||
std::copy(channelBits->begin(), channelBits->end(), std::back_inserter(vChannelBits));
|
||||
}
|
||||
|
||||
if (const auto &rankBits = addressMapping.CONGEN.RANK_BIT)
|
||||
if (const auto &rankBits = addressMapping.RANK_BIT)
|
||||
{
|
||||
std::copy(rankBits->begin(), rankBits->end(), std::back_inserter(vRankBits));
|
||||
}
|
||||
|
||||
if (const auto& bankGroupBits = addressMapping.CONGEN.BANKGROUP_BIT)
|
||||
if (const auto& bankGroupBits = addressMapping.BANKGROUP_BIT)
|
||||
{
|
||||
std::copy(bankGroupBits->begin(), bankGroupBits->end(), std::back_inserter(vBankGroupBits));
|
||||
}
|
||||
|
||||
if (const auto &byteBits = addressMapping.CONGEN.BYTE_BIT)
|
||||
if (const auto &byteBits = addressMapping.BYTE_BIT)
|
||||
{
|
||||
std::copy(byteBits->begin(), byteBits->end(), std::back_inserter(vByteBits));
|
||||
}
|
||||
|
||||
if (const auto &xorBits = addressMapping.CONGEN.XOR)
|
||||
if (const auto &xorBits = addressMapping.XOR)
|
||||
{
|
||||
for (const auto& xorBit : *xorBits)
|
||||
{
|
||||
@@ -74,17 +74,17 @@ AddressDecoder::AddressDecoder(const DRAMSys::Config::AddressMapping &addressMap
|
||||
}
|
||||
}
|
||||
|
||||
if (const auto &bankBits = addressMapping.CONGEN.BANK_BIT)
|
||||
if (const auto &bankBits = addressMapping.BANK_BIT)
|
||||
{
|
||||
std::copy(bankBits->begin(), bankBits->end(), std::back_inserter(vBankBits));
|
||||
}
|
||||
|
||||
if (const auto &rowBits = addressMapping.CONGEN.ROW_BIT)
|
||||
if (const auto &rowBits = addressMapping.ROW_BIT)
|
||||
{
|
||||
std::copy(rowBits->begin(), rowBits->end(), std::back_inserter(vRowBits));
|
||||
}
|
||||
|
||||
if (const auto &columnBits = addressMapping.CONGEN.COLUMN_BIT)
|
||||
if (const auto &columnBits = addressMapping.COLUMN_BIT)
|
||||
{
|
||||
std::copy(columnBits->begin(), columnBits->end(), std::back_inserter(vColumnBits));
|
||||
}
|
||||
|
||||
@@ -1,54 +1,52 @@
|
||||
{
|
||||
"simulation": {
|
||||
"addressmapping": {
|
||||
"CONGEN": {
|
||||
"BANKGROUP_BIT": [
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
32
|
||||
],
|
||||
"BANK_BIT": [
|
||||
13,
|
||||
14,
|
||||
15
|
||||
],
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1
|
||||
],
|
||||
"COLUMN_BIT": [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12
|
||||
],
|
||||
"RANK_BIT": [
|
||||
33
|
||||
],
|
||||
"ROW_BIT": [
|
||||
16
|
||||
]
|
||||
}
|
||||
"BANKGROUP_BIT": [
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
32
|
||||
],
|
||||
"BANK_BIT": [
|
||||
13,
|
||||
14,
|
||||
15
|
||||
],
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1
|
||||
],
|
||||
"COLUMN_BIT": [
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12
|
||||
],
|
||||
"RANK_BIT": [
|
||||
33
|
||||
],
|
||||
"ROW_BIT": [
|
||||
16
|
||||
]
|
||||
},
|
||||
"mcconfig": {
|
||||
"Arbiter": "Simple",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1
|
||||
|
||||
@@ -63,15 +63,15 @@ protected:
|
||||
static DRAMSys::Config::RowHammer createTraceHammer();
|
||||
|
||||
DRAMSys::Config::AddressMapping addressMapping{
|
||||
{{{0, 1}},
|
||||
{{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}},
|
||||
{{16}},
|
||||
{{13, 14, 15}},
|
||||
{{17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}},
|
||||
{{33}},
|
||||
std::nullopt,
|
||||
std::nullopt,
|
||||
std::nullopt}};
|
||||
{{0, 1}},
|
||||
{{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}},
|
||||
{{16}},
|
||||
{{13, 14, 15}},
|
||||
{{17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}},
|
||||
{{33}},
|
||||
std::nullopt,
|
||||
std::nullopt,
|
||||
std::nullopt};
|
||||
|
||||
DRAMSys::Config::McConfig mcConfig{PagePolicyType::Open,
|
||||
SchedulerType::FrFcfs,
|
||||
@@ -439,7 +439,7 @@ TEST_F(ConfigurationTest, AddressMapping)
|
||||
{
|
||||
std::string_view addressmapping_string = R"(
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BANKGROUP_BIT": [
|
||||
17,
|
||||
18,
|
||||
@@ -491,7 +491,8 @@ TEST_F(ConfigurationTest, AddressMapping)
|
||||
)";
|
||||
|
||||
json_t addressmapping_reference = json_t::parse(addressmapping_string);
|
||||
json_t addressmapping_test = addressMapping;
|
||||
json_t addressmapping_test;
|
||||
addressmapping_test[AddressMapping::KEY] = addressMapping;
|
||||
|
||||
EXPECT_EQ(addressmapping_test, addressmapping_reference);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ inline constexpr std::string_view memSpecJsonString = R"(
|
||||
|
||||
inline constexpr std::string_view addressMappingJsonString = R"(
|
||||
{
|
||||
"CONGEN": {
|
||||
"addressmapping": {
|
||||
"BYTE_BIT": [
|
||||
0
|
||||
],
|
||||
|
||||
@@ -44,7 +44,7 @@ class AddressDecoderFixture : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
AddressDecoderFixture() :
|
||||
addressMappingJson(nlohmann::json::parse(addressMappingJsonString)),
|
||||
addressMappingJson(nlohmann::json::parse(addressMappingJsonString).at("addressmapping")),
|
||||
memSpecJson(nlohmann::json::parse(memSpecJsonString).at("memspec")),
|
||||
addressMappingConfig(addressMappingJson.get<DRAMSys::Config::AddressMapping>()),
|
||||
memSpec(memSpecConfig),
|
||||
|
||||
@@ -1,50 +1,48 @@
|
||||
{
|
||||
"simulation": {
|
||||
"addressmapping": {
|
||||
"CONGEN": {
|
||||
"BANKGROUP_BIT": [
|
||||
28,
|
||||
29
|
||||
],
|
||||
"BANK_BIT": [
|
||||
30,
|
||||
31
|
||||
],
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1,
|
||||
2
|
||||
],
|
||||
"COLUMN_BIT": [
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12
|
||||
],
|
||||
"ROW_BIT": [
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27
|
||||
]
|
||||
}
|
||||
"BANKGROUP_BIT": [
|
||||
28,
|
||||
29
|
||||
],
|
||||
"BANK_BIT": [
|
||||
30,
|
||||
31
|
||||
],
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1,
|
||||
2
|
||||
],
|
||||
"COLUMN_BIT": [
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12
|
||||
],
|
||||
"ROW_BIT": [
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27
|
||||
]
|
||||
},
|
||||
"mcconfig": {
|
||||
"Arbiter": "Simple",
|
||||
|
||||
@@ -1,50 +1,48 @@
|
||||
{
|
||||
"simulation": {
|
||||
"addressmapping": {
|
||||
"CONGEN": {
|
||||
"BANKGROUP_BIT": [
|
||||
28,
|
||||
29
|
||||
],
|
||||
"BANK_BIT": [
|
||||
30,
|
||||
31
|
||||
],
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1,
|
||||
2
|
||||
],
|
||||
"COLUMN_BIT": [
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12
|
||||
],
|
||||
"ROW_BIT": [
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27
|
||||
]
|
||||
}
|
||||
"BANKGROUP_BIT": [
|
||||
28,
|
||||
29
|
||||
],
|
||||
"BANK_BIT": [
|
||||
30,
|
||||
31
|
||||
],
|
||||
"BYTE_BIT": [
|
||||
0,
|
||||
1,
|
||||
2
|
||||
],
|
||||
"COLUMN_BIT": [
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12
|
||||
],
|
||||
"ROW_BIT": [
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27
|
||||
]
|
||||
},
|
||||
"mcconfig": {
|
||||
"Arbiter": "Simple",
|
||||
|
||||
Reference in New Issue
Block a user