113324Sgabeblack@google.com/*
213324Sgabeblack@google.com * Copyright 2018 Google, Inc.
313324Sgabeblack@google.com *
413324Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
513324Sgabeblack@google.com * modification, are permitted provided that the following conditions are
613324Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
713324Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
813324Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
913324Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1013324Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1113324Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1213324Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1313324Sgabeblack@google.com * this software without specific prior written permission.
1413324Sgabeblack@google.com *
1513324Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1613324Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1713324Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1813324Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1913324Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2013324Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2113324Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2213324Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2313324Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2413324Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2513324Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2613324Sgabeblack@google.com *
2713324Sgabeblack@google.com * Authors: Gabe Black
2813324Sgabeblack@google.com */
2913324Sgabeblack@google.com
3013324Sgabeblack@google.com#include "systemc/ext/channel/messages.hh"
3113324Sgabeblack@google.com#include "systemc/utils/report.hh"
3213324Sgabeblack@google.com
3313324Sgabeblack@google.comnamespace sc_core
3413324Sgabeblack@google.com{
3513324Sgabeblack@google.com
3613324Sgabeblack@google.comconst char SC_ID_PORT_OUTSIDE_MODULE_[] = "port specified outside of module";
3713324Sgabeblack@google.comconst char SC_ID_CLOCK_PERIOD_ZERO_[] = "sc_clock period is zero";
3813324Sgabeblack@google.comconst char SC_ID_CLOCK_HIGH_TIME_ZERO_[] = "sc_clock high time is zero";
3913324Sgabeblack@google.comconst char SC_ID_CLOCK_LOW_TIME_ZERO_[] = "sc_clock low time is zero";
4013324Sgabeblack@google.comconst char SC_ID_MORE_THAN_ONE_FIFO_READER_[] =
4113324Sgabeblack@google.com    "sc_fifo<T> cannot have more than one reader";
4213324Sgabeblack@google.comconst char SC_ID_MORE_THAN_ONE_FIFO_WRITER_[] =
4313324Sgabeblack@google.com    "sc_fifo<T> cannot have more than one writer";
4413324Sgabeblack@google.comconst char SC_ID_INVALID_FIFO_SIZE_[] =
4513324Sgabeblack@google.com    "sc_fifo<T> must have a size of at least 1";
4613324Sgabeblack@google.comconst char SC_ID_BIND_IF_TO_PORT_[] = "bind interface to port failed";
4713324Sgabeblack@google.comconst char SC_ID_BIND_PORT_TO_PORT_[] = "bind parent port to port failed";
4813324Sgabeblack@google.comconst char SC_ID_COMPLETE_BINDING_[] = "complete binding failed";
4913324Sgabeblack@google.comconst char SC_ID_INSERT_PORT_[] = "insert port failed";
5013324Sgabeblack@google.comconst char SC_ID_REMOVE_PORT_[] = "remove port failed";
5113324Sgabeblack@google.comconst char SC_ID_GET_IF_[] = "get interface failed";
5213324Sgabeblack@google.comconst char SC_ID_INSERT_PRIM_CHANNEL_[] = "insert primitive channel failed";
5313324Sgabeblack@google.comconst char SC_ID_REMOVE_PRIM_CHANNEL_[] = "remove primitive channel failed";
5413324Sgabeblack@google.comconst char SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_[] =
5513324Sgabeblack@google.com    "sc_signal<T> cannot have more than one driver";
5613324Sgabeblack@google.comconst char SC_ID_NO_DEFAULT_EVENT_[] = "channel doesn't have a default event";
5713324Sgabeblack@google.comconst char SC_ID_RESOLVED_PORT_NOT_BOUND_[] =
5813324Sgabeblack@google.com    "resolved port not bound to resolved signal";
5913324Sgabeblack@google.comconst char SC_ID_FIND_EVENT_[] = "find event failed";
6013324Sgabeblack@google.comconst char SC_ID_INVALID_SEMAPHORE_VALUE_[] =
6113324Sgabeblack@google.com    "sc_semaphore requires an initial value >= 0";
6213324Sgabeblack@google.comconst char SC_ID_SC_EXPORT_HAS_NO_INTERFACE_[] =
6313324Sgabeblack@google.com    "sc_export instance has no interface";
6413324Sgabeblack@google.comconst char SC_ID_INSERT_EXPORT_[] = "insert sc_export failed";
6513324Sgabeblack@google.comconst char SC_ID_EXPORT_OUTSIDE_MODULE_[] =
6613324Sgabeblack@google.com    "sc_export specified outside of module";
6713324Sgabeblack@google.comconst char SC_ID_SC_EXPORT_NOT_REGISTERED_[] =
6813324Sgabeblack@google.com    "remove sc_export failed, sc_export not registered";
6913324Sgabeblack@google.comconst char SC_ID_SC_EXPORT_NOT_BOUND_AFTER_CONSTRUCTION_[] =
7013324Sgabeblack@google.com    "sc_export instance not bound to interface at end of construction";
7113324Sgabeblack@google.comconst char SC_ID_ATTEMPT_TO_WRITE_TO_CLOCK_[] =
7213324Sgabeblack@google.com    "attempt to write the value of an sc_clock instance";
7313324Sgabeblack@google.comconst char SC_ID_SC_EXPORT_ALREADY_BOUND_[] =
7413324Sgabeblack@google.com    "sc_export instance already bound";
7513324Sgabeblack@google.comconst char SC_ID_OPERATION_ON_NON_SPECIALIZED_SIGNAL_[] =
7613324Sgabeblack@google.com    "attempted specalized signal operation on non-specialized signal";
7713324Sgabeblack@google.comconst char SC_ID_ATTEMPT_TO_BIND_CLOCK_TO_OUTPUT_[] =
7813324Sgabeblack@google.com    "attempted to bind sc_clock instance to sc_inout or sc_out";
7913324Sgabeblack@google.comconst char SC_ID_NO_ASYNC_UPDATE_[] =
8013324Sgabeblack@google.com    "this build has no asynchronous update support";
8113324Sgabeblack@google.com
8213324Sgabeblack@google.comnamespace
8313324Sgabeblack@google.com{
8413324Sgabeblack@google.com
8513324Sgabeblack@google.comsc_gem5::DefaultReportMessages predefinedMessages{
8613324Sgabeblack@google.com    {100, SC_ID_PORT_OUTSIDE_MODULE_},
8713324Sgabeblack@google.com    {101, SC_ID_CLOCK_PERIOD_ZERO_},
8813324Sgabeblack@google.com    {102, SC_ID_CLOCK_HIGH_TIME_ZERO_},
8913324Sgabeblack@google.com    {103, SC_ID_CLOCK_LOW_TIME_ZERO_},
9013324Sgabeblack@google.com    {104, SC_ID_MORE_THAN_ONE_FIFO_READER_},
9113324Sgabeblack@google.com    {105, SC_ID_MORE_THAN_ONE_FIFO_WRITER_},
9213324Sgabeblack@google.com    {106, SC_ID_INVALID_FIFO_SIZE_},
9313324Sgabeblack@google.com    {107, SC_ID_BIND_IF_TO_PORT_},
9413324Sgabeblack@google.com    {108, SC_ID_BIND_PORT_TO_PORT_},
9513324Sgabeblack@google.com    {109, SC_ID_COMPLETE_BINDING_},
9613324Sgabeblack@google.com    {110, SC_ID_INSERT_PORT_},
9713324Sgabeblack@google.com    {111, SC_ID_REMOVE_PORT_},
9813324Sgabeblack@google.com    {112, SC_ID_GET_IF_},
9913324Sgabeblack@google.com    {113, SC_ID_INSERT_PRIM_CHANNEL_},
10013324Sgabeblack@google.com    {114, SC_ID_REMOVE_PRIM_CHANNEL_},
10113324Sgabeblack@google.com    {115, SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_},
10213324Sgabeblack@google.com    {116, SC_ID_NO_DEFAULT_EVENT_},
10313324Sgabeblack@google.com    {117, SC_ID_RESOLVED_PORT_NOT_BOUND_},
10413324Sgabeblack@google.com    {118, SC_ID_FIND_EVENT_},
10513324Sgabeblack@google.com    {119, SC_ID_INVALID_SEMAPHORE_VALUE_},
10613324Sgabeblack@google.com    {120, SC_ID_SC_EXPORT_HAS_NO_INTERFACE_},
10713324Sgabeblack@google.com    {121, SC_ID_INSERT_EXPORT_},
10813324Sgabeblack@google.com    {122, SC_ID_EXPORT_OUTSIDE_MODULE_},
10913324Sgabeblack@google.com    {123, SC_ID_SC_EXPORT_NOT_REGISTERED_},
11013324Sgabeblack@google.com    {124, SC_ID_SC_EXPORT_NOT_BOUND_AFTER_CONSTRUCTION_},
11113324Sgabeblack@google.com    {125, SC_ID_ATTEMPT_TO_WRITE_TO_CLOCK_},
11213324Sgabeblack@google.com    {126, SC_ID_SC_EXPORT_ALREADY_BOUND_},
11313324Sgabeblack@google.com    {127, SC_ID_OPERATION_ON_NON_SPECIALIZED_SIGNAL_},
11413324Sgabeblack@google.com    {128, SC_ID_ATTEMPT_TO_BIND_CLOCK_TO_OUTPUT_},
11513324Sgabeblack@google.com    {129, SC_ID_NO_ASYNC_UPDATE_}
11613324Sgabeblack@google.com};
11713324Sgabeblack@google.com
11813324Sgabeblack@google.com} // anonymous namespace
11913324Sgabeblack@google.com
12013324Sgabeblack@google.com} // namespace sc_core
121