113317Sgabeblack@google.com/*
213317Sgabeblack@google.com * Copyright 2018 Google, Inc.
313317Sgabeblack@google.com *
413317Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
513317Sgabeblack@google.com * modification, are permitted provided that the following conditions are
613317Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
713317Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
813317Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
913317Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1013317Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1113317Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1213317Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1313317Sgabeblack@google.com * this software without specific prior written permission.
1413317Sgabeblack@google.com *
1513317Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1613317Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1713317Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1813317Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1913317Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2013317Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2113317Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2213317Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2313317Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2413317Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2513317Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2613317Sgabeblack@google.com *
2713317Sgabeblack@google.com * Authors: Gabe Black
2813317Sgabeblack@google.com */
2913317Sgabeblack@google.com
3013317Sgabeblack@google.com#include "systemc/ext/core/messages.hh"
3113317Sgabeblack@google.com#include "systemc/utils/report.hh"
3213317Sgabeblack@google.com
3313317Sgabeblack@google.comnamespace sc_core
3413317Sgabeblack@google.com{
3513317Sgabeblack@google.com
3613317Sgabeblack@google.comconst char SC_ID_NO_BOOL_RETURNED_[] = "operator does not return boolean";
3713317Sgabeblack@google.comconst char SC_ID_NO_INT_RETURNED_[] = "operator does not return int";
3813317Sgabeblack@google.comconst char SC_ID_NO_SC_LOGIC_RETURNED_[] = "operator does not return sc_logic";
3913317Sgabeblack@google.comconst char SC_ID_OPERAND_NOT_SC_LOGIC_[] = "operand is not sc_logic";
4013317Sgabeblack@google.comconst char SC_ID_OPERAND_NOT_BOOL_[] = "operand is not bool";
4113317Sgabeblack@google.comconst char SC_ID_INSTANCE_EXISTS_[] = "object already exists";
4213317Sgabeblack@google.comconst char SC_ID_ILLEGAL_CHARACTERS_[] = "illegal characters";
4313317Sgabeblack@google.comconst char SC_ID_VC6_PROCESS_HELPER_[] =
4413317Sgabeblack@google.com    "internal error: sc_vc6_process_helper";
4513317Sgabeblack@google.comconst char SC_ID_VC6_MAX_PROCESSES_EXCEEDED_[] =
4613317Sgabeblack@google.com    "maximum number of processes per module exceeded (VC6)";
4713317Sgabeblack@google.comconst char SC_ID_END_MODULE_NOT_CALLED_[] =
4813317Sgabeblack@google.com    "module construction not properly completed: did "
4913317Sgabeblack@google.com    "you forget to add a sc_module_name parameter to "
5013317Sgabeblack@google.com    "your module constructor?";
5113317Sgabeblack@google.comconst char SC_ID_HIER_NAME_INCORRECT_[] =
5213317Sgabeblack@google.com    "hierarchical name as shown may be incorrect due to previous errors";
5313317Sgabeblack@google.comconst char SC_ID_SET_STACK_SIZE_[] =
5413317Sgabeblack@google.com    "set_stack_size() is only allowed for SC_THREADs and SC_CTHREADs";
5513317Sgabeblack@google.comconst char SC_ID_SC_MODULE_NAME_USE_[] = "incorrect use of sc_module_name";
5613317Sgabeblack@google.comconst char SC_ID_SC_MODULE_NAME_REQUIRED_[] =
5713317Sgabeblack@google.com    "an sc_module_name parameter for your constructor is required";
5813317Sgabeblack@google.comconst char SC_ID_SET_TIME_RESOLUTION_[] = "set time resolution failed";
5913317Sgabeblack@google.comconst char SC_ID_SET_DEFAULT_TIME_UNIT_[] = "set default time unit failed";
6013317Sgabeblack@google.comconst char SC_ID_DEFAULT_TIME_UNIT_CHANGED_[] =
6113317Sgabeblack@google.com    "default time unit changed to time resolution";
6213317Sgabeblack@google.comconst char SC_ID_INCONSISTENT_API_CONFIG_[] =
6313317Sgabeblack@google.com    "inconsistent library configuration detected";
6413317Sgabeblack@google.comconst char SC_ID_WAIT_NOT_ALLOWED_[] =
6513317Sgabeblack@google.com    "wait() is only allowed in SC_THREADs and SC_CTHREADs";
6613317Sgabeblack@google.comconst char SC_ID_NEXT_TRIGGER_NOT_ALLOWED_[] =
6713317Sgabeblack@google.com    "next_trigger() is only allowed in SC_METHODs";
6813317Sgabeblack@google.comconst char SC_ID_IMMEDIATE_NOTIFICATION_[] =
6913317Sgabeblack@google.com    "immediate notification is not allowed during update phase or elaboration";
7013317Sgabeblack@google.comconst char SC_ID_HALT_NOT_ALLOWED_[] = "halt() is only allowed in SC_CTHREADs";
7113317Sgabeblack@google.comconst char SC_ID_WATCHING_NOT_ALLOWED_[] =
7213317Sgabeblack@google.com    "watching() has been deprecated, use reset_signal_is()";
7313317Sgabeblack@google.comconst char SC_ID_DONT_INITIALIZE_[] =
7413317Sgabeblack@google.com    "dont_initialize() has no effect for SC_CTHREADs";
7513317Sgabeblack@google.comconst char SC_ID_WAIT_N_INVALID_[] = "wait(n) is only valid for n > 0";
7613317Sgabeblack@google.comconst char SC_ID_MAKE_SENSITIVE_[] = "make sensitive failed";
7713317Sgabeblack@google.comconst char SC_ID_MAKE_SENSITIVE_POS_[] = "make sensitive pos failed";
7813317Sgabeblack@google.comconst char SC_ID_MAKE_SENSITIVE_NEG_[] = "make sensitive neg failed";
7913317Sgabeblack@google.comconst char SC_ID_INSERT_MODULE_[] = "insert module failed";
8013317Sgabeblack@google.comconst char SC_ID_REMOVE_MODULE_[] = "remove module failed";
8113317Sgabeblack@google.comconst char SC_ID_NOTIFY_DELAYED_[] =
8213317Sgabeblack@google.com    "notify_delayed() cannot be called on events "
8313317Sgabeblack@google.com    "that have pending notifications";
8413317Sgabeblack@google.comconst char SC_ID_GEN_UNIQUE_NAME_[] =
8513317Sgabeblack@google.com    "cannot generate unique name from null string";
8613317Sgabeblack@google.comconst char SC_ID_MODULE_NAME_STACK_EMPTY_[] =
8713317Sgabeblack@google.com    "module name stack is empty: did you forget to "
8813317Sgabeblack@google.com    "add a sc_module_name parameter to your module "
8913317Sgabeblack@google.com    "constructor?";
9013317Sgabeblack@google.comconst char SC_ID_NAME_EXISTS_[] = "name already exists";
9113317Sgabeblack@google.comconst char SC_ID_IMMEDIATE_SELF_NOTIFICATION_[] =
9213317Sgabeblack@google.com    "immediate self-notification ignored as of IEEE 1666-2011";
9313317Sgabeblack@google.comconst char SC_ID_WAIT_DURING_UNWINDING_[] =
9413317Sgabeblack@google.com    "wait() not allowed during unwinding";
9513317Sgabeblack@google.comconst char SC_ID_CYCLE_MISSES_EVENTS_[] =
9613317Sgabeblack@google.com    "the simulation contains timed-events but they are "
9713317Sgabeblack@google.com    "ignored by sc_cycle() ==> the simulation will be "
9813317Sgabeblack@google.com    "incorrect";
9913317Sgabeblack@google.comconst char SC_ID_RETHROW_UNWINDING_[] =
10013317Sgabeblack@google.com    "sc_unwind_exception not re-thrown during kill/reset";
10113317Sgabeblack@google.comconst char SC_ID_PROCESS_ALREADY_UNWINDING_[] =
10213317Sgabeblack@google.com    "kill/reset ignored during unwinding";
10313317Sgabeblack@google.comconst char SC_ID_MODULE_METHOD_AFTER_START_[] =
10413317Sgabeblack@google.com    "call to SC_METHOD in sc_module while simulation running";
10513317Sgabeblack@google.comconst char SC_ID_MODULE_THREAD_AFTER_START_[] =
10613317Sgabeblack@google.com    "call to SC_THREAD in sc_module while simulation running";
10713317Sgabeblack@google.comconst char SC_ID_MODULE_CTHREAD_AFTER_START_[] =
10813317Sgabeblack@google.com    "call to SC_CTHREAD in sc_module while simulation running";
10913317Sgabeblack@google.comconst char SC_ID_SIMULATION_TIME_OVERFLOW_[] =
11013317Sgabeblack@google.com    "simulation time value overflow, simulation aborted";
11113317Sgabeblack@google.comconst char SC_ID_SIMULATION_STOP_CALLED_TWICE_[] =
11213317Sgabeblack@google.com    "sc_stop has already been called";
11313317Sgabeblack@google.comconst char SC_ID_SIMULATION_START_AFTER_STOP_[] =
11413317Sgabeblack@google.com    "sc_start called after sc_stop has been called";
11513317Sgabeblack@google.comconst char SC_ID_STOP_MODE_AFTER_START_[] =
11613317Sgabeblack@google.com    "attempt to set sc_stop mode  after start will be ignored";
11713317Sgabeblack@google.comconst char SC_ID_SIMULATION_START_AFTER_ERROR_[] =
11813317Sgabeblack@google.com    "attempt to restart simulation after error";
11913317Sgabeblack@google.comconst char SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_[] = "uncaught exception";
12013317Sgabeblack@google.comconst char SC_ID_PHASE_CALLBACKS_UNSUPPORTED_[] =
12113317Sgabeblack@google.com    "simulation phase callbacks not enabled";
12213317Sgabeblack@google.comconst char SC_ID_PHASE_CALLBACK_NOT_IMPLEMENTED_[] =
12313317Sgabeblack@google.com    "empty simulation phase callback called";
12413317Sgabeblack@google.comconst char SC_ID_PHASE_CALLBACK_REGISTER_[] =
12513317Sgabeblack@google.com    "register simulation phase callback";
12613317Sgabeblack@google.comconst char SC_ID_PHASE_CALLBACK_FORBIDDEN_[] =
12713317Sgabeblack@google.com    "forbidden action in simulation phase callback";
12813317Sgabeblack@google.comconst char SC_ID_SIMULATION_START_UNEXPECTED_[] =
12913317Sgabeblack@google.com    "sc_start called unexpectedly";
13013317Sgabeblack@google.comconst char SC_ID_THROW_IT_IGNORED_[] =
13113317Sgabeblack@google.com    "throw_it on method/non-running process is being ignored ";
13213317Sgabeblack@google.comconst char SC_ID_NOT_EXPECTING_DYNAMIC_EVENT_NOTIFY_[] =
13313317Sgabeblack@google.com    "dynamic event notification encountered when sensitivity is static";
13413317Sgabeblack@google.comconst char SC_ID_DISABLE_WILL_ORPHAN_PROCESS_[] =
13513317Sgabeblack@google.com    "disable() or dont_initialize() called on process with no static "
13613317Sgabeblack@google.com    "sensitivity, it will be orphaned";
13713317Sgabeblack@google.comconst char SC_ID_PROCESS_CONTROL_CORNER_CASE_[] =
13813317Sgabeblack@google.com    "Undefined process control interaction";
13913317Sgabeblack@google.comconst char SC_ID_METHOD_TERMINATION_EVENT_[] =
14013317Sgabeblack@google.com    "Attempt to get terminated event for a method process";
14113317Sgabeblack@google.comconst char SC_ID_JOIN_ON_METHOD_HANDLE_[] =
14213317Sgabeblack@google.com    "Attempt to register method process with sc_join object";
14313317Sgabeblack@google.comconst char SC_ID_NO_PROCESS_SEMANTICS_[] =
14413317Sgabeblack@google.com    "Attempt to invoke process with no semantics() method";
14513317Sgabeblack@google.comconst char SC_ID_EVENT_ON_NULL_PROCESS_[] =
14613317Sgabeblack@google.com    "Attempt to get an event for non-existent process";
14713317Sgabeblack@google.comconst char SC_ID_EVENT_LIST_FAILED_[] =
14813317Sgabeblack@google.com    "invalid use of sc_(and|or)_event list";
14913317Sgabeblack@google.comconst char SC_ID_UNKNOWN_PROCESS_TYPE_[] = "Unknown process type";
15013317Sgabeblack@google.comconst char SC_ID_TIME_CONVERSION_FAILED_[] = "sc_time conversion failed";
15113317Sgabeblack@google.comconst char SC_ID_NEGATIVE_SIMULATION_TIME_[] =
15213317Sgabeblack@google.com    "negative simulation interval specified in sc_start call";
15313317Sgabeblack@google.comconst char SC_ID_BAD_SC_MODULE_CONSTRUCTOR_[] =
15413317Sgabeblack@google.com    "sc_module(const char*), sc_module(const std::string&) "
15513317Sgabeblack@google.com    "have been deprecated, use sc_module(const sc_module_name&)";
15613317Sgabeblack@google.comconst char SC_ID_EMPTY_PROCESS_HANDLE_[] =
15713317Sgabeblack@google.com    "attempt to use an empty process handle ignored";
15813317Sgabeblack@google.comconst char SC_ID_NO_SC_START_ACTIVITY_[] =
15913317Sgabeblack@google.com    "no activity or clock movement for sc_start() invocation";
16013317Sgabeblack@google.comconst char SC_ID_KILL_PROCESS_WHILE_UNITIALIZED_[] =
16113317Sgabeblack@google.com    "a process may not be killed before it is initialized";
16213317Sgabeblack@google.comconst char SC_ID_RESET_PROCESS_WHILE_NOT_RUNNING_[] =
16313317Sgabeblack@google.com    "a process may not be asynchronously reset while the "
16413317Sgabeblack@google.com    "simulation is not running";
16513317Sgabeblack@google.comconst char SC_ID_THROW_IT_WHILE_NOT_RUNNING_[] =
16613317Sgabeblack@google.com    "throw_it not allowed unless simulation is running ";
16713317Sgabeblack@google.com
16813317Sgabeblack@google.comnamespace {
16913317Sgabeblack@google.com
17013317Sgabeblack@google.comsc_gem5::DefaultReportMessages predfinedMessages{
17113317Sgabeblack@google.com    {500, SC_ID_NO_BOOL_RETURNED_},
17213317Sgabeblack@google.com    {501, SC_ID_NO_INT_RETURNED_},
17313317Sgabeblack@google.com    {502, SC_ID_NO_SC_LOGIC_RETURNED_},
17413317Sgabeblack@google.com    {503, SC_ID_OPERAND_NOT_SC_LOGIC_},
17513317Sgabeblack@google.com    {504, SC_ID_OPERAND_NOT_BOOL_},
17613317Sgabeblack@google.com    {505, SC_ID_INSTANCE_EXISTS_},
17713317Sgabeblack@google.com    {506, SC_ID_ILLEGAL_CHARACTERS_},
17813317Sgabeblack@google.com    {507, SC_ID_VC6_PROCESS_HELPER_},
17913317Sgabeblack@google.com    {508, SC_ID_VC6_MAX_PROCESSES_EXCEEDED_},
18013317Sgabeblack@google.com    {509, SC_ID_END_MODULE_NOT_CALLED_},
18113317Sgabeblack@google.com    {510, SC_ID_HIER_NAME_INCORRECT_},
18213317Sgabeblack@google.com    {511, SC_ID_SET_STACK_SIZE_},
18313317Sgabeblack@google.com    {512, SC_ID_SC_MODULE_NAME_USE_},
18413317Sgabeblack@google.com    {513, SC_ID_SC_MODULE_NAME_REQUIRED_},
18513317Sgabeblack@google.com    {514, SC_ID_SET_TIME_RESOLUTION_},
18613317Sgabeblack@google.com    {515, SC_ID_SET_DEFAULT_TIME_UNIT_},
18713317Sgabeblack@google.com    {516, SC_ID_DEFAULT_TIME_UNIT_CHANGED_},
18813317Sgabeblack@google.com    {517, SC_ID_INCONSISTENT_API_CONFIG_},
18913317Sgabeblack@google.com    {519, SC_ID_WAIT_NOT_ALLOWED_},
19013317Sgabeblack@google.com    {520, SC_ID_NEXT_TRIGGER_NOT_ALLOWED_},
19113317Sgabeblack@google.com    {521, SC_ID_IMMEDIATE_NOTIFICATION_},
19213317Sgabeblack@google.com    {522, SC_ID_HALT_NOT_ALLOWED_},
19313317Sgabeblack@google.com    {523, SC_ID_WATCHING_NOT_ALLOWED_},
19413317Sgabeblack@google.com    {524, SC_ID_DONT_INITIALIZE_},
19513317Sgabeblack@google.com    {525, SC_ID_WAIT_N_INVALID_},
19613317Sgabeblack@google.com    {526, SC_ID_MAKE_SENSITIVE_},
19713317Sgabeblack@google.com    {527, SC_ID_MAKE_SENSITIVE_POS_},
19813317Sgabeblack@google.com    {528, SC_ID_MAKE_SENSITIVE_NEG_},
19913317Sgabeblack@google.com    {529, SC_ID_INSERT_MODULE_},
20013317Sgabeblack@google.com    {530, SC_ID_REMOVE_MODULE_},
20113317Sgabeblack@google.com    {531, SC_ID_NOTIFY_DELAYED_},
20213317Sgabeblack@google.com    {532, SC_ID_GEN_UNIQUE_NAME_},
20313317Sgabeblack@google.com    {533, SC_ID_MODULE_NAME_STACK_EMPTY_},
20413317Sgabeblack@google.com    {534, SC_ID_NAME_EXISTS_},
20513317Sgabeblack@google.com    {536, SC_ID_IMMEDIATE_SELF_NOTIFICATION_},
20613317Sgabeblack@google.com    {537, SC_ID_WAIT_DURING_UNWINDING_},
20713317Sgabeblack@google.com    {538, SC_ID_CYCLE_MISSES_EVENTS_},
20813317Sgabeblack@google.com    {539, SC_ID_RETHROW_UNWINDING_},
20913317Sgabeblack@google.com    {540, SC_ID_PROCESS_ALREADY_UNWINDING_},
21013317Sgabeblack@google.com    {541, SC_ID_MODULE_METHOD_AFTER_START_},
21113317Sgabeblack@google.com    {542, SC_ID_MODULE_THREAD_AFTER_START_},
21213317Sgabeblack@google.com    {543, SC_ID_MODULE_CTHREAD_AFTER_START_},
21313317Sgabeblack@google.com    {544, SC_ID_SIMULATION_TIME_OVERFLOW_},
21413317Sgabeblack@google.com    {545, SC_ID_SIMULATION_STOP_CALLED_TWICE_},
21513317Sgabeblack@google.com    {546, SC_ID_SIMULATION_START_AFTER_STOP_},
21613317Sgabeblack@google.com    {547, SC_ID_STOP_MODE_AFTER_START_},
21713317Sgabeblack@google.com    {548, SC_ID_SIMULATION_START_AFTER_ERROR_},
21813317Sgabeblack@google.com    {549, SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_},
21913317Sgabeblack@google.com    {550, SC_ID_PHASE_CALLBACKS_UNSUPPORTED_},
22013317Sgabeblack@google.com    {551, SC_ID_PHASE_CALLBACK_NOT_IMPLEMENTED_},
22113317Sgabeblack@google.com    {552, SC_ID_PHASE_CALLBACK_REGISTER_},
22213317Sgabeblack@google.com    {553, SC_ID_PHASE_CALLBACK_FORBIDDEN_},
22313317Sgabeblack@google.com    {554, SC_ID_SIMULATION_START_UNEXPECTED_},
22413317Sgabeblack@google.com    {556, SC_ID_THROW_IT_IGNORED_},
22513317Sgabeblack@google.com    {557, SC_ID_NOT_EXPECTING_DYNAMIC_EVENT_NOTIFY_},
22613317Sgabeblack@google.com    {558, SC_ID_DISABLE_WILL_ORPHAN_PROCESS_},
22713317Sgabeblack@google.com    {559, SC_ID_PROCESS_CONTROL_CORNER_CASE_},
22813317Sgabeblack@google.com    {560, SC_ID_METHOD_TERMINATION_EVENT_},
22913317Sgabeblack@google.com    {561, SC_ID_JOIN_ON_METHOD_HANDLE_},
23013317Sgabeblack@google.com    {563, SC_ID_NO_PROCESS_SEMANTICS_},
23113317Sgabeblack@google.com    {564, SC_ID_EVENT_ON_NULL_PROCESS_},
23213317Sgabeblack@google.com    {565, SC_ID_EVENT_LIST_FAILED_},
23313317Sgabeblack@google.com    {566, SC_ID_UNKNOWN_PROCESS_TYPE_},
23413317Sgabeblack@google.com    {567, SC_ID_TIME_CONVERSION_FAILED_},
23513317Sgabeblack@google.com    {568, SC_ID_NEGATIVE_SIMULATION_TIME_},
23613317Sgabeblack@google.com    {569, SC_ID_BAD_SC_MODULE_CONSTRUCTOR_},
23713317Sgabeblack@google.com    {570, SC_ID_EMPTY_PROCESS_HANDLE_},
23813317Sgabeblack@google.com    {571, SC_ID_NO_SC_START_ACTIVITY_},
23913317Sgabeblack@google.com    {572, SC_ID_KILL_PROCESS_WHILE_UNITIALIZED_},
24013317Sgabeblack@google.com    {573, SC_ID_RESET_PROCESS_WHILE_NOT_RUNNING_},
24113317Sgabeblack@google.com    {574, SC_ID_THROW_IT_WHILE_NOT_RUNNING_}
24213317Sgabeblack@google.com};
24313317Sgabeblack@google.com
24413317Sgabeblack@google.com} // anonymous namespace
24513317Sgabeblack@google.com
24613317Sgabeblack@google.com} // namespace sc_core
247