summaryrefslogtreecommitdiff
path: root/src/systemc/ext/dt/int
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/ext/dt/int')
-rw-r--r--src/systemc/ext/dt/int/_int.hh1
-rw-r--r--src/systemc/ext/dt/int/_using.hh5
-rw-r--r--src/systemc/ext/dt/int/messages.hh43
-rw-r--r--src/systemc/ext/dt/int/sc_nbutils.hh6
4 files changed, 53 insertions, 2 deletions
diff --git a/src/systemc/ext/dt/int/_int.hh b/src/systemc/ext/dt/int/_int.hh
index dfbcf6ebd..ad08a2408 100644
--- a/src/systemc/ext/dt/int/_int.hh
+++ b/src/systemc/ext/dt/int/_int.hh
@@ -30,6 +30,7 @@
#ifndef __SYSTEMC_EXT_CORE_DT_INT__INT_HH__
#define __SYSTEMC_EXT_CORE_DT_INT__INT_HH__
+#include "messages.hh"
#include "sc_bigint.hh"
#include "sc_biguint.hh"
#include "sc_int.hh"
diff --git a/src/systemc/ext/dt/int/_using.hh b/src/systemc/ext/dt/int/_using.hh
index 82f64dd25..27840e82e 100644
--- a/src/systemc/ext/dt/int/_using.hh
+++ b/src/systemc/ext/dt/int/_using.hh
@@ -61,4 +61,9 @@ using sc_dt::sc_uint_base;
using sc_dt::sc_unsigned;
using sc_dt::uint64;
+using sc_core::SC_ID_INIT_FAILED_;
+using sc_core::SC_ID_ASSIGNMENT_FAILED_;
+using sc_core::SC_ID_OPERATION_FAILED_;
+using sc_core::SC_ID_CONVERSION_FAILED_;
+
#endif //__SYSTEMC_EXT_DT_INT__USING_HH__
diff --git a/src/systemc/ext/dt/int/messages.hh b/src/systemc/ext/dt/int/messages.hh
new file mode 100644
index 000000000..85537ab8a
--- /dev/null
+++ b/src/systemc/ext/dt/int/messages.hh
@@ -0,0 +1,43 @@
+/*
+ * 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_DT_INT_MESSAGES_HH__
+#define __SYSTEMC_EXT_DT_INT_MESSAGES_HH__
+
+namespace sc_core
+{
+
+extern const char SC_ID_INIT_FAILED_[];
+extern const char SC_ID_ASSIGNMENT_FAILED_[];
+extern const char SC_ID_OPERATION_FAILED_[];
+extern const char SC_ID_CONVERSION_FAILED_[];
+
+};
+
+#endif // __SYSTEMC_EXT_DT_INT_MESSAGES_HH__
diff --git a/src/systemc/ext/dt/int/sc_nbutils.hh b/src/systemc/ext/dt/int/sc_nbutils.hh
index 0d3a15cc6..3d7259503 100644
--- a/src/systemc/ext/dt/int/sc_nbutils.hh
+++ b/src/systemc/ext/dt/int/sc_nbutils.hh
@@ -69,6 +69,8 @@
#include <ostream>
#include "../../utils/sc_report_handler.hh"
+#include "../bit/messages.hh"
+#include "messages.hh"
#include "sc_nbdefs.hh"
namespace sc_dt
@@ -520,7 +522,7 @@ inline void
div_by_zero(Type s)
{
if (s == 0) {
- SC_REPORT_ERROR("operation failed",
+ SC_REPORT_ERROR(sc_core::SC_ID_OPERATION_FAILED_,
"div_by_zero<Type>(Type) : division by zero");
sc_core::sc_abort(); // can't recover from here
}
@@ -822,7 +824,7 @@ is_bad_double(double v)
{
// Windows throws exception.
if (is_nan(v) || is_inf(v))
- SC_REPORT_ERROR("(E204) value is not valid",
+ SC_REPORT_ERROR(sc_core::SC_ID_VALUE_NOT_VALID_,
"is_bad_double(double v) : "
"v is not finite - NaN or Inf");
}