summaryrefslogtreecommitdiff
path: root/src/systemc/ext/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/ext/core')
-rw-r--r--src/systemc/ext/core/sc_event.hh3
-rw-r--r--src/systemc/ext/core/sc_export.hh21
-rw-r--r--src/systemc/ext/core/sc_port.hh13
3 files changed, 17 insertions, 20 deletions
diff --git a/src/systemc/ext/core/sc_event.hh b/src/systemc/ext/core/sc_event.hh
index 90fd41f2a..56ee24f76 100644
--- a/src/systemc/ext/core/sc_event.hh
+++ b/src/systemc/ext/core/sc_event.hh
@@ -35,6 +35,7 @@
#include <sstream>
#include <vector>
+#include "../channel/messages.hh"
#include "../utils/sc_report_handler.hh"
#include "sc_port.hh"
#include "sc_time.hh"
@@ -247,7 +248,7 @@ class sc_event_finder_t : public sc_event_finder
std::ostringstream ss;
ss << "port is not bound: port '" << _port->name() << "' (" <<
_port->kind() << ")";
- SC_REPORT_ERROR("(E118) find event failed", ss.str().c_str());
+ SC_REPORT_ERROR(SC_ID_FIND_EVENT_, ss.str().c_str());
return none;
}
return (const_cast<IF *>(iface)->*_method)();
diff --git a/src/systemc/ext/core/sc_export.hh b/src/systemc/ext/core/sc_export.hh
index e36e34ae9..100ce66db 100644
--- a/src/systemc/ext/core/sc_export.hh
+++ b/src/systemc/ext/core/sc_export.hh
@@ -30,6 +30,7 @@
#ifndef __SYSTEMC_EXT_CORE_SC_EXPORT_HH__
#define __SYSTEMC_EXT_CORE_SC_EXPORT_HH__
+#include "../channel/messages.hh"
#include "../utils/sc_report_handler.hh"
#include "sc_module.hh" // for sc_gen_unique_name
#include "sc_object.hh"
@@ -76,17 +77,15 @@ class sc_export : public sc_export_base
bind(IF &i)
{
if (interface) {
- SC_REPORT_ERROR("(E126) sc_export instance already bound", name());
+ SC_REPORT_ERROR(SC_ID_SC_EXPORT_ALREADY_BOUND_, name());
return;
}
interface = &i;
}
operator IF & ()
{
- if (!interface) {
- SC_REPORT_ERROR("(E120) sc_export instance has no interface",
- name());
- }
+ if (!interface)
+ SC_REPORT_ERROR(SC_ID_SC_EXPORT_HAS_NO_INTERFACE_, name());
return *interface;
}
operator const IF & () const { return *interface; }
@@ -94,19 +93,15 @@ class sc_export : public sc_export_base
IF *
operator -> ()
{
- if (!interface) {
- SC_REPORT_ERROR("(E120) sc_export instance has no interface",
- name());
- }
+ if (!interface)
+ SC_REPORT_ERROR(SC_ID_SC_EXPORT_HAS_NO_INTERFACE_, name());
return interface;
}
const IF *
operator -> () const
{
- if (!interface) {
- SC_REPORT_ERROR("(E120) sc_export instance has no interface",
- name());
- }
+ if (!interface)
+ SC_REPORT_ERROR(SC_ID_SC_EXPORT_HAS_NO_INTERFACE_, name());
return interface;
}
diff --git a/src/systemc/ext/core/sc_port.hh b/src/systemc/ext/core/sc_port.hh
index aa9a322b8..c4160bafe 100644
--- a/src/systemc/ext/core/sc_port.hh
+++ b/src/systemc/ext/core/sc_port.hh
@@ -33,6 +33,7 @@
#include <typeinfo>
#include <vector>
+#include "../channel/messages.hh"
#include "../utils/sc_report_handler.hh"
#include "sc_module.hh" // for sc_gen_unique_name
#include "sc_object.hh"
@@ -129,7 +130,7 @@ class sc_port_b : public sc_port_base
operator -> ()
{
if (_interfaces.empty()) {
- report_error("(E112) get interface failed", "port is not bound");
+ report_error(SC_ID_GET_IF_, "port is not bound");
sc_abort();
}
return _interfaces[0];
@@ -138,7 +139,7 @@ class sc_port_b : public sc_port_base
operator -> () const
{
if (_interfaces.empty()) {
- report_error("(E112) get interface failed", "port is not bound");
+ report_error(SC_ID_GET_IF_, "port is not bound");
sc_abort();
}
return _interfaces[0];
@@ -148,7 +149,7 @@ class sc_port_b : public sc_port_base
operator [] (int n)
{
if (n < 0 || n >= size()) {
- report_error("(E112) get interface failed", "index out of range");
+ report_error(SC_ID_GET_IF_, "index out of range");
return NULL;
}
return _interfaces[n];
@@ -157,7 +158,7 @@ class sc_port_b : public sc_port_base
operator [] (int n) const
{
if (n < 0 || n >= size()) {
- report_error("(E112) get interface failed", "index out of range");
+ report_error(SC_ID_GET_IF_, "index out of range");
return NULL;
}
return _interfaces[n];
@@ -219,7 +220,7 @@ class sc_port_b : public sc_port_base
_gem5Interface(int n) const
{
if (n < 0 || n >= size()) {
- report_error("(E112) get interface failed", "index out of range");
+ report_error(SC_ID_GET_IF_, "index out of range");
return NULL;
}
return _interfaces[n];
@@ -231,7 +232,7 @@ class sc_port_b : public sc_port_base
sc_assert(interface);
for (int i = 0; i < _interfaces.size(); i++) {
if (interface == _interfaces[i]) {
- report_error("(E107) bind interface to port failed",
+ report_error(SC_ID_BIND_IF_TO_PORT_,
"interface already bound to port");
}
}