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 --- 77 unchanged lines hidden (view full) --- 86// to avoid code bloat in sc_uint_concat<T1,T2> 87 88void 89sc_uint_concref_invalid_length(int length) 90{ 91 std::stringstream msg; 92 msg << "sc_uint_concref<T1,T2> initialization: length = " << length << 93 "violates 1 <= length <= " << SC_INTWIDTH; |
94 SC_REPORT_ERROR("(E5) out of bounds", msg.str().c_str()); |
95 sc_core::sc_abort(); // can't recover from here 96} 97 98 99 100// ---------------------------------------------------------------------------- 101// CLASS : sc_uint_bitref 102// --- 239 unchanged lines hidden (view full) --- 342// support methods 343 344void 345sc_uint_base::invalid_length() const 346{ 347 std::stringstream msg; 348 msg << "sc_uint[_base] initialization: length = " << m_len << 349 " violates 1 <= length <= " << SC_INTWIDTH; |
350 SC_REPORT_ERROR("(E5) out of bounds", msg.str().c_str()); |
351 sc_core::sc_abort(); // can't recover from here} 352} 353 354void 355sc_uint_base::invalid_index(int i) const 356{ 357 std::stringstream msg; 358 msg << "sc_uint[_base] bit selection: index = " << i << 359 " violates 0 <= index <= " << (m_len - 1); |
360 SC_REPORT_ERROR("(E5) out of bounds", msg.str().c_str()); |
361 sc_core::sc_abort(); // can't recover from here 362} 363 364void 365sc_uint_base::invalid_range(int l, int r) const 366{ 367 std::stringstream msg; 368 msg << "sc_uint[_base] part selection: " << 369 "left = " << l << ", right = " << r << " violates " << 370 (m_len - 1) << " >= left >= right >= 0"; |
371 SC_REPORT_ERROR("(E5) out of bounds", msg.str().c_str()); |
372 sc_core::sc_abort(); // can't recover from here 373} 374 375 376void 377sc_uint_base::check_value() const 378{ 379 uint_type limit = (~UINT_ZERO >> m_ulen); 380 if (m_val > limit) { 381 std::stringstream msg; 382 msg << "sc_uint[_base]: value does not fit into a length of " << m_len; |
383 SC_REPORT_WARNING("(E5) out of bounds", msg.str().c_str()); |
384 } 385} 386 387 388// constructors 389sc_uint_base::sc_uint_base(const sc_bv_base &v) : 390 m_val(0), m_len(v.length()), m_ulen(SC_INTWIDTH - m_len) 391{ --- 317 unchanged lines hidden --- |