diff options
-rw-r--r-- | util/spd_tools/ddr4/gen_spd.go | 5 | ||||
-rw-r--r-- | util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/util/spd_tools/ddr4/gen_spd.go b/util/spd_tools/ddr4/gen_spd.go index 5adadc962a..0462fd5056 100644 --- a/util/spd_tools/ddr4/gen_spd.go +++ b/util/spd_tools/ddr4/gen_spd.go @@ -12,6 +12,7 @@ import ( "reflect" "strconv" "strings" + "regexp" ) /* @@ -998,6 +999,10 @@ func readMemoryParts(memParts *memParts, memPartsFileName string) error { return err } + // Strip comments from json file + re := regexp.MustCompile(`(?m)^\s*//.*`) + databytes = re.ReplaceAll(databytes, []byte("")) + return json.Unmarshal(databytes, memParts) } diff --git a/util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt b/util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt index 4e9c7c8e95..51068d5154 100644 --- a/util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt +++ b/util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt @@ -1,3 +1,6 @@ +// Global list of ddr4 memory part attributes. +// These attributes match the part specifications and are independent +// of any SoC expectations. { "parts": [ { |