From 6921d943735905ec1f6b7cc3216d957d7e26c755 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Mon, 11 Sep 2023 15:25:16 -0700 Subject: [PATCH] python: Recursively create checkpoint dir While there was code present in "serialize.cc" to create the checkpoint directory, it did not do recursively. This patch ensures all the directories are created in a path to the checkpoint directory. Change-Id: Ibcf7f800358fd89946f550b8cfb0cef8b51fceac --- src/python/m5/simulate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py index 70ed11a9b6..19d5604568 100644 --- a/src/python/m5/simulate.py +++ b/src/python/m5/simulate.py @@ -318,6 +318,10 @@ def checkpoint(dir): drain() memWriteback(root) + + # Recursively create the checkpoint directory if it does not exist. + os.makedirs(dir, exist_ok=True) + print("Writing checkpoint") _m5.core.serializeAll(dir)