sim: Move checkpoint parameters for ptable into seperate section
authorIan Jiang <ianjiang.ict@gmail.com>
Tue, 28 Jul 2020 05:26:49 +0000 (13:26 +0800)
committerIan Jiang <ianjiang.ict@gmail.com>
Thu, 30 Jul 2020 07:12:00 +0000 (07:12 +0000)
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 <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31874
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/page_table.cc

index 400500b38a53cdee94959330e147475827e9f700..601b9c5d16ed2799455bee3ffc5143b9ecb4b818 100644 (file)
@@ -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));