Go to the documentation of this file.
88 for (
int i = 0;
i < sz; ++
i) {
99 int s_len =
s.length() - 1;
102 for (;
i < min_len; ++
i) {
103 char c =
s[s_len -
i - 1];
104 if (
c !=
'0' &&
c !=
'1') {
106 "string can contain only '0' and '1' characters");
115 for (;
i <
len; ++
i) {
124 init(
s.length() - 1);
129 m_len(0), m_size(0), m_data(0)
136 sc_proxy<sc_bv_base>(), m_len(
a.m_len), m_size(
a.m_size),
141 for (
int i = 0;
i < sz; ++
i) {
166 "character string is zero");
167 return std::string();
171 "character string is empty");
172 return std::string();
177 if (
s[0] ==
'-' ||
s[0] ==
'+') {
180 if (
n > (
i + 2) &&
s[
i] ==
'0') {
181 if (
s[
i + 1] ==
'b' ||
s[
i + 1] ==
'B') {
182 if (
s[
i + 2] ==
'0' ||
s[
i + 2] ==
'1') {
183 std::string str(&
s[2]);
188 if (
s[
i + 1] ==
'b' ||
s[
i + 1] ==
'B' ||
189 s[
i + 1] ==
'c' ||
s[
i + 1] ==
'C' ||
190 s[
i + 1] ==
'd' ||
s[
i + 1] ==
'D' ||
191 s[
i + 1] ==
'o' ||
s[
i + 1] ==
'O' ||
192 s[
i + 1] ==
'x' ||
s[
i + 1] ==
'X') {
196 std::string str =
a.to_bin();
199 const char *
p = str.c_str() + 2;
200 while (
p[1] &&
p[0] ==
p[1]) {
203 return std::string(
p);
205 std::stringstream msg;
206 msg <<
"character string '" <<
s <<
"' is not valid";
209 return std::string();
225 std::string str(
"0bus");
229 return a.to_string(numrep, w_prefix);
const char SC_ID_CANNOT_CONVERT_[]
const sc_digit SC_DIGIT_ZERO
const char SC_ID_ZERO_LENGTH_[]
void set_bit(int i, value_type value)
void assign_from_string(const std::string &)
void init(int length_, bool init_value=false)
#define SC_REPORT_ERROR(msg_type, msg)
const T sc_min(const T &a, const T &b)
const std::string convert_to_fmt(const std::string &s, sc_numrep numrep, bool w_prefix)
sc_bv_base(int length_=sc_length_param().len())
const std::string convert_to_bin(const char *s)
sc_bv_base & operator=(const sc_proxy< X > &a)
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17