From a49afa40eb149b93db6bc6891522fb05d6d2f397 Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Fri, 17 Mar 2023 14:01:17 +0100 Subject: [PATCH] Use key "addressmapping" instead of "CONGEN" in addressmapping configs --- configs/README.md | 2 +- .../am_ddr3_4x4Gbx16_dimm_p2KB_brc.json | 2 +- .../am_ddr3_4x4Gbx16_dimm_p2KB_rbc.json | 2 +- .../am_ddr3_8x1Gbx8_dimm_p1KB_brc.json | 2 +- .../am_ddr3_8x1Gbx8_dimm_p1KB_rbc.json | 2 +- .../am_ddr3_8x2Gbx8_dimm_p1KB_brc.json | 2 +- .../am_ddr3_8x2Gbx8_dimm_p1KB_rbc.json | 2 +- configs/addressmapping/am_ddr3_x16_brc.json | 2 +- configs/addressmapping/am_ddr3_x16_rbc.json | 2 +- .../am_ddr4_8x4Gbx8_dimm_p1KB_brc.json | 2 +- .../am_ddr5_2x2x8x4Gbx4_dimm_p1KB_rbc.json | 2 +- .../am_ddr5_2x4x1Gbx8_dimm_p1KB_rbc.json | 2 +- .../am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json | 2 +- .../am_ddr5_2x8x8x2Gbx4_dimm_p1KB_rbc.json | 2 +- .../addressmapping/am_hbm2_8Gb_pc_brc.json | 2 +- .../addressmapping/am_hbm3_8Gb_pc_brc.json | 2 +- .../am_lpddr4_1Gbx16_baroco.json | 2 +- .../am_lpddr4_1Gbx16_robaco.json | 2 +- .../am_lpddr4_1Gbx16_rocoba.json | 2 +- .../am_lpddr4_512Mbx16_baroco.json | 2 +- .../am_lpddr4_512Mbx16_robaco.json | 2 +- .../am_lpddr4_512Mbx16_rocoba.json | 2 +- .../addressmapping/am_lpddr4_8Gbx16_brc.json | 2 +- .../am_lpddr5_1Gbx16_16B_robaco.json | 2 +- .../am_lpddr5_1Gbx16_16B_rocoba.json | 2 +- .../am_lpddr5_1Gbx16_8B_robaco.json | 2 +- .../am_lpddr5_1Gbx16_8B_rocoba.json | 2 +- .../am_lpddr5_1Gbx16_BG_robacobg.json | 2 +- .../am_lpddr5_1Gbx16_BG_rocobabg.json | 2 +- .../am_lpddr5_512Mbx16_16B_robaco.json | 2 +- .../am_lpddr5_512Mbx16_16B_rocoba.json | 2 +- .../am_lpddr5_512Mbx16_8B_robaco.json | 2 +- .../am_lpddr5_512Mbx16_8B_rocoba.json | 2 +- .../am_lpddr5_512Mbx16_BG_robacobg.json | 2 +- .../am_lpddr5_512Mbx16_BG_rocobabg.json | 2 +- configs/addressmapping/am_ranktest.json | 2 +- .../am_stt-mram_8x2Gbx8_dimm_p1KB_rbc.json | 2 +- .../am_wideio2_4x64_4x2Gb_brc.json | 2 +- .../am_wideio2_4x64_4x2Gb_rbc.json | 2 +- .../addressmapping/am_wideio_4x1Gb_brc.json | 2 +- .../addressmapping/am_wideio_4x1Gb_rbc.json | 2 +- .../addressmapping/am_wideio_4x256Mb_brc.json | 2 +- .../addressmapping/am_wideio_4x256Mb_rbc.json | 2 +- .../addressmapping/am_wideio_4x2Gb_brc.json | 2 +- .../addressmapping/am_wideio_4x2Gb_rbc.json | 2 +- .../addressmapping/am_wideio_4x4Gb_brc.json | 2 +- .../addressmapping/am_wideio_4x4Gb_rbc.json | 2 +- .../addressmapping/am_wideio_4x512Mb_brc.json | 2 +- .../addressmapping/am_wideio_4x512Mb_rbc.json | 2 +- configs/addressmapping/am_wideio_thermal.json | 2 +- .../DRAMSys/config/AddressMapping.h | 27 +++--- .../DRAMSys/config/DRAMSysConfiguration.cpp | 22 ++--- src/configuration/DRAMSys/config/McConfig.h | 2 +- src/configuration/DRAMSys/config/SimConfig.h | 2 +- src/configuration/DRAMSys/config/TraceSetup.h | 2 +- .../DRAMSys/config/memspec/MemSpec.h | 2 +- .../DRAMSys/simulation/AddressDecoder.cpp | 16 ++-- tests/tests_configuration/reference.json | 94 +++++++++---------- .../am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json | 2 +- .../test_configuration.cpp | 23 ++--- tests/tests_dramsys/AddressDecoderConfigs.h | 2 +- tests/tests_dramsys/AddressDecoderTests.cpp | 2 +- .../b_transport/configs/no_storage.json | 86 +++++++++-------- .../b_transport/configs/storage.json | 86 +++++++++-------- 64 files changed, 227 insertions(+), 241 deletions(-) diff --git a/configs/README.md b/configs/README.md index 6ed1fbef..279560e9 100644 --- a/configs/README.md +++ b/configs/README.md @@ -182,7 +182,7 @@ Used fields: ```json { - "CONGEN": { + "addressmapping": { "XOR": [ { "FIRST": 13, diff --git a/configs/addressmapping/am_ddr3_4x4Gbx16_dimm_p2KB_brc.json b/configs/addressmapping/am_ddr3_4x4Gbx16_dimm_p2KB_brc.json index 3999c105..5438a40d 100644 --- a/configs/addressmapping/am_ddr3_4x4Gbx16_dimm_p2KB_brc.json +++ b/configs/addressmapping/am_ddr3_4x4Gbx16_dimm_p2KB_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 28, 29, diff --git a/configs/addressmapping/am_ddr3_4x4Gbx16_dimm_p2KB_rbc.json b/configs/addressmapping/am_ddr3_4x4Gbx16_dimm_p2KB_rbc.json index d1bcfe70..91c90fa6 100644 --- a/configs/addressmapping/am_ddr3_4x4Gbx16_dimm_p2KB_rbc.json +++ b/configs/addressmapping/am_ddr3_4x4Gbx16_dimm_p2KB_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 13, 14, diff --git a/configs/addressmapping/am_ddr3_8x1Gbx8_dimm_p1KB_brc.json b/configs/addressmapping/am_ddr3_8x1Gbx8_dimm_p1KB_brc.json index 13ee107d..fca7cfed 100644 --- a/configs/addressmapping/am_ddr3_8x1Gbx8_dimm_p1KB_brc.json +++ b/configs/addressmapping/am_ddr3_8x1Gbx8_dimm_p1KB_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 27, 28, diff --git a/configs/addressmapping/am_ddr3_8x1Gbx8_dimm_p1KB_rbc.json b/configs/addressmapping/am_ddr3_8x1Gbx8_dimm_p1KB_rbc.json index 81ac8ef6..3a4a8044 100644 --- a/configs/addressmapping/am_ddr3_8x1Gbx8_dimm_p1KB_rbc.json +++ b/configs/addressmapping/am_ddr3_8x1Gbx8_dimm_p1KB_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 13, 14, diff --git a/configs/addressmapping/am_ddr3_8x2Gbx8_dimm_p1KB_brc.json b/configs/addressmapping/am_ddr3_8x2Gbx8_dimm_p1KB_brc.json index 3999c105..5438a40d 100644 --- a/configs/addressmapping/am_ddr3_8x2Gbx8_dimm_p1KB_brc.json +++ b/configs/addressmapping/am_ddr3_8x2Gbx8_dimm_p1KB_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 28, 29, diff --git a/configs/addressmapping/am_ddr3_8x2Gbx8_dimm_p1KB_rbc.json b/configs/addressmapping/am_ddr3_8x2Gbx8_dimm_p1KB_rbc.json index d1bcfe70..91c90fa6 100644 --- a/configs/addressmapping/am_ddr3_8x2Gbx8_dimm_p1KB_rbc.json +++ b/configs/addressmapping/am_ddr3_8x2Gbx8_dimm_p1KB_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 13, 14, diff --git a/configs/addressmapping/am_ddr3_x16_brc.json b/configs/addressmapping/am_ddr3_x16_brc.json index dbd6a2d2..73d2c68e 100644 --- a/configs/addressmapping/am_ddr3_x16_brc.json +++ b/configs/addressmapping/am_ddr3_x16_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 26, 27, diff --git a/configs/addressmapping/am_ddr3_x16_rbc.json b/configs/addressmapping/am_ddr3_x16_rbc.json index e7cbcd22..3d841bde 100644 --- a/configs/addressmapping/am_ddr3_x16_rbc.json +++ b/configs/addressmapping/am_ddr3_x16_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 13, 14, diff --git a/configs/addressmapping/am_ddr4_8x4Gbx8_dimm_p1KB_brc.json b/configs/addressmapping/am_ddr4_8x4Gbx8_dimm_p1KB_brc.json index 7b9f8340..689baddf 100644 --- a/configs/addressmapping/am_ddr4_8x4Gbx8_dimm_p1KB_brc.json +++ b/configs/addressmapping/am_ddr4_8x4Gbx8_dimm_p1KB_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANKGROUP_BIT":[ 28, 29 diff --git a/configs/addressmapping/am_ddr5_2x2x8x4Gbx4_dimm_p1KB_rbc.json b/configs/addressmapping/am_ddr5_2x2x8x4Gbx4_dimm_p1KB_rbc.json index 5e42017b..0652961c 100644 --- a/configs/addressmapping/am_ddr5_2x2x8x4Gbx4_dimm_p1KB_rbc.json +++ b/configs/addressmapping/am_ddr5_2x2x8x4Gbx4_dimm_p1KB_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0, 1 diff --git a/configs/addressmapping/am_ddr5_2x4x1Gbx8_dimm_p1KB_rbc.json b/configs/addressmapping/am_ddr5_2x4x1Gbx8_dimm_p1KB_rbc.json index 7e02f877..3f6970d8 100644 --- a/configs/addressmapping/am_ddr5_2x4x1Gbx8_dimm_p1KB_rbc.json +++ b/configs/addressmapping/am_ddr5_2x4x1Gbx8_dimm_p1KB_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0, 1 diff --git a/configs/addressmapping/am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json b/configs/addressmapping/am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json index bce5038e..143f714a 100644 --- a/configs/addressmapping/am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json +++ b/configs/addressmapping/am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0, 1 diff --git a/configs/addressmapping/am_ddr5_2x8x8x2Gbx4_dimm_p1KB_rbc.json b/configs/addressmapping/am_ddr5_2x8x8x2Gbx4_dimm_p1KB_rbc.json index 48f1301d..e45fd809 100644 --- a/configs/addressmapping/am_ddr5_2x8x8x2Gbx4_dimm_p1KB_rbc.json +++ b/configs/addressmapping/am_ddr5_2x8x8x2Gbx4_dimm_p1KB_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0, 1 diff --git a/configs/addressmapping/am_hbm2_8Gb_pc_brc.json b/configs/addressmapping/am_hbm2_8Gb_pc_brc.json index 687e35d7..87879fdc 100644 --- a/configs/addressmapping/am_hbm2_8Gb_pc_brc.json +++ b/configs/addressmapping/am_hbm2_8Gb_pc_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "PSEUDOCHANNEL_BIT":[ 29 ], diff --git a/configs/addressmapping/am_hbm3_8Gb_pc_brc.json b/configs/addressmapping/am_hbm3_8Gb_pc_brc.json index 7b7c076f..31812705 100644 --- a/configs/addressmapping/am_hbm3_8Gb_pc_brc.json +++ b/configs/addressmapping/am_hbm3_8Gb_pc_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "PSEUDOCHANNEL_BIT":[ 28 ], diff --git a/configs/addressmapping/am_lpddr4_1Gbx16_baroco.json b/configs/addressmapping/am_lpddr4_1Gbx16_baroco.json index bf827c06..03dc8bd7 100644 --- a/configs/addressmapping/am_lpddr4_1Gbx16_baroco.json +++ b/configs/addressmapping/am_lpddr4_1Gbx16_baroco.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 28, 29, diff --git a/configs/addressmapping/am_lpddr4_1Gbx16_robaco.json b/configs/addressmapping/am_lpddr4_1Gbx16_robaco.json index 9e86d16e..69a9c9b5 100644 --- a/configs/addressmapping/am_lpddr4_1Gbx16_robaco.json +++ b/configs/addressmapping/am_lpddr4_1Gbx16_robaco.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 11, 12, diff --git a/configs/addressmapping/am_lpddr4_1Gbx16_rocoba.json b/configs/addressmapping/am_lpddr4_1Gbx16_rocoba.json index f4091b45..eafa99fe 100644 --- a/configs/addressmapping/am_lpddr4_1Gbx16_rocoba.json +++ b/configs/addressmapping/am_lpddr4_1Gbx16_rocoba.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 5, 6, diff --git a/configs/addressmapping/am_lpddr4_512Mbx16_baroco.json b/configs/addressmapping/am_lpddr4_512Mbx16_baroco.json index e9b3ac9f..8e9948b2 100644 --- a/configs/addressmapping/am_lpddr4_512Mbx16_baroco.json +++ b/configs/addressmapping/am_lpddr4_512Mbx16_baroco.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 27, 28, diff --git a/configs/addressmapping/am_lpddr4_512Mbx16_robaco.json b/configs/addressmapping/am_lpddr4_512Mbx16_robaco.json index f4c2c3dd..baa9dcd2 100644 --- a/configs/addressmapping/am_lpddr4_512Mbx16_robaco.json +++ b/configs/addressmapping/am_lpddr4_512Mbx16_robaco.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 11, 12, diff --git a/configs/addressmapping/am_lpddr4_512Mbx16_rocoba.json b/configs/addressmapping/am_lpddr4_512Mbx16_rocoba.json index a8142937..455ae3a3 100644 --- a/configs/addressmapping/am_lpddr4_512Mbx16_rocoba.json +++ b/configs/addressmapping/am_lpddr4_512Mbx16_rocoba.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 5, 6, diff --git a/configs/addressmapping/am_lpddr4_8Gbx16_brc.json b/configs/addressmapping/am_lpddr4_8Gbx16_brc.json index e9b3ac9f..8e9948b2 100644 --- a/configs/addressmapping/am_lpddr4_8Gbx16_brc.json +++ b/configs/addressmapping/am_lpddr4_8Gbx16_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 27, 28, diff --git a/configs/addressmapping/am_lpddr5_1Gbx16_16B_robaco.json b/configs/addressmapping/am_lpddr5_1Gbx16_16B_robaco.json index a48e5b4f..2c2b96b8 100644 --- a/configs/addressmapping/am_lpddr5_1Gbx16_16B_robaco.json +++ b/configs/addressmapping/am_lpddr5_1Gbx16_16B_robaco.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_1Gbx16_16B_rocoba.json b/configs/addressmapping/am_lpddr5_1Gbx16_16B_rocoba.json index 52fde69a..8d78bf4a 100644 --- a/configs/addressmapping/am_lpddr5_1Gbx16_16B_rocoba.json +++ b/configs/addressmapping/am_lpddr5_1Gbx16_16B_rocoba.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_1Gbx16_8B_robaco.json b/configs/addressmapping/am_lpddr5_1Gbx16_8B_robaco.json index a131562a..82b756fc 100644 --- a/configs/addressmapping/am_lpddr5_1Gbx16_8B_robaco.json +++ b/configs/addressmapping/am_lpddr5_1Gbx16_8B_robaco.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_1Gbx16_8B_rocoba.json b/configs/addressmapping/am_lpddr5_1Gbx16_8B_rocoba.json index aaf6a029..1f5d2cfe 100644 --- a/configs/addressmapping/am_lpddr5_1Gbx16_8B_rocoba.json +++ b/configs/addressmapping/am_lpddr5_1Gbx16_8B_rocoba.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_1Gbx16_BG_robacobg.json b/configs/addressmapping/am_lpddr5_1Gbx16_BG_robacobg.json index 0fd3b6c0..bf80d312 100644 --- a/configs/addressmapping/am_lpddr5_1Gbx16_BG_robacobg.json +++ b/configs/addressmapping/am_lpddr5_1Gbx16_BG_robacobg.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_1Gbx16_BG_rocobabg.json b/configs/addressmapping/am_lpddr5_1Gbx16_BG_rocobabg.json index 2552ccd3..88629310 100644 --- a/configs/addressmapping/am_lpddr5_1Gbx16_BG_rocobabg.json +++ b/configs/addressmapping/am_lpddr5_1Gbx16_BG_rocobabg.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_512Mbx16_16B_robaco.json b/configs/addressmapping/am_lpddr5_512Mbx16_16B_robaco.json index 4f5bfd86..8b91cc1e 100644 --- a/configs/addressmapping/am_lpddr5_512Mbx16_16B_robaco.json +++ b/configs/addressmapping/am_lpddr5_512Mbx16_16B_robaco.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_512Mbx16_16B_rocoba.json b/configs/addressmapping/am_lpddr5_512Mbx16_16B_rocoba.json index c5cf4d95..8630b987 100644 --- a/configs/addressmapping/am_lpddr5_512Mbx16_16B_rocoba.json +++ b/configs/addressmapping/am_lpddr5_512Mbx16_16B_rocoba.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_512Mbx16_8B_robaco.json b/configs/addressmapping/am_lpddr5_512Mbx16_8B_robaco.json index 1846604c..284f8957 100644 --- a/configs/addressmapping/am_lpddr5_512Mbx16_8B_robaco.json +++ b/configs/addressmapping/am_lpddr5_512Mbx16_8B_robaco.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_512Mbx16_8B_rocoba.json b/configs/addressmapping/am_lpddr5_512Mbx16_8B_rocoba.json index 9c00c8d9..35b67ef4 100644 --- a/configs/addressmapping/am_lpddr5_512Mbx16_8B_rocoba.json +++ b/configs/addressmapping/am_lpddr5_512Mbx16_8B_rocoba.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_512Mbx16_BG_robacobg.json b/configs/addressmapping/am_lpddr5_512Mbx16_BG_robacobg.json index bf283cd6..94066723 100644 --- a/configs/addressmapping/am_lpddr5_512Mbx16_BG_robacobg.json +++ b/configs/addressmapping/am_lpddr5_512Mbx16_BG_robacobg.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_lpddr5_512Mbx16_BG_rocobabg.json b/configs/addressmapping/am_lpddr5_512Mbx16_BG_rocobabg.json index c85e1b7e..3898a373 100644 --- a/configs/addressmapping/am_lpddr5_512Mbx16_BG_rocobabg.json +++ b/configs/addressmapping/am_lpddr5_512Mbx16_BG_rocobabg.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/configs/addressmapping/am_ranktest.json b/configs/addressmapping/am_ranktest.json index 720b214e..accf2165 100644 --- a/configs/addressmapping/am_ranktest.json +++ b/configs/addressmapping/am_ranktest.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "RANK_BIT":[ 30, 31 diff --git a/configs/addressmapping/am_stt-mram_8x2Gbx8_dimm_p1KB_rbc.json b/configs/addressmapping/am_stt-mram_8x2Gbx8_dimm_p1KB_rbc.json index d1bcfe70..91c90fa6 100644 --- a/configs/addressmapping/am_stt-mram_8x2Gbx8_dimm_p1KB_rbc.json +++ b/configs/addressmapping/am_stt-mram_8x2Gbx8_dimm_p1KB_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 13, 14, diff --git a/configs/addressmapping/am_wideio2_4x64_4x2Gb_brc.json b/configs/addressmapping/am_wideio2_4x64_4x2Gb_brc.json index 512b8090..e1267bcc 100644 --- a/configs/addressmapping/am_wideio2_4x64_4x2Gb_brc.json +++ b/configs/addressmapping/am_wideio2_4x64_4x2Gb_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 25, 26, diff --git a/configs/addressmapping/am_wideio2_4x64_4x2Gb_rbc.json b/configs/addressmapping/am_wideio2_4x64_4x2Gb_rbc.json index 58bc5ce4..e90f4110 100644 --- a/configs/addressmapping/am_wideio2_4x64_4x2Gb_rbc.json +++ b/configs/addressmapping/am_wideio2_4x64_4x2Gb_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 12, 13, diff --git a/configs/addressmapping/am_wideio_4x1Gb_brc.json b/configs/addressmapping/am_wideio_4x1Gb_brc.json index 7f51385c..6f05d067 100644 --- a/configs/addressmapping/am_wideio_4x1Gb_brc.json +++ b/configs/addressmapping/am_wideio_4x1Gb_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 25, 26 diff --git a/configs/addressmapping/am_wideio_4x1Gb_rbc.json b/configs/addressmapping/am_wideio_4x1Gb_rbc.json index cbe47587..cf088be1 100644 --- a/configs/addressmapping/am_wideio_4x1Gb_rbc.json +++ b/configs/addressmapping/am_wideio_4x1Gb_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 11, 12 diff --git a/configs/addressmapping/am_wideio_4x256Mb_brc.json b/configs/addressmapping/am_wideio_4x256Mb_brc.json index 52d665e5..3d4ae4d6 100644 --- a/configs/addressmapping/am_wideio_4x256Mb_brc.json +++ b/configs/addressmapping/am_wideio_4x256Mb_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 23, 24 diff --git a/configs/addressmapping/am_wideio_4x256Mb_rbc.json b/configs/addressmapping/am_wideio_4x256Mb_rbc.json index fc5f8b2a..d855313d 100644 --- a/configs/addressmapping/am_wideio_4x256Mb_rbc.json +++ b/configs/addressmapping/am_wideio_4x256Mb_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 11, 12 diff --git a/configs/addressmapping/am_wideio_4x2Gb_brc.json b/configs/addressmapping/am_wideio_4x2Gb_brc.json index 3040e90a..961a4a36 100644 --- a/configs/addressmapping/am_wideio_4x2Gb_brc.json +++ b/configs/addressmapping/am_wideio_4x2Gb_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 26, 27 diff --git a/configs/addressmapping/am_wideio_4x2Gb_rbc.json b/configs/addressmapping/am_wideio_4x2Gb_rbc.json index 76a9de62..15ddf749 100644 --- a/configs/addressmapping/am_wideio_4x2Gb_rbc.json +++ b/configs/addressmapping/am_wideio_4x2Gb_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 11, 12 diff --git a/configs/addressmapping/am_wideio_4x4Gb_brc.json b/configs/addressmapping/am_wideio_4x4Gb_brc.json index 8c16b58c..639ba547 100644 --- a/configs/addressmapping/am_wideio_4x4Gb_brc.json +++ b/configs/addressmapping/am_wideio_4x4Gb_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 27, 28 diff --git a/configs/addressmapping/am_wideio_4x4Gb_rbc.json b/configs/addressmapping/am_wideio_4x4Gb_rbc.json index e8d1b1e8..4fa24317 100644 --- a/configs/addressmapping/am_wideio_4x4Gb_rbc.json +++ b/configs/addressmapping/am_wideio_4x4Gb_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 12, 13 diff --git a/configs/addressmapping/am_wideio_4x512Mb_brc.json b/configs/addressmapping/am_wideio_4x512Mb_brc.json index 18ab6414..c07fcc40 100644 --- a/configs/addressmapping/am_wideio_4x512Mb_brc.json +++ b/configs/addressmapping/am_wideio_4x512Mb_brc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 24, 25 diff --git a/configs/addressmapping/am_wideio_4x512Mb_rbc.json b/configs/addressmapping/am_wideio_4x512Mb_rbc.json index 62578383..60cacb06 100644 --- a/configs/addressmapping/am_wideio_4x512Mb_rbc.json +++ b/configs/addressmapping/am_wideio_4x512Mb_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 11, 12 diff --git a/configs/addressmapping/am_wideio_thermal.json b/configs/addressmapping/am_wideio_thermal.json index 96be2a29..c8597163 100644 --- a/configs/addressmapping/am_wideio_thermal.json +++ b/configs/addressmapping/am_wideio_thermal.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BANK_BIT": [ 4, 5 diff --git a/src/configuration/DRAMSys/config/AddressMapping.h b/src/configuration/DRAMSys/config/AddressMapping.h index 0d435bd1..333f6b38 100644 --- a/src/configuration/DRAMSys/config/AddressMapping.h +++ b/src/configuration/DRAMSys/config/AddressMapping.h @@ -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> BYTE_BIT; - std::optional> COLUMN_BIT; - std::optional> ROW_BIT; - std::optional> BANK_BIT; - std::optional> BANKGROUP_BIT; - std::optional> RANK_BIT; - std::optional> PSEUDOCHANNEL_BIT; - std::optional> CHANNEL_BIT; - std::optional> XOR; - } CONGEN; + std::optional> BYTE_BIT; + std::optional> COLUMN_BIT; + std::optional> ROW_BIT; + std::optional> BANK_BIT; + std::optional> BANKGROUP_BIT; + std::optional> RANK_BIT; + std::optional> PSEUDOCHANNEL_BIT; + std::optional> CHANNEL_BIT; + std::optional> XOR; }; -NLOHMANN_JSONIFY_ALL_THINGS(AddressMapping, CONGEN) - -NLOHMANN_JSONIFY_ALL_THINGS(AddressMapping::ConGen, +NLOHMANN_JSONIFY_ALL_THINGS(AddressMapping, BYTE_BIT, COLUMN_BIT, ROW_BIT, diff --git a/src/configuration/DRAMSys/config/DRAMSysConfiguration.cpp b/src/configuration/DRAMSys/config/DRAMSysConfiguration.cpp index 0b6f546c..33d2d81a 100644 --- a/src/configuration/DRAMSys/config/DRAMSysConfiguration.cpp +++ b/src/configuration/DRAMSys/config/DRAMSysConfiguration.cpp @@ -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 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; diff --git a/src/configuration/DRAMSys/config/McConfig.h b/src/configuration/DRAMSys/config/McConfig.h index f7a9336d..361716b6 100644 --- a/src/configuration/DRAMSys/config/McConfig.h +++ b/src/configuration/DRAMSys/config/McConfig.h @@ -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 PagePolicy; std::optional Scheduler; diff --git a/src/configuration/DRAMSys/config/SimConfig.h b/src/configuration/DRAMSys/config/SimConfig.h index 0c283729..d7d0376b 100644 --- a/src/configuration/DRAMSys/config/SimConfig.h +++ b/src/configuration/DRAMSys/config/SimConfig.h @@ -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 AddressOffset; std::optional CheckTLM2Protocol; diff --git a/src/configuration/DRAMSys/config/TraceSetup.h b/src/configuration/DRAMSys/config/TraceSetup.h index af100b30..76c6a29a 100644 --- a/src/configuration/DRAMSys/config/TraceSetup.h +++ b/src/configuration/DRAMSys/config/TraceSetup.h @@ -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< diff --git a/src/configuration/DRAMSys/config/memspec/MemSpec.h b/src/configuration/DRAMSys/config/memspec/MemSpec.h index 8bc1ba73..4521534b 100644 --- a/src/configuration/DRAMSys/config/memspec/MemSpec.h +++ b/src/configuration/DRAMSys/config/memspec/MemSpec.h @@ -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; diff --git a/src/libdramsys/DRAMSys/simulation/AddressDecoder.cpp b/src/libdramsys/DRAMSys/simulation/AddressDecoder.cpp index 7b3de3b2..83cd8f1c 100644 --- a/src/libdramsys/DRAMSys/simulation/AddressDecoder.cpp +++ b/src/libdramsys/DRAMSys/simulation/AddressDecoder.cpp @@ -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)); } diff --git a/tests/tests_configuration/reference.json b/tests/tests_configuration/reference.json index ac8f4a31..42d01beb 100644 --- a/tests/tests_configuration/reference.json +++ b/tests/tests_configuration/reference.json @@ -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", diff --git a/tests/tests_configuration/resources/addressmapping/am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json b/tests/tests_configuration/resources/addressmapping/am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json index bce5038e..143f714a 100644 --- a/tests/tests_configuration/resources/addressmapping/am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json +++ b/tests/tests_configuration/resources/addressmapping/am_ddr5_2x8x2Gbx4_dimm_p1KB_rbc.json @@ -1,5 +1,5 @@ { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0, 1 diff --git a/tests/tests_configuration/test_configuration.cpp b/tests/tests_configuration/test_configuration.cpp index 3e81d3ef..ca0430cf 100644 --- a/tests/tests_configuration/test_configuration.cpp +++ b/tests/tests_configuration/test_configuration.cpp @@ -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); } diff --git a/tests/tests_dramsys/AddressDecoderConfigs.h b/tests/tests_dramsys/AddressDecoderConfigs.h index 671c24ef..17e18d79 100644 --- a/tests/tests_dramsys/AddressDecoderConfigs.h +++ b/tests/tests_dramsys/AddressDecoderConfigs.h @@ -102,7 +102,7 @@ inline constexpr std::string_view memSpecJsonString = R"( inline constexpr std::string_view addressMappingJsonString = R"( { - "CONGEN": { + "addressmapping": { "BYTE_BIT": [ 0 ], diff --git a/tests/tests_dramsys/AddressDecoderTests.cpp b/tests/tests_dramsys/AddressDecoderTests.cpp index fe9dd24b..b7390555 100644 --- a/tests/tests_dramsys/AddressDecoderTests.cpp +++ b/tests/tests_dramsys/AddressDecoderTests.cpp @@ -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()), memSpec(memSpecConfig), diff --git a/tests/tests_dramsys/b_transport/configs/no_storage.json b/tests/tests_dramsys/b_transport/configs/no_storage.json index c2950e40..6b3be967 100644 --- a/tests/tests_dramsys/b_transport/configs/no_storage.json +++ b/tests/tests_dramsys/b_transport/configs/no_storage.json @@ -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", diff --git a/tests/tests_dramsys/b_transport/configs/storage.json b/tests/tests_dramsys/b_transport/configs/storage.json index 3535eaeb..788056ec 100644 --- a/tests/tests_dramsys/b_transport/configs/storage.json +++ b/tests/tests_dramsys/b_transport/configs/storage.json @@ -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",