Lines Matching refs:csd
61 scfx_string csd;
63 // copy bits from 's' into 'csd'; skip prefix, point, and exponent
68 csd[i ++] = s[j];
73 csd[i] = '\0';
75 // convert 'csd' from two's complement to csd
78 if (csd[i] == '0') {
81 if (i > 0 && csd[i - 1] == '0') {
84 csd[i--] = '-';
86 csd[i--] = '-';
87 while (i >= 0 && csd[i] == '1')
88 csd[i--] = '0';
90 csd[i] = '1';
92 csd[i--] = '1';
97 // copy bits from 'csd' back into 's'
100 while (csd[i]) {
103 s[j++] = csd[i++];
109 scfx_csd2tc(scfx_string &csd)
111 SC_ASSERT_(csd[0] == '0' && csd[1] == 'c' &&
112 csd[2] == 's' && csd[3] == 'd', "invalid prefix");
116 // copy bits from 'csd' into 's'; skip prefix, point, and exponent
120 while (csd[j]) {
121 if (csd[j] == '-' || csd[j] == '0' || csd[j] == '1')
122 s[i++] = csd[j];
123 else if (csd[j] != '.')
129 // convert 's' from csd to two's complement
145 // copy bits from 's' back into 'csd'
146 j = csd.length();
147 csd[j + 1] = '\0';
149 csd[j] = csd[j - 1];
156 if (csd[j] == '.')
158 csd[j++] = s[i++];