1/***************************************************************************** 2 3 Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 4 more contributor license agreements. See the NOTICE file distributed 5 with this work for additional information regarding copyright ownership. 6 Accellera licenses this file to you under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with the 8 License. You may obtain a copy of the License at --- 70 unchanged lines hidden (view full) --- 79#include <cctype> 80#include <cmath> 81#include <sstream> 82 83#include "systemc/ext/dt/bit/sc_bv_base.hh" 84#include "systemc/ext/dt/bit/sc_lv_base.hh" 85#include "systemc/ext/dt/fx/sc_ufix.hh" 86#include "systemc/ext/dt/fx/scfx_other_defs.hh" |
87#include "systemc/ext/dt/int/messages.hh" |
88#include "systemc/ext/dt/int/sc_int_base.hh" 89#include "systemc/ext/dt/int/sc_signed.hh" 90#include "systemc/ext/dt/int/sc_uint_base.hh" 91#include "systemc/ext/dt/int/sc_unsigned.hh" 92#include "systemc/ext/dt/misc/sc_concatref.hh" 93#include "systemc/ext/utils/messages.hh" 94 95// explicit template instantiations --- 18 unchanged lines hidden (view full) --- 114sc_core::sc_vpool<sc_unsigned_subref> sc_unsigned_subref::m_pool(9); 115 116 117void 118sc_unsigned::invalid_init(const char *type_name, int nb) const 119{ 120 std::stringstream msg; 121 msg << "sc_unsigned("<< type_name << ") : nb = " << nb << " is not valid"; |
122 SC_REPORT_ERROR(sc_core::SC_ID_INIT_FAILED_, msg.str().c_str()); |
123} 124 125 126// ---------------------------------------------------------------------------- 127// SECTION: Public members - Invalid selections. 128// ---------------------------------------------------------------------------- 129 130void --- 303 unchanged lines hidden (view full) --- 434// SECTION: Public members - Assignment operators. 435// ---------------------------------------------------------------------------- 436 437// assignment operators 438const sc_unsigned & 439sc_unsigned::operator = (const char *a) 440{ 441 if (a == 0) { |
442 SC_REPORT_ERROR(sc_core::SC_ID_CONVERSION_FAILED_, |
443 "character string is zero"); 444 } else if (*a == 0) { |
445 SC_REPORT_ERROR(sc_core::SC_ID_CONVERSION_FAILED_, |
446 "character string is empty"); 447 } else try { 448 int len = length(); 449 sc_ufix aa(a, len, len, SC_TRN, SC_WRAP, 0, SC_ON); 450 return this->operator = (aa); 451 } catch(const sc_core::sc_report &) { 452 std::stringstream msg; 453 msg << "character string '" << a << "' is not valid"; |
454 SC_REPORT_ERROR(sc_core::SC_ID_CONVERSION_FAILED_, msg.str().c_str()); |
455 } 456 return *this; 457} 458 459const sc_unsigned & 460sc_unsigned::operator = (int64 v) 461{ 462 sgn = get_sign(v); --- 1799 unchanged lines hidden --- |