Source('channel.cc')
Source('event.cc')
Source('kernel.cc')
+ Source('messages.cc')
Source('module.cc')
Source('object.cc')
Source('port.cc')
#include "sim/core.hh"
#include "systemc/core/module.hh"
#include "systemc/core/scheduler.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/core/sc_module.hh"
std::string message = path + original_name +
". Latter declaration will be renamed to " +
path + _basename;
- SC_REPORT_WARNING("(W505) object already exists", message.c_str());
+ SC_REPORT_WARNING(sc_core::SC_ID_INSTANCE_EXISTS_,
+ message.c_str());
}
_name = path + _basename;
void
Event::notify()
{
- if (scheduler.inUpdate()) {
- SC_REPORT_ERROR("(E521) immediate notification is not allowed "
- "during update phase or elaboration", "");
- }
+ if (scheduler.inUpdate())
+ SC_REPORT_ERROR(sc_core::SC_ID_IMMEDIATE_NOTIFICATION_, "");
// An immediate notification overrides any pending delayed notification.
if (delayedNotify.scheduled())
void
Event::notifyDelayed(const sc_core::sc_time &t)
{
- if (delayedNotify.scheduled()) {
- SC_REPORT_ERROR("(E531) notify_delayed() cannot be called on events "
- "that have pending notifications", "");
- }
+ if (delayedNotify.scheduled())
+ SC_REPORT_ERROR(sc_core::SC_ID_NOTIFY_DELAYED_, "");
notify(t);
}
--- /dev/null
+/*
+ * Copyright 2018 Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Gabe Black
+ */
+
+#include "systemc/ext/core/messages.hh"
+#include "systemc/utils/report.hh"
+
+namespace sc_core
+{
+
+const char SC_ID_NO_BOOL_RETURNED_[] = "operator does not return boolean";
+const char SC_ID_NO_INT_RETURNED_[] = "operator does not return int";
+const char SC_ID_NO_SC_LOGIC_RETURNED_[] = "operator does not return sc_logic";
+const char SC_ID_OPERAND_NOT_SC_LOGIC_[] = "operand is not sc_logic";
+const char SC_ID_OPERAND_NOT_BOOL_[] = "operand is not bool";
+const char SC_ID_INSTANCE_EXISTS_[] = "object already exists";
+const char SC_ID_ILLEGAL_CHARACTERS_[] = "illegal characters";
+const char SC_ID_VC6_PROCESS_HELPER_[] =
+ "internal error: sc_vc6_process_helper";
+const char SC_ID_VC6_MAX_PROCESSES_EXCEEDED_[] =
+ "maximum number of processes per module exceeded (VC6)";
+const char SC_ID_END_MODULE_NOT_CALLED_[] =
+ "module construction not properly completed: did "
+ "you forget to add a sc_module_name parameter to "
+ "your module constructor?";
+const char SC_ID_HIER_NAME_INCORRECT_[] =
+ "hierarchical name as shown may be incorrect due to previous errors";
+const char SC_ID_SET_STACK_SIZE_[] =
+ "set_stack_size() is only allowed for SC_THREADs and SC_CTHREADs";
+const char SC_ID_SC_MODULE_NAME_USE_[] = "incorrect use of sc_module_name";
+const char SC_ID_SC_MODULE_NAME_REQUIRED_[] =
+ "an sc_module_name parameter for your constructor is required";
+const char SC_ID_SET_TIME_RESOLUTION_[] = "set time resolution failed";
+const char SC_ID_SET_DEFAULT_TIME_UNIT_[] = "set default time unit failed";
+const char SC_ID_DEFAULT_TIME_UNIT_CHANGED_[] =
+ "default time unit changed to time resolution";
+const char SC_ID_INCONSISTENT_API_CONFIG_[] =
+ "inconsistent library configuration detected";
+const char SC_ID_WAIT_NOT_ALLOWED_[] =
+ "wait() is only allowed in SC_THREADs and SC_CTHREADs";
+const char SC_ID_NEXT_TRIGGER_NOT_ALLOWED_[] =
+ "next_trigger() is only allowed in SC_METHODs";
+const char SC_ID_IMMEDIATE_NOTIFICATION_[] =
+ "immediate notification is not allowed during update phase or elaboration";
+const char SC_ID_HALT_NOT_ALLOWED_[] = "halt() is only allowed in SC_CTHREADs";
+const char SC_ID_WATCHING_NOT_ALLOWED_[] =
+ "watching() has been deprecated, use reset_signal_is()";
+const char SC_ID_DONT_INITIALIZE_[] =
+ "dont_initialize() has no effect for SC_CTHREADs";
+const char SC_ID_WAIT_N_INVALID_[] = "wait(n) is only valid for n > 0";
+const char SC_ID_MAKE_SENSITIVE_[] = "make sensitive failed";
+const char SC_ID_MAKE_SENSITIVE_POS_[] = "make sensitive pos failed";
+const char SC_ID_MAKE_SENSITIVE_NEG_[] = "make sensitive neg failed";
+const char SC_ID_INSERT_MODULE_[] = "insert module failed";
+const char SC_ID_REMOVE_MODULE_[] = "remove module failed";
+const char SC_ID_NOTIFY_DELAYED_[] =
+ "notify_delayed() cannot be called on events "
+ "that have pending notifications";
+const char SC_ID_GEN_UNIQUE_NAME_[] =
+ "cannot generate unique name from null string";
+const char SC_ID_MODULE_NAME_STACK_EMPTY_[] =
+ "module name stack is empty: did you forget to "
+ "add a sc_module_name parameter to your module "
+ "constructor?";
+const char SC_ID_NAME_EXISTS_[] = "name already exists";
+const char SC_ID_IMMEDIATE_SELF_NOTIFICATION_[] =
+ "immediate self-notification ignored as of IEEE 1666-2011";
+const char SC_ID_WAIT_DURING_UNWINDING_[] =
+ "wait() not allowed during unwinding";
+const char SC_ID_CYCLE_MISSES_EVENTS_[] =
+ "the simulation contains timed-events but they are "
+ "ignored by sc_cycle() ==> the simulation will be "
+ "incorrect";
+const char SC_ID_RETHROW_UNWINDING_[] =
+ "sc_unwind_exception not re-thrown during kill/reset";
+const char SC_ID_PROCESS_ALREADY_UNWINDING_[] =
+ "kill/reset ignored during unwinding";
+const char SC_ID_MODULE_METHOD_AFTER_START_[] =
+ "call to SC_METHOD in sc_module while simulation running";
+const char SC_ID_MODULE_THREAD_AFTER_START_[] =
+ "call to SC_THREAD in sc_module while simulation running";
+const char SC_ID_MODULE_CTHREAD_AFTER_START_[] =
+ "call to SC_CTHREAD in sc_module while simulation running";
+const char SC_ID_SIMULATION_TIME_OVERFLOW_[] =
+ "simulation time value overflow, simulation aborted";
+const char SC_ID_SIMULATION_STOP_CALLED_TWICE_[] =
+ "sc_stop has already been called";
+const char SC_ID_SIMULATION_START_AFTER_STOP_[] =
+ "sc_start called after sc_stop has been called";
+const char SC_ID_STOP_MODE_AFTER_START_[] =
+ "attempt to set sc_stop mode after start will be ignored";
+const char SC_ID_SIMULATION_START_AFTER_ERROR_[] =
+ "attempt to restart simulation after error";
+const char SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_[] = "uncaught exception";
+const char SC_ID_PHASE_CALLBACKS_UNSUPPORTED_[] =
+ "simulation phase callbacks not enabled";
+const char SC_ID_PHASE_CALLBACK_NOT_IMPLEMENTED_[] =
+ "empty simulation phase callback called";
+const char SC_ID_PHASE_CALLBACK_REGISTER_[] =
+ "register simulation phase callback";
+const char SC_ID_PHASE_CALLBACK_FORBIDDEN_[] =
+ "forbidden action in simulation phase callback";
+const char SC_ID_SIMULATION_START_UNEXPECTED_[] =
+ "sc_start called unexpectedly";
+const char SC_ID_THROW_IT_IGNORED_[] =
+ "throw_it on method/non-running process is being ignored ";
+const char SC_ID_NOT_EXPECTING_DYNAMIC_EVENT_NOTIFY_[] =
+ "dynamic event notification encountered when sensitivity is static";
+const char SC_ID_DISABLE_WILL_ORPHAN_PROCESS_[] =
+ "disable() or dont_initialize() called on process with no static "
+ "sensitivity, it will be orphaned";
+const char SC_ID_PROCESS_CONTROL_CORNER_CASE_[] =
+ "Undefined process control interaction";
+const char SC_ID_METHOD_TERMINATION_EVENT_[] =
+ "Attempt to get terminated event for a method process";
+const char SC_ID_JOIN_ON_METHOD_HANDLE_[] =
+ "Attempt to register method process with sc_join object";
+const char SC_ID_NO_PROCESS_SEMANTICS_[] =
+ "Attempt to invoke process with no semantics() method";
+const char SC_ID_EVENT_ON_NULL_PROCESS_[] =
+ "Attempt to get an event for non-existent process";
+const char SC_ID_EVENT_LIST_FAILED_[] =
+ "invalid use of sc_(and|or)_event list";
+const char SC_ID_UNKNOWN_PROCESS_TYPE_[] = "Unknown process type";
+const char SC_ID_TIME_CONVERSION_FAILED_[] = "sc_time conversion failed";
+const char SC_ID_NEGATIVE_SIMULATION_TIME_[] =
+ "negative simulation interval specified in sc_start call";
+const char SC_ID_BAD_SC_MODULE_CONSTRUCTOR_[] =
+ "sc_module(const char*), sc_module(const std::string&) "
+ "have been deprecated, use sc_module(const sc_module_name&)";
+const char SC_ID_EMPTY_PROCESS_HANDLE_[] =
+ "attempt to use an empty process handle ignored";
+const char SC_ID_NO_SC_START_ACTIVITY_[] =
+ "no activity or clock movement for sc_start() invocation";
+const char SC_ID_KILL_PROCESS_WHILE_UNITIALIZED_[] =
+ "a process may not be killed before it is initialized";
+const char SC_ID_RESET_PROCESS_WHILE_NOT_RUNNING_[] =
+ "a process may not be asynchronously reset while the "
+ "simulation is not running";
+const char SC_ID_THROW_IT_WHILE_NOT_RUNNING_[] =
+ "throw_it not allowed unless simulation is running ";
+
+namespace {
+
+sc_gem5::DefaultReportMessages predfinedMessages{
+ {500, SC_ID_NO_BOOL_RETURNED_},
+ {501, SC_ID_NO_INT_RETURNED_},
+ {502, SC_ID_NO_SC_LOGIC_RETURNED_},
+ {503, SC_ID_OPERAND_NOT_SC_LOGIC_},
+ {504, SC_ID_OPERAND_NOT_BOOL_},
+ {505, SC_ID_INSTANCE_EXISTS_},
+ {506, SC_ID_ILLEGAL_CHARACTERS_},
+ {507, SC_ID_VC6_PROCESS_HELPER_},
+ {508, SC_ID_VC6_MAX_PROCESSES_EXCEEDED_},
+ {509, SC_ID_END_MODULE_NOT_CALLED_},
+ {510, SC_ID_HIER_NAME_INCORRECT_},
+ {511, SC_ID_SET_STACK_SIZE_},
+ {512, SC_ID_SC_MODULE_NAME_USE_},
+ {513, SC_ID_SC_MODULE_NAME_REQUIRED_},
+ {514, SC_ID_SET_TIME_RESOLUTION_},
+ {515, SC_ID_SET_DEFAULT_TIME_UNIT_},
+ {516, SC_ID_DEFAULT_TIME_UNIT_CHANGED_},
+ {517, SC_ID_INCONSISTENT_API_CONFIG_},
+ {519, SC_ID_WAIT_NOT_ALLOWED_},
+ {520, SC_ID_NEXT_TRIGGER_NOT_ALLOWED_},
+ {521, SC_ID_IMMEDIATE_NOTIFICATION_},
+ {522, SC_ID_HALT_NOT_ALLOWED_},
+ {523, SC_ID_WATCHING_NOT_ALLOWED_},
+ {524, SC_ID_DONT_INITIALIZE_},
+ {525, SC_ID_WAIT_N_INVALID_},
+ {526, SC_ID_MAKE_SENSITIVE_},
+ {527, SC_ID_MAKE_SENSITIVE_POS_},
+ {528, SC_ID_MAKE_SENSITIVE_NEG_},
+ {529, SC_ID_INSERT_MODULE_},
+ {530, SC_ID_REMOVE_MODULE_},
+ {531, SC_ID_NOTIFY_DELAYED_},
+ {532, SC_ID_GEN_UNIQUE_NAME_},
+ {533, SC_ID_MODULE_NAME_STACK_EMPTY_},
+ {534, SC_ID_NAME_EXISTS_},
+ {536, SC_ID_IMMEDIATE_SELF_NOTIFICATION_},
+ {537, SC_ID_WAIT_DURING_UNWINDING_},
+ {538, SC_ID_CYCLE_MISSES_EVENTS_},
+ {539, SC_ID_RETHROW_UNWINDING_},
+ {540, SC_ID_PROCESS_ALREADY_UNWINDING_},
+ {541, SC_ID_MODULE_METHOD_AFTER_START_},
+ {542, SC_ID_MODULE_THREAD_AFTER_START_},
+ {543, SC_ID_MODULE_CTHREAD_AFTER_START_},
+ {544, SC_ID_SIMULATION_TIME_OVERFLOW_},
+ {545, SC_ID_SIMULATION_STOP_CALLED_TWICE_},
+ {546, SC_ID_SIMULATION_START_AFTER_STOP_},
+ {547, SC_ID_STOP_MODE_AFTER_START_},
+ {548, SC_ID_SIMULATION_START_AFTER_ERROR_},
+ {549, SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_},
+ {550, SC_ID_PHASE_CALLBACKS_UNSUPPORTED_},
+ {551, SC_ID_PHASE_CALLBACK_NOT_IMPLEMENTED_},
+ {552, SC_ID_PHASE_CALLBACK_REGISTER_},
+ {553, SC_ID_PHASE_CALLBACK_FORBIDDEN_},
+ {554, SC_ID_SIMULATION_START_UNEXPECTED_},
+ {556, SC_ID_THROW_IT_IGNORED_},
+ {557, SC_ID_NOT_EXPECTING_DYNAMIC_EVENT_NOTIFY_},
+ {558, SC_ID_DISABLE_WILL_ORPHAN_PROCESS_},
+ {559, SC_ID_PROCESS_CONTROL_CORNER_CASE_},
+ {560, SC_ID_METHOD_TERMINATION_EVENT_},
+ {561, SC_ID_JOIN_ON_METHOD_HANDLE_},
+ {563, SC_ID_NO_PROCESS_SEMANTICS_},
+ {564, SC_ID_EVENT_ON_NULL_PROCESS_},
+ {565, SC_ID_EVENT_LIST_FAILED_},
+ {566, SC_ID_UNKNOWN_PROCESS_TYPE_},
+ {567, SC_ID_TIME_CONVERSION_FAILED_},
+ {568, SC_ID_NEGATIVE_SIMULATION_TIME_},
+ {569, SC_ID_BAD_SC_MODULE_CONSTRUCTOR_},
+ {570, SC_ID_EMPTY_PROCESS_HANDLE_},
+ {571, SC_ID_NO_SC_START_ACTIVITY_},
+ {572, SC_ID_KILL_PROCESS_WHILE_UNITIALIZED_},
+ {573, SC_ID_RESET_PROCESS_WHILE_NOT_RUNNING_},
+ {574, SC_ID_THROW_IT_WHILE_NOT_RUNNING_}
+};
+
+} // anonymous namespace
+
+} // namespace sc_core
#include <cassert>
#include "base/logging.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_export.hh"
#include "systemc/ext/core/sc_port.hh"
#include "systemc/ext/utils/sc_report_handler.hh"
{
if (_deprecatedConstructor && !_ended) {
std::string msg = csprintf("module '%s'", name());
- SC_REPORT_WARNING("(W509) module construction not properly completed: "
- "did you forget to add a sc_module_name parameter to "
- "your module constructor?", msg.c_str());
+ SC_REPORT_WARNING(sc_core::SC_ID_END_MODULE_NOT_CALLED_, msg.c_str());
}
pushParentModule(this);
try {
Module *
newModuleChecked()
{
- if (!_new_module) {
- SC_REPORT_ERROR("(E533) module name stack is empty: "
- "did you forget to add a sc_module_name parameter to "
- "your module constructor?", nullptr);
- }
+ if (!_new_module)
+ SC_REPORT_ERROR(sc_core::SC_ID_MODULE_NAME_STACK_EMPTY_, "");
return _new_module;
}
#include "systemc/core/event.hh"
#include "systemc/core/module.hh"
#include "systemc/core/scheduler.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_module.hh"
namespace sc_gem5
std::string message = path + original_name +
". Latter declaration will be renamed to " +
path + _basename;
- SC_REPORT_WARNING("(W505) object already exists", message.c_str());
+ SC_REPORT_WARNING(sc_core::SC_ID_INSTANCE_EXISTS_, message.c_str());
}
_name = path + _basename;
}
#include "systemc/core/event.hh"
#include "systemc/core/port.hh"
#include "systemc/core/scheduler.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_join.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/core/sc_process_handle.hh"
timeoutEvent.scheduled()) {
std::string message("attempt to disable a thread with timeout wait: ");
message += name();
- SC_REPORT_ERROR("Undefined process control interaction",
+ SC_REPORT_ERROR(sc_core::SC_ID_PROCESS_CONTROL_CORNER_CASE_,
message.c_str());
}
Process::kill(bool inc_kids)
{
if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING) {
- SC_REPORT_ERROR(
- "(E572) a process may not be killed before it is initialized",
+ SC_REPORT_ERROR(sc_core::SC_ID_KILL_PROCESS_WHILE_UNITIALIZED_,
name());
}
Process::reset(bool inc_kids)
{
if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING) {
- SC_REPORT_ERROR(
- "(E573) a process may not be asynchronously reset while"
- "the simulation is not running", name());
+ SC_REPORT_ERROR(sc_core::SC_ID_RESET_PROCESS_WHILE_NOT_RUNNING_,
+ name());
}
// Propogate the reset to our children no matter what happens to us.
void
Process::throw_it(ExceptionWrapperBase &exc, bool inc_kids)
{
- if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING) {
- SC_REPORT_ERROR(
- "(E574) throw_it not allowed unless simulation is running ",
- name());
- }
+ if (::sc_core::sc_get_status() != ::sc_core::SC_RUNNING)
+ SC_REPORT_ERROR(sc_core::SC_ID_THROW_IT_WHILE_NOT_RUNNING_, name());
if (inc_kids)
forEachKid([&exc](Process *p) { p->throw_it(exc, true); });
if (_needsStart || _terminated ||
procKind() == ::sc_core::SC_METHOD_PROC_) {
- SC_REPORT_WARNING("(W556) throw_it on method/non-running process "
- "is being ignored ", name());
+ SC_REPORT_WARNING(sc_core::SC_ID_THROW_IT_IGNORED_, name());
return;
}
#include "base/logging.hh"
#include "systemc/core/process.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_event.hh"
#include "systemc/ext/core/sc_join.hh"
#include "systemc/ext/core/sc_module.hh"
assert(p);
if (p->procKind() == SC_METHOD_PROC_) {
- SC_REPORT_ERROR("(E561) Attempt to register method process "
- "with sc_join object", "");
+ SC_REPORT_ERROR(SC_ID_JOIN_ON_METHOD_HANDLE_, "");
return;
}
#include "systemc/core/kernel.hh"
#include "systemc/core/python.hh"
#include "systemc/core/scheduler.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/utils/sc_report_handler.hh"
#include "systemc/utils/report.hh"
::sc_gem5::scheduler.oneCycle();
} else {
Tick now = ::sc_gem5::scheduler.getCurTick();
- if (MaxTick - now < time.value()) {
- SC_REPORT_ERROR("(E544) simulation time value overflow, "
- "simulation aborted", "");
- }
+ if (MaxTick - now < time.value())
+ SC_REPORT_ERROR(SC_ID_SIMULATION_TIME_OVERFLOW_, "");
::sc_gem5::scheduler.start(now + time.value(), p == SC_RUN_TO_TIME);
}
}
sc_set_stop_mode(sc_stop_mode mode)
{
if (sc_is_running()) {
- SC_REPORT_ERROR("attempt to set sc_stop mode "
- "after start will be ignored", "");
+ SC_REPORT_ERROR(SC_ID_STOP_MODE_AFTER_START_, "");
return;
}
_stop_mode = mode;
if (stop_called) {
static bool stop_warned = false;
if (!stop_warned)
- SC_REPORT_WARNING("(W545) sc_stop has already been called", "");
+ SC_REPORT_WARNING(SC_ID_SIMULATION_STOP_CALLED_TWICE_, "");
stop_warned = true;
return;
}
#include "systemc/ext/channel/sc_inout.hh"
#include "systemc/ext/channel/sc_out.hh"
#include "systemc/ext/channel/sc_signal_in_if.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_module.hh"
#include "systemc/ext/core/sc_module_name.hh"
#include "systemc/ext/dt/bit/sc_logic.hh"
if (::sc_core::sc_is_running()) {
std::string name = p->name();
delete p;
- SC_REPORT_ERROR("(E541) call to SC_METHOD in sc_module while "
- "simulation running", name.c_str());
+ SC_REPORT_ERROR(sc_core::SC_ID_MODULE_METHOD_AFTER_START_,
+ name.c_str());
return nullptr;
}
scheduler.reg(p);
if (::sc_core::sc_is_running()) {
std::string name = p->name();
delete p;
- SC_REPORT_ERROR("(E542) call to SC_THREAD in sc_module while "
- "simulation running", name.c_str());
+ SC_REPORT_ERROR(sc_core::SC_ID_MODULE_THREAD_AFTER_START_,
+ name.c_str());
return nullptr;
}
scheduler.reg(p);
if (::sc_core::sc_is_running()) {
std::string name = p->name();
delete p;
- SC_REPORT_ERROR("(E543) call to SC_CTHREAD in sc_module while "
- "simulation running", name.c_str());
+ SC_REPORT_ERROR(sc_core::SC_ID_MODULE_CTHREAD_AFTER_START_,
+ name.c_str());
return nullptr;
}
scheduler.reg(p);
sc_object(sc_gem5::newModuleChecked()->name()),
_gem5_module(sc_gem5::currentModule())
{
- if (sc_is_running()) {
- SC_REPORT_ERROR("(E529) insert module failed", "simulation running");
- std::cout << "Running!\n";
- }
- if (::sc_gem5::scheduler.elaborationDone()) {
- SC_REPORT_ERROR("(E529) insert module failed", "elaboration done");
- std::cout << "Elaboration done!\n";
- }
+ if (sc_is_running())
+ SC_REPORT_ERROR(SC_ID_INSERT_MODULE_, "simulation running");
+ if (::sc_gem5::scheduler.elaborationDone())
+ SC_REPORT_ERROR(SC_ID_INSERT_MODULE_, "elaboration done");
}
sc_module::sc_module(const sc_module_name &) : sc_module() {}
sc_module::sc_module(const char *_name) : sc_module(sc_module_name(_name))
{
_gem5_module->deprecatedConstructor();
- SC_REPORT_WARNING("(W569) sc_module(const char*), "
- "sc_module(const std::string&) have been deprecated, use "
- "sc_module(const sc_module_name&)", _name);
+ SC_REPORT_WARNING(SC_ID_BAD_SC_MODULE_CONSTRUCTOR_, _name);
}
sc_module::sc_module(const std::string &_name) :
sc_module(sc_module_name(_name.c_str()))
{
_gem5_module->deprecatedConstructor();
- SC_REPORT_WARNING("(W569) sc_module(const char*), "
- "sc_module(const std::string&) have been deprecated, use "
- "sc_module(const sc_module_name&)", _name.c_str());
+ SC_REPORT_WARNING(SC_ID_BAD_SC_MODULE_CONSTRUCTOR_, _name.c_str());
}
void
sc_module::dont_initialize()
{
::sc_gem5::Process *p = ::sc_gem5::Process::newest();
- if (p->procKind() == SC_CTHREAD_PROC_) {
- SC_REPORT_WARNING("(W524) dont_initialize() has no effect for "
- "SC_CTHREADs", "");
- }
+ if (p->procKind() == SC_CTHREAD_PROC_)
+ SC_REPORT_WARNING(SC_ID_DONT_INITIALIZE_, "");
p->dontInitialize(true);
}
waitErrorCheck(sc_gem5::Process *p)
{
if (p->procKind() == SC_METHOD_PROC_) {
- SC_REPORT_ERROR(
- "(E519) wait() is only allowed in SC_THREADs and SC_CTHREADs",
+ SC_REPORT_ERROR(SC_ID_WAIT_NOT_ALLOWED_,
"\n in SC_METHODs use next_trigger() instead");
return true;
}
{
if (n <= 0) {
std::string msg = csprintf("n = %d", n);
- SC_REPORT_ERROR("(E525) wait(n) is only valid for n > 0", msg.c_str());
+ SC_REPORT_ERROR(SC_ID_WAIT_N_INVALID_, msg.c_str());
}
sc_gem5::Process *p = sc_gem5::scheduler.current();
p->waitCount(n - 1);
sc_gen_unique_name(const char *seed)
{
if (!seed || seed[0] == '\0') {
- SC_REPORT_ERROR(
- "(E532) cannot generate unique name from null string", "");
+ SC_REPORT_ERROR(SC_ID_GEN_UNIQUE_NAME_, "");
seed = "unnamed";
}
#include "base/logging.hh"
#include "systemc/core/module.hh"
#include "systemc/core/scheduler.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/core/sc_module_name.hh"
#include "systemc/ext/utils/sc_report_handler.hh"
_name(name), _gem5_module(nullptr), _on_the_stack(true)
{
if (sc_is_running())
- SC_REPORT_ERROR("(E529) insert module failed", "simulation running");
+ SC_REPORT_ERROR(SC_ID_INSERT_MODULE_, "simulation running");
else if (::sc_gem5::scheduler.elaborationDone())
- SC_REPORT_ERROR("(E529) insert module failed", "elaboration done");
+ SC_REPORT_ERROR(SC_ID_INSERT_MODULE_, "elaboration done");
else
_gem5_module = new sc_gem5::Module(name);
}
#include "base/logging.hh"
#include "systemc/core/process.hh"
#include "systemc/core/scheduler.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/core/sc_process_handle.hh"
#include "systemc/ext/utils/sc_report_handler.hh"
sc_process_handle::terminated_event() const
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "terminated_event()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "terminated_event()");
static sc_gem5::InternalScEvent non_event;
return non_event;
}
sc_process_handle::suspend(sc_descendent_inclusion_info include_descendants)
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "suspend()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "suspend()");
return;
}
_gem5_process->suspend(include_descendants == SC_INCLUDE_DESCENDANTS);
sc_process_handle::resume(sc_descendent_inclusion_info include_descendants)
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "resume()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "resume()");
return;
}
_gem5_process->resume(include_descendants == SC_INCLUDE_DESCENDANTS);
sc_process_handle::disable(sc_descendent_inclusion_info include_descendants)
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "disable()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "disable()");
return;
}
_gem5_process->disable(include_descendants == SC_INCLUDE_DESCENDANTS);
sc_process_handle::enable(sc_descendent_inclusion_info include_descendants)
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "enable()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "enable()");
return;
}
_gem5_process->enable(include_descendants == SC_INCLUDE_DESCENDANTS);
sc_process_handle::kill(sc_descendent_inclusion_info include_descendants)
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "kill()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "kill()");
return;
}
_gem5_process->kill(include_descendants == SC_INCLUDE_DESCENDANTS);
sc_process_handle::reset(sc_descendent_inclusion_info include_descendants)
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "reset()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "reset()");
return;
}
_gem5_process->reset(include_descendants == SC_INCLUDE_DESCENDANTS);
sc_process_handle::is_unwinding()
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "is_unwinding()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "is_unwinding()");
return false;
}
return _gem5_process->isUnwinding();
sc_process_handle::reset_event() const
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "reset()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "reset()");
static sc_gem5::InternalScEvent non_event;
return non_event;
}
sc_descendent_inclusion_info include_descendants)
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "sync_reset_on()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "sync_reset_on()");
return;
}
_gem5_process->syncResetOn(include_descendants == SC_INCLUDE_DESCENDANTS);
sc_descendent_inclusion_info include_descendants)
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "sync_reset_off()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "sync_reset_off()");
return;
}
_gem5_process->syncResetOff(include_descendants == SC_INCLUDE_DESCENDANTS);
#include "systemc/ext/channel/sc_in.hh"
#include "systemc/ext/channel/sc_inout.hh"
#include "systemc/ext/channel/sc_signal_in_if.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_interface.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/core/sc_sensitive.hh"
checkIfRunning()
{
if (sc_is_running())
- SC_REPORT_ERROR("(E526) make sensitive failed", "simulation running");
+ SC_REPORT_ERROR(SC_ID_MAKE_SENSITIVE_, "simulation running");
}
} // anonymous namespace
#include "systemc/ext/channel/sc_inout.hh"
#include "systemc/ext/channel/sc_out.hh"
#include "systemc/ext/channel/sc_signal_in_if.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/core/sc_module.hh"
#include "systemc/ext/core/sc_spawn.hh"
opts->_events.empty() && opts->_ports.empty() &&
opts->_exports.empty() && opts->_interfaces.empty() &&
opts->_finders.empty()) {
- SC_REPORT_WARNING(
- "(W558) disable() or dont_initialize() called on process "
- "with no static sensitivity, it will be orphaned",
+ SC_REPORT_WARNING(sc_core::SC_ID_DISABLE_WILL_ORPHAN_PROCESS_,
proc->name());
}
#include "sim/core.hh"
#include "systemc/core/python.hh"
#include "systemc/core/time.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/core/sc_time.hh"
#include "systemc/ext/utils/sc_report_handler.hh"
}
if (tu > SC_SEC) {
- SC_REPORT_ERROR("(E567) sc_time conversion failed",
- "invalid unit given");
+ SC_REPORT_ERROR(SC_ID_TIME_CONVERSION_FAILED_,"invalid unit given");
val = 0;
return;
}
double d = str ? std::strtod(str, &end) : 0.0;
if (str == end || d < 0.0) {
- SC_REPORT_ERROR("(E567) sc_time conversion failed",
- "invalid value given");
+ SC_REPORT_ERROR(SC_ID_TIME_CONVERSION_FAILED_, "invalid value given");
return SC_ZERO_TIME;
}
void
sc_set_time_resolution(double d, sc_time_unit tu)
{
- if (d <= 0.0) {
- SC_REPORT_ERROR("(E514) set time resolution failed",
- "value not positive");
- }
+ if (d <= 0.0)
+ SC_REPORT_ERROR(SC_ID_SET_TIME_RESOLUTION_, "value not positive");
+
double dummy;
if (modf(log10(d), &dummy) != 0.0) {
- SC_REPORT_ERROR("(E514) set time resolution failed",
+ SC_REPORT_ERROR(SC_ID_SET_TIME_RESOLUTION_,
"value not a power of ten");
}
- if (sc_is_running()) {
- SC_REPORT_ERROR("(E514) set time resolution failed",
- "simulation running");
- }
+ if (sc_is_running())
+ SC_REPORT_ERROR(SC_ID_SET_TIME_RESOLUTION_, "simulation running");
+
static bool specified = false;
- if (specified) {
- SC_REPORT_ERROR("(E514) set time resolution failed",
- "already specified");
- }
+ if (specified)
+ SC_REPORT_ERROR(SC_ID_SET_TIME_RESOLUTION_, "already specified");
+
// This won't detect the timescale being fixed outside of systemc, but
// it's at least some protection.
if (timeFixed) {
- SC_REPORT_ERROR("(E514) set time resolution failed",
+ SC_REPORT_ERROR(SC_ID_SET_TIME_RESOLUTION_,
"sc_time object(s) constructed");
}
double seconds = d * sc_gem5::TimeUnitScale[tu];
- if (seconds < sc_gem5::TimeUnitScale[SC_FS]) {
- SC_REPORT_ERROR("(E514) set time resolution failed",
- "value smaller than 1 fs");
- }
+ if (seconds < sc_gem5::TimeUnitScale[SC_FS])
+ SC_REPORT_ERROR(SC_ID_SET_TIME_RESOLUTION_, "value smaller than 1 fs");
if (seconds > defaultUnit) {
- SC_REPORT_WARNING(
- "(W516) default time unit changed to time resolution", "");
+ SC_REPORT_WARNING(SC_ID_DEFAULT_TIME_UNIT_CHANGED_, "");
defaultUnit = seconds;
}
void
sc_set_default_time_unit(double d, sc_time_unit tu)
{
- if (d < 0.0) {
- SC_REPORT_ERROR("(E515) set default time unit failed",
- "value not positive");
- }
+ if (d < 0.0)
+ SC_REPORT_ERROR(SC_ID_SET_DEFAULT_TIME_UNIT_, "value not positive");
+
double dummy;
if (modf(log10(d), &dummy) != 0.0) {
- SC_REPORT_ERROR("(E515) set default time unit failed",
+ SC_REPORT_ERROR(SC_ID_SET_DEFAULT_TIME_UNIT_,
"value not a power of ten");
}
- if (sc_is_running()) {
- SC_REPORT_ERROR("(E515) set default time unit failed",
- "simulation running");
- }
+ if (sc_is_running())
+ SC_REPORT_ERROR(SC_ID_SET_DEFAULT_TIME_UNIT_, "simulation running");
+
static bool specified = false;
if (specified) {
- SC_REPORT_ERROR("(E515) set default time unit failed",
- "already specified");
+ SC_REPORT_ERROR(SC_ID_SET_DEFAULT_TIME_UNIT_, "already specified");
}
// This won't detect the timescale being fixed outside of systemc, but
// it's at least some protection.
if (timeFixed) {
- SC_REPORT_ERROR("(E515) set default time unit failed",
+ SC_REPORT_ERROR(SC_ID_SET_DEFAULT_TIME_UNIT_,
"sc_time object(s) constructed");
}
if (resolution == 0.0)
resolution = sc_gem5::TimeUnitScale[SC_PS];
if (defaultUnit < resolution) {
- SC_REPORT_ERROR("(E515) set default time unit failed",
+ SC_REPORT_ERROR(SC_ID_SET_DEFAULT_TIME_UNIT_,
"value smaller than time resolution");
}
}
#include "base/logging.hh"
#include "sim/eventq.hh"
#include "systemc/core/kernel.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_main.hh"
#include "systemc/ext/utils/sc_report.hh"
#include "systemc/ext/utils/sc_report_handler.hh"
if (p->dontInitialize()) {
if (!p->hasStaticSensitivities() && !p->internal()) {
- SC_REPORT_WARNING(
- "(W558) disable() or dont_initialize() called on "
- "process with no static sensitivity, it will be "
- "orphaned", p->name());
+ SC_REPORT_WARNING(sc_core::SC_ID_DISABLE_WILL_ORPHAN_PROCESS_,
+ p->name());
}
} else {
p->ready();
} catch (const ::sc_core::sc_unwind_exception &) {
panic("Kill/reset exception escaped a Process::run()");
} catch (const std::exception &e) {
- SC_REPORT_ERROR("uncaught exception", e.what());
+ SC_REPORT_ERROR(
+ sc_core::SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_, e.what());
} catch (const char *msg) {
- SC_REPORT_ERROR("uncaught exception", msg);
+ SC_REPORT_ERROR(
+ sc_core::SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_, msg);
} catch (...) {
- SC_REPORT_ERROR("uncaught exception", "UNKNOWN EXCEPTION");
+ SC_REPORT_ERROR(
+ sc_core::SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_,
+ "UNKNOWN EXCEPTION");
}
} catch (const ::sc_core::sc_report &r) {
::sc_core::sc_report_handler::set_handler(old_handler);
#include "systemc/ext/channel/sc_in.hh"
#include "systemc/ext/channel/sc_inout.hh"
#include "systemc/ext/channel/sc_out.hh"
+#include "systemc/ext/core/messages.hh"
#include "systemc/ext/core/sc_export.hh"
#include "systemc/ext/core/sc_interface.hh"
#include "systemc/ext/core/sc_port.hh"
if (scheduler.current() == process) {
static bool warned = false;
if (!warned) {
- SC_REPORT_WARNING("(W536) immediate self-notification ignored "
- "as of IEEE 1666-2011", process->name());
+ SC_REPORT_WARNING(sc_core::SC_ID_IMMEDIATE_SELF_NOTIFICATION_,
+ process->name());
warned = true;
}
return false;
#ifndef __SYSTEMC_EXT_CORE__CORE_HH__
#define __SYSTEMC_EXT_CORE__CORE_HH__
+#include "messages.hh"
#include "sc_attr.hh"
#include "sc_event.hh"
#include "sc_export.hh"
using sc_core::sc_get_default_time_unit;
using sc_core::sc_set_default_time_unit;
+using sc_core::SC_ID_NO_BOOL_RETURNED_;
+using sc_core::SC_ID_NO_INT_RETURNED_;
+using sc_core::SC_ID_NO_SC_LOGIC_RETURNED_;
+using sc_core::SC_ID_OPERAND_NOT_SC_LOGIC_;
+using sc_core::SC_ID_OPERAND_NOT_BOOL_;
+using sc_core::SC_ID_INSTANCE_EXISTS_;
+using sc_core::SC_ID_ILLEGAL_CHARACTERS_;
+using sc_core::SC_ID_VC6_PROCESS_HELPER_;
+using sc_core::SC_ID_VC6_MAX_PROCESSES_EXCEEDED_;
+using sc_core::SC_ID_END_MODULE_NOT_CALLED_;
+using sc_core::SC_ID_HIER_NAME_INCORRECT_;
+using sc_core::SC_ID_SET_STACK_SIZE_;
+using sc_core::SC_ID_SC_MODULE_NAME_USE_;
+using sc_core::SC_ID_SC_MODULE_NAME_REQUIRED_;
+using sc_core::SC_ID_SET_TIME_RESOLUTION_;
+using sc_core::SC_ID_SET_DEFAULT_TIME_UNIT_;
+using sc_core::SC_ID_DEFAULT_TIME_UNIT_CHANGED_;
+using sc_core::SC_ID_INCONSISTENT_API_CONFIG_;
+using sc_core::SC_ID_WAIT_NOT_ALLOWED_;
+using sc_core::SC_ID_NEXT_TRIGGER_NOT_ALLOWED_;
+using sc_core::SC_ID_IMMEDIATE_NOTIFICATION_;
+using sc_core::SC_ID_HALT_NOT_ALLOWED_;
+using sc_core::SC_ID_WATCHING_NOT_ALLOWED_;
+using sc_core::SC_ID_DONT_INITIALIZE_;
+using sc_core::SC_ID_WAIT_N_INVALID_;
+using sc_core::SC_ID_MAKE_SENSITIVE_;
+using sc_core::SC_ID_MAKE_SENSITIVE_POS_;
+using sc_core::SC_ID_MAKE_SENSITIVE_NEG_;
+using sc_core::SC_ID_INSERT_MODULE_;
+using sc_core::SC_ID_REMOVE_MODULE_;
+using sc_core::SC_ID_NOTIFY_DELAYED_;
+using sc_core::SC_ID_GEN_UNIQUE_NAME_;
+using sc_core::SC_ID_MODULE_NAME_STACK_EMPTY_;
+using sc_core::SC_ID_NAME_EXISTS_;
+using sc_core::SC_ID_IMMEDIATE_SELF_NOTIFICATION_;
+using sc_core::SC_ID_WAIT_DURING_UNWINDING_;
+using sc_core::SC_ID_CYCLE_MISSES_EVENTS_;
+using sc_core::SC_ID_RETHROW_UNWINDING_;
+using sc_core::SC_ID_PROCESS_ALREADY_UNWINDING_;
+using sc_core::SC_ID_MODULE_METHOD_AFTER_START_;
+using sc_core::SC_ID_MODULE_THREAD_AFTER_START_;
+using sc_core::SC_ID_MODULE_CTHREAD_AFTER_START_;
+using sc_core::SC_ID_SIMULATION_TIME_OVERFLOW_;
+using sc_core::SC_ID_SIMULATION_STOP_CALLED_TWICE_;
+using sc_core::SC_ID_SIMULATION_START_AFTER_STOP_;
+using sc_core::SC_ID_STOP_MODE_AFTER_START_;
+using sc_core::SC_ID_SIMULATION_START_AFTER_ERROR_;
+using sc_core::SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_;
+using sc_core::SC_ID_PHASE_CALLBACKS_UNSUPPORTED_;
+using sc_core::SC_ID_PHASE_CALLBACK_NOT_IMPLEMENTED_;
+using sc_core::SC_ID_PHASE_CALLBACK_REGISTER_;
+using sc_core::SC_ID_PHASE_CALLBACK_FORBIDDEN_;
+using sc_core::SC_ID_SIMULATION_START_UNEXPECTED_;
+using sc_core::SC_ID_THROW_IT_IGNORED_;
+using sc_core::SC_ID_NOT_EXPECTING_DYNAMIC_EVENT_NOTIFY_;
+using sc_core::SC_ID_DISABLE_WILL_ORPHAN_PROCESS_;
+using sc_core::SC_ID_PROCESS_CONTROL_CORNER_CASE_;
+using sc_core::SC_ID_METHOD_TERMINATION_EVENT_;
+using sc_core::SC_ID_JOIN_ON_METHOD_HANDLE_;
+using sc_core::SC_ID_NO_PROCESS_SEMANTICS_;
+using sc_core::SC_ID_EVENT_ON_NULL_PROCESS_;
+using sc_core::SC_ID_EVENT_LIST_FAILED_;
+using sc_core::SC_ID_UNKNOWN_PROCESS_TYPE_;
+using sc_core::SC_ID_TIME_CONVERSION_FAILED_;
+using sc_core::SC_ID_NEGATIVE_SIMULATION_TIME_;
+using sc_core::SC_ID_BAD_SC_MODULE_CONSTRUCTOR_;
+using sc_core::SC_ID_EMPTY_PROCESS_HANDLE_;
+using sc_core::SC_ID_NO_SC_START_ACTIVITY_;
+using sc_core::SC_ID_KILL_PROCESS_WHILE_UNITIALIZED_;
+using sc_core::SC_ID_RESET_PROCESS_WHILE_NOT_RUNNING_;
+using sc_core::SC_ID_THROW_IT_WHILE_NOT_RUNNING_;
+
#endif //__SYSTEMC_EXT_CORE__USING_HH__
--- /dev/null
+/*
+ * Copyright 2018 Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Gabe Black
+ */
+
+#ifndef __SYSTEMC_EXT_CORE_MESSAGES_HH__
+#define __SYSTEMC_EXT_CORE_MESSAGES_HH__
+
+namespace sc_core
+{
+
+extern const char SC_ID_NO_BOOL_RETURNED_[];
+extern const char SC_ID_NO_INT_RETURNED_[];
+extern const char SC_ID_NO_SC_LOGIC_RETURNED_[];
+extern const char SC_ID_OPERAND_NOT_SC_LOGIC_[];
+extern const char SC_ID_OPERAND_NOT_BOOL_[];
+extern const char SC_ID_INSTANCE_EXISTS_[];
+extern const char SC_ID_ILLEGAL_CHARACTERS_[];
+extern const char SC_ID_VC6_PROCESS_HELPER_[];
+extern const char SC_ID_VC6_MAX_PROCESSES_EXCEEDED_[];
+extern const char SC_ID_END_MODULE_NOT_CALLED_[];
+extern const char SC_ID_HIER_NAME_INCORRECT_[];
+extern const char SC_ID_SET_STACK_SIZE_[];
+extern const char SC_ID_SC_MODULE_NAME_USE_[];
+extern const char SC_ID_SC_MODULE_NAME_REQUIRED_[];
+extern const char SC_ID_SET_TIME_RESOLUTION_[];
+extern const char SC_ID_SET_DEFAULT_TIME_UNIT_[];
+extern const char SC_ID_DEFAULT_TIME_UNIT_CHANGED_[];
+extern const char SC_ID_INCONSISTENT_API_CONFIG_[];
+extern const char SC_ID_WAIT_NOT_ALLOWED_[];
+extern const char SC_ID_NEXT_TRIGGER_NOT_ALLOWED_[];
+extern const char SC_ID_IMMEDIATE_NOTIFICATION_[];
+extern const char SC_ID_HALT_NOT_ALLOWED_[];
+extern const char SC_ID_WATCHING_NOT_ALLOWED_[];
+extern const char SC_ID_DONT_INITIALIZE_[];
+extern const char SC_ID_WAIT_N_INVALID_[];
+extern const char SC_ID_MAKE_SENSITIVE_[];
+extern const char SC_ID_MAKE_SENSITIVE_POS_[];
+extern const char SC_ID_MAKE_SENSITIVE_NEG_[];
+extern const char SC_ID_INSERT_MODULE_[];
+extern const char SC_ID_REMOVE_MODULE_[];
+extern const char SC_ID_NOTIFY_DELAYED_[];
+extern const char SC_ID_GEN_UNIQUE_NAME_[];
+extern const char SC_ID_MODULE_NAME_STACK_EMPTY_[];
+extern const char SC_ID_NAME_EXISTS_[];
+extern const char SC_ID_IMMEDIATE_SELF_NOTIFICATION_[];
+extern const char SC_ID_WAIT_DURING_UNWINDING_[];
+extern const char SC_ID_CYCLE_MISSES_EVENTS_[];
+extern const char SC_ID_RETHROW_UNWINDING_[];
+extern const char SC_ID_PROCESS_ALREADY_UNWINDING_[];
+extern const char SC_ID_MODULE_METHOD_AFTER_START_[];
+extern const char SC_ID_MODULE_THREAD_AFTER_START_[];
+extern const char SC_ID_MODULE_CTHREAD_AFTER_START_[];
+extern const char SC_ID_SIMULATION_TIME_OVERFLOW_[];
+extern const char SC_ID_SIMULATION_STOP_CALLED_TWICE_[];
+extern const char SC_ID_SIMULATION_START_AFTER_STOP_[];
+extern const char SC_ID_STOP_MODE_AFTER_START_[];
+extern const char SC_ID_SIMULATION_START_AFTER_ERROR_[];
+extern const char SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_[];
+extern const char SC_ID_PHASE_CALLBACKS_UNSUPPORTED_[];
+extern const char SC_ID_PHASE_CALLBACK_NOT_IMPLEMENTED_[];
+extern const char SC_ID_PHASE_CALLBACK_REGISTER_[];
+extern const char SC_ID_PHASE_CALLBACK_FORBIDDEN_[];
+extern const char SC_ID_SIMULATION_START_UNEXPECTED_[];
+extern const char SC_ID_THROW_IT_IGNORED_[];
+extern const char SC_ID_NOT_EXPECTING_DYNAMIC_EVENT_NOTIFY_[];
+extern const char SC_ID_DISABLE_WILL_ORPHAN_PROCESS_[];
+extern const char SC_ID_PROCESS_CONTROL_CORNER_CASE_[];
+extern const char SC_ID_METHOD_TERMINATION_EVENT_[];
+extern const char SC_ID_JOIN_ON_METHOD_HANDLE_[];
+extern const char SC_ID_NO_PROCESS_SEMANTICS_[];
+extern const char SC_ID_EVENT_ON_NULL_PROCESS_[];
+extern const char SC_ID_EVENT_LIST_FAILED_[];
+extern const char SC_ID_UNKNOWN_PROCESS_TYPE_[];
+extern const char SC_ID_TIME_CONVERSION_FAILED_[];
+extern const char SC_ID_NEGATIVE_SIMULATION_TIME_[];
+extern const char SC_ID_BAD_SC_MODULE_CONSTRUCTOR_[];
+extern const char SC_ID_EMPTY_PROCESS_HANDLE_[];
+extern const char SC_ID_NO_SC_START_ACTIVITY_[];
+extern const char SC_ID_KILL_PROCESS_WHILE_UNITIALIZED_[];
+extern const char SC_ID_RESET_PROCESS_WHILE_NOT_RUNNING_[];
+extern const char SC_ID_THROW_IT_WHILE_NOT_RUNNING_[];
+
+} // namespace sc_core
+
+#endif // __SYSTEMC_EXT_CORE_MESSAGES_HH__
#include <vector>
#include "../utils/sc_report_handler.hh"
+#include "messages.hh"
#include "sc_object.hh"
namespace sc_gem5
SC_NO_DESCENDANTS)
{
if (!_gem5_process) {
- SC_REPORT_WARNING("(W570) attempt to use an empty "
- "process handle ignored", "throw_it()");
+ SC_REPORT_WARNING(SC_ID_EMPTY_PROCESS_HANDLE_, "throw_it()");
return;
}
::sc_gem5::ExceptionWrapper<T> exc(user_defined_exception);
{
SC_CTOR(X)
{
- SC_REPORT_ERROR("set time resolution failed","");
+ SC_REPORT_ERROR(SC_ID_SET_TIME_RESOLUTION_,"");
}
};
int sc_main( int, char*[] )
{
- sc_report_handler::set_actions( "set time resolution failed", SC_DO_NOTHING );
- sc_report_handler::set_actions( "sc_time conversion failed", SC_DISPLAY );
+ sc_report_handler::set_actions( SC_ID_SET_TIME_RESOLUTION_, SC_DO_NOTHING );
+ sc_report_handler::set_actions( SC_ID_TIME_CONVERSION_FAILED_, SC_DISPLAY );
unsigned resolutions[] = { 100, 10, 1 };
sc_time_unit resunit = SC_FS;