From 5d24b0a5adafa4ae09b29ec0e2cbc1a2ecd4126f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 15 Jun 2018 14:56:10 -0700 Subject: systemc: Add the nonstandard macro SC_NEW. This is in the Accellera implementation and in the regression tests. The implementation here is a bit different than theirs in that it uses std::unique_ptrs. Change-Id: Id3d1ad82482b94a5d99f27e02d1e447ca1944797 Reviewed-on: https://gem5-review.googlesource.com/11255 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/core/sc_module.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/systemc/core') diff --git a/src/systemc/core/sc_module.cc b/src/systemc/core/sc_module.cc index 6bbb9dca6..646916fac 100644 --- a/src/systemc/core/sc_module.cc +++ b/src/systemc/core/sc_module.cc @@ -27,6 +27,9 @@ * Authors: Gabe Black */ +#include +#include + #include "base/logging.hh" #include "systemc/ext/core/sc_module.hh" @@ -539,4 +542,12 @@ sc_end_of_simulation_invoked() return false; } +sc_module * +sc_module_sc_new(sc_module *mod) +{ + static std::vector > modules; + modules.emplace_back(mod); + return mod; +} + } // namespace sc_core -- cgit v1.2.3