cpu: Implement basic HTM capabilities in the CheckerCPU

The O3CPU, which supports transactional memory (HTM), is using
the inHtmTransactionalState and getHtmCheckpointPtr methods
to check if we are in the middle of a transaction and return
false or a nullptr if that's not the case.

We need to avoid aborting simulation (panic) when those methods are
called in the O3CPU + Checker simulation.

This patch is providing the minimal support to re-enable O3 + Checker
runs and it is not providing HTM support in the CheckerCPU (meaning, we
won't be able to use the Checker in a transactional simulation)

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I7f71d5290c53b0402763d69f137ecaa1208253fb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46624
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Giacomo Travaglini
2021-06-07 16:19:17 +01:00
parent 0249cb0107
commit 182ef827c8
2 changed files with 5 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2016-2018, 2020 ARM Limited
* Copyright (c) 2011, 2016-2018, 2020-2021 Arm Limited
* Copyright (c) 2013 Advanced Micro Devices, Inc.
* All rights reserved
*
@@ -380,15 +380,14 @@ class CheckerCPU : public BaseCPU, public ExecContext
bool
inHtmTransactionalState() const override
{
panic("not yet supported!");
return false;
return (getHtmTransactionalDepth() > 0);
}
uint64_t
getHtmTransactionalDepth() const override
{
panic("not yet supported!");
return 0;
assert(thread->htmTransactionStarts >= thread->htmTransactionStops);
return (thread->htmTransactionStarts - thread->htmTransactionStops);
}
TheISA::PCState pcState() const override { return thread->pcState(); }

View File

@@ -497,7 +497,7 @@ class CheckerThreadContext : public ThreadContext
BaseHTMCheckpointPtr&
getHtmCheckpointPtr() override
{
panic("function not implemented");
return actualTC->getHtmCheckpointPtr();
}
void