From 78bccaf7a822b846672a73f3bb3caa3bdad0237c Mon Sep 17 00:00:00 2001 From: Ian Jiang Date: Tue, 28 Jul 2020 13:26:49 +0800 Subject: [PATCH] sim: Move checkpoint parameters for ptable into seperate section In checkpoint output files, the parameters for page table including size and entries are organized not very clearly. For example: [system.cpu.workload] ... ptable.size=... [system.cpu.workload.Entry0] vaddr=... paddr=... flags=... [system.cpu.workload.Entry1] ... This commit moves these parameters into a separate section named 'ptable'. For example: [system.cpu.workload.ptable] size=... [system.cpu.workload.ptable.Entry0] vaddr=... paddr=... flags=... [system.cpu.workload.ptable.Entry1] ... Change-Id: Iaa4129b3f4f090e8c3651bde90524abba0999c7f Signed-off-by: Ian Jiang Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31874 Reviewed-by: Daniel Carvalho Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- src/mem/page_table.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mem/page_table.cc b/src/mem/page_table.cc index 400500b38..601b9c5d1 100644 --- a/src/mem/page_table.cc +++ b/src/mem/page_table.cc @@ -168,7 +168,8 @@ EmulationPageTable::translate(const RequestPtr &req) void EmulationPageTable::serialize(CheckpointOut &cp) const { - paramOut(cp, "ptable.size", pTable.size()); + ScopedCheckpointSection sec(cp, "ptable"); + paramOut(cp, "size", pTable.size()); PTable::size_type count = 0; for (auto &pte : pTable) { @@ -185,7 +186,8 @@ void EmulationPageTable::unserialize(CheckpointIn &cp) { int count; - paramIn(cp, "ptable.size", count); + ScopedCheckpointSection sec(cp, "ptable"); + paramIn(cp, "size", count); for (int i = 0; i < count; ++i) { ScopedCheckpointSection sec(cp, csprintf("Entry%d", i)); -- 2.30.2