From c9f83ec94ba1d7de0cfc46a9a23af2f9e04450e8 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 8 Oct 2018 19:01:38 -0700 Subject: systemc: Switch to using predefined messages for datatypes. Create and use predefined messages for datatypes which match the ones Accellera uses. Change-Id: I92dd52f62462b864264217bb81f3ff1dcec020bf Reviewed-on: https://gem5-review.googlesource.com/c/13331 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/dt/int/sc_unsigned.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/systemc/dt/int/sc_unsigned.cc') diff --git a/src/systemc/dt/int/sc_unsigned.cc b/src/systemc/dt/int/sc_unsigned.cc index b358c5cd3..63e9f366b 100644 --- a/src/systemc/dt/int/sc_unsigned.cc +++ b/src/systemc/dt/int/sc_unsigned.cc @@ -84,6 +84,7 @@ #include "systemc/ext/dt/bit/sc_lv_base.hh" #include "systemc/ext/dt/fx/sc_ufix.hh" #include "systemc/ext/dt/fx/scfx_other_defs.hh" +#include "systemc/ext/dt/int/messages.hh" #include "systemc/ext/dt/int/sc_int_base.hh" #include "systemc/ext/dt/int/sc_signed.hh" #include "systemc/ext/dt/int/sc_uint_base.hh" @@ -118,7 +119,7 @@ sc_unsigned::invalid_init(const char *type_name, int nb) const { std::stringstream msg; msg << "sc_unsigned("<< type_name << ") : nb = " << nb << " is not valid"; - SC_REPORT_ERROR("initialization failed", msg.str().c_str()); + SC_REPORT_ERROR(sc_core::SC_ID_INIT_FAILED_, msg.str().c_str()); } @@ -438,10 +439,10 @@ const sc_unsigned & sc_unsigned::operator = (const char *a) { if (a == 0) { - SC_REPORT_ERROR("conversion failed", + SC_REPORT_ERROR(sc_core::SC_ID_CONVERSION_FAILED_, "character string is zero"); } else if (*a == 0) { - SC_REPORT_ERROR("conversion failed", + SC_REPORT_ERROR(sc_core::SC_ID_CONVERSION_FAILED_, "character string is empty"); } else try { int len = length(); @@ -450,7 +451,7 @@ sc_unsigned::operator = (const char *a) } catch(const sc_core::sc_report &) { std::stringstream msg; msg << "character string '" << a << "' is not valid"; - SC_REPORT_ERROR("conversion failed", msg.str().c_str()); + SC_REPORT_ERROR(sc_core::SC_ID_CONVERSION_FAILED_, msg.str().c_str()); } return *this; } -- cgit v1.2.3