SystemC 3.0.0
Accellera SystemC proof-of-concept library
sc_concatref.h
Go to the documentation of this file.
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
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15 implied. See the License for the specific language governing
16 permissions and limitations under the License.
17
18 *****************************************************************************/
19
20/*****************************************************************************
21
22 sc_concatref.h -- Concatenation support.
23
24 Original Author: Andy Goodrich, Forte Design, Inc.
25
26 *****************************************************************************/
27
28/*****************************************************************************
29
30 MODIFICATION LOG - modifiers, enter your name, affiliation, date and
31 changes you are making here.
32
33 Name, Affiliation, Date:
34 Description of Modification:
35
36 Andy Goodrich, Forte Design Systems, 17 Nov 2002
37 Creation of sc_concatref class by merging the capabilities of
38 sc_int_concref, sc_int_concref, sc_uint_concref, sc_uint_concref,
39 and implementing the capabilities of sc_signed_concref, sc_signed_concref,
40 sc_unsigned_concref, and sc_unsigned_concref. The resultant class allows
41 mixed mode concatenations on the left and right sides of an assignment.
42
43 *****************************************************************************/
44
45// $Log: sc_concatref.h,v $
46// Revision 1.6 2011/08/24 22:05:48 acg
47// Torsten Maehne: initialization changes to remove warnings.
48//
49// Revision 1.5 2009/11/17 19:58:15 acg
50// Andy Goodrich: fix of shift rhs possibilities to include "int".
51//
52// Revision 1.4 2009/02/28 00:26:29 acg
53// Andy Goodrich: bug fixes.
54//
55// Revision 1.3 2008/04/29 20:23:55 acg
56// Andy Goodrich: fixed the code that assigns the value of a string to
57// an sc_concatref instance.
58//
59// Revision 1.2 2008/02/14 20:57:26 acg
60// Andy Goodrich: added casts to ~0 instances to keep MSVC compiler happy.
61//
62// Revision 1.1.1.1 2006/12/15 20:20:05 acg
63// SystemC 2.3
64//
65// Revision 1.4 2006/10/23 19:36:59 acg
66// Andy Goodrich: changed casts for operations on concatenation values to
67// mirror those of sc_unsigned. For instance, an sc_unsigned minus a value
68// returns an sc_signed result, whereas an sc_concatref minus a value was
69// returning an sc_unsigned result. Now both sc_unsigned and sc_concatref
70// minus a value return an sc_signed result.
71//
72// Revision 1.3 2006/01/13 18:54:01 acg
73// Andy Goodrich: added $Log command so that CVS comments are reproduced in
74// the source.
75//
76
77#ifndef SC_CONCATREF_H
78#define SC_CONCATREF_H
79
94
95namespace sc_dt {
96
97// classes defined in this module
98class sc_concatref;
99class sc_concat_bool;
100
101// ----------------------------------------------------------------------------
102// CLASS TEMPLATE : sc_concatref
103//
104// Proxy class for sized bit concatenation.
105// ----------------------------------------------------------------------------
106
107class SC_API sc_concatref : public sc_generic_base<sc_concatref>, public sc_value_base
108{
109public:
110 friend class sc_core::sc_vpool<sc_concatref>;
111
112 inline void initialize(
113 sc_value_base& left, sc_value_base& right )
114 {
115 bool left_xz; // True if x's and/or z's found in left.
116 bool right_xz; // True if x's and/or z's found in right.
117
118 m_left_p = (sc_value_base*)&left;
119 m_right_p = (sc_value_base*)&right;
120 m_len_r = right.concat_length(&right_xz);
121 m_len = left.concat_length(&left_xz) + m_len_r;
122 m_flags = ( left_xz || right_xz ) ? cf_xz_present : cf_none;
123 }
124
125
126 inline void initialize(
127 const sc_value_base& left, const sc_value_base& right )
128 {
129 bool left_xz; // True if x's and/or z's found in left.
130 bool right_xz; // True if x's and/or z's found in right.
131
132 m_left_p = (sc_value_base*)&left;
133 m_right_p = (sc_value_base*)&right;
134 m_len_r = right.concat_length(&right_xz);
135 m_len = left.concat_length(&left_xz) + m_len_r;
136 m_flags = ( left_xz || right_xz ) ? cf_xz_present : cf_none;
137 }
138
139 // destructor
140
142 {}
143
144
145 // capacity
146
147 unsigned int length() const
148 { return m_len; }
149
150#ifdef SC_DT_DEPRECATED
151 int bitwidth() const
152 { return length(); }
153#endif
154
155 // concatenation
156
157 virtual int concat_length( bool* xz_present_p ) const
158 {
159 if ( xz_present_p )
160 *xz_present_p = m_flags & cf_xz_present ? true : false;
161 return m_len;
162 }
163
164 virtual void concat_clear_data( bool to_ones )
165 {
166 m_left_p->concat_clear_data(to_ones);
167 m_right_p->concat_clear_data(to_ones);
168 }
169
170 virtual bool concat_get_ctrl( sc_digit* dst_p, int low_i ) const
171 {
172 bool rnz = m_right_p->concat_get_ctrl( dst_p, low_i );
173 bool lnz = m_left_p->concat_get_ctrl( dst_p, low_i+m_len_r );
174 return rnz || lnz;
175 }
176
177 virtual bool concat_get_data( sc_digit* dst_p, int low_i ) const
178 {
179 bool rnz = m_right_p->concat_get_data( dst_p, low_i );
180 bool lnz = m_left_p->concat_get_data( dst_p, low_i+m_len_r );
181 return rnz || lnz;
182 }
183
184 virtual uint64 concat_get_uint64() const
185 {
186 if ( m_len_r >= 64 )
187 return m_right_p->concat_get_uint64();
188 else
189 {
190 return (m_left_p->concat_get_uint64() << m_len_r) |
191 m_right_p->concat_get_uint64();
192 }
193 }
194
195 virtual void concat_set( int64 src, int low_i )
196 {
197 m_right_p->concat_set( src, low_i );
198 m_left_p->concat_set( src, low_i+m_len_r);
199 }
200
201 virtual void concat_set( const sc_signed& src, int low_i )
202 {
203 m_right_p->concat_set( src, low_i );
204 m_left_p->concat_set( src, low_i+m_len_r);
205 }
206
207 virtual void concat_set( const sc_unsigned& src, int low_i )
208 {
209 m_right_p->concat_set( src, low_i );
210 m_left_p->concat_set( src, low_i+m_len_r);
211 }
212
213 virtual void concat_set( uint64 src, int low_i )
214 {
215 m_right_p->concat_set( src, low_i );
216 m_left_p->concat_set( src, low_i+m_len_r);
217 }
218
219
220 // explicit conversions
221
223 {
224 uint64 mask;
225 uint64 result;
226
227 result = m_right_p->concat_get_uint64();
228 if ( m_len_r < 64 )
229 {
230 mask = (uint64)~0;
231 result = (m_left_p->concat_get_uint64() << m_len_r) |
232 (result & ~(mask << m_len_r));
233 }
234 if ( m_len < 64 )
235 {
236 mask = (uint64)~0;
237 result = result & ~(mask << m_len);
238 }
239 return result;
240 }
241
242 const sc_unsigned& value() const
243 {
245
246 result_p->nbits = result_p->num_bits(m_len);
247 result_p->ndigits = DIV_CEIL(result_p->nbits);
248 if ( result_p->ndigits > SC_BASE_VEC_DIGITS ) {
249 result_p->digit = sc_temporary_digits.allocate( result_p->ndigits );
250 }
251 else {
252 result_p->digit = result_p->base_vec;
253 }
254 m_right_p->concat_get_data( result_p->digit, 0 );
255 m_left_p->concat_get_data(result_p->digit, m_len_r);
256 result_p->adjust_hod();
257 return *result_p;
258 }
259
261 {
262 return (int64)to_uint64();
263 }
264 int to_int() const
265 { return (int)to_int64(); }
266 unsigned int to_uint() const
267 { return (unsigned int)to_uint64(); }
268 long to_long() const
269 { return (long)to_int64(); }
270 unsigned long to_ulong() const
271 { return (unsigned long)to_uint64(); }
272 double to_double() const
273 { return value().to_double(); }
274
275 void to_sc_signed( sc_signed& target ) const
276 { target = value(); }
277
278 void to_sc_unsigned( sc_unsigned& target ) const
279 { target = value(); }
280
281 // implicit conversions:
282
283 operator uint64 () const
284 { return to_uint64(); }
285
286 operator const sc_unsigned& () const
287 { return value(); }
288
289 // unary operators:
290
292 { return value(); }
293
295 { return -value(); }
296
298 { return ~value(); }
299
300 // explicit conversion to character string
301
302 const std::string to_string( sc_numrep numrep = SC_DEC ) const
303 { return value().to_string(numrep); }
304
305 const std::string to_string( sc_numrep numrep, bool w_prefix ) const
306 { return value().to_string(numrep,w_prefix); }
307
308
309
310 // assignments
311
312 inline const sc_concatref& operator = ( int v )
313 {
314 m_right_p->concat_set((int64)v, 0);
315 m_left_p->concat_set((int64)v, m_len_r);
316 return *this;
317 }
318
319 inline const sc_concatref& operator = ( long v )
320 {
321 m_right_p->concat_set((int64)v, 0);
322 m_left_p->concat_set((int64)v, m_len_r);
323 return *this;
324 }
325
326 inline const sc_concatref& operator = ( int64 v )
327 {
328 m_right_p->concat_set(v, 0);
329 m_left_p->concat_set(v, m_len_r);
330 return *this;
331 }
332
333 inline const sc_concatref& operator = ( unsigned int v )
334 {
335 m_right_p->concat_set((uint64)v, 0);
336 m_left_p->concat_set((uint64)v, m_len_r);
337 return *this;
338 }
339
340 inline const sc_concatref& operator = ( unsigned long v )
341 {
342 m_right_p->concat_set((uint64)v, 0);
343 m_left_p->concat_set((uint64)v, m_len_r);
344 return *this;
345 }
346
347 inline const sc_concatref& operator = ( uint64 v )
348 {
349 m_right_p->concat_set(v, 0);
350 m_left_p->concat_set(v, m_len_r);
351 return *this;
352 }
353
354 const sc_concatref& operator = ( const sc_concatref& v )
355 {
356 sc_unsigned temp(v.length());
357 temp = v.value();
358 m_right_p->concat_set(temp, 0);
359 m_left_p->concat_set(temp, m_len_r);
360 return *this;
361 }
362
363 const sc_concatref& operator = ( const sc_signed& v )
364 {
365 m_right_p->concat_set(v, 0);
366 m_left_p->concat_set(v, m_len_r);
367 return *this;
368 }
369
370 const sc_concatref& operator = ( const sc_unsigned& v )
371 {
372 m_right_p->concat_set(v, 0);
373 m_left_p->concat_set(v, m_len_r);
374 return *this;
375 }
376
377 const sc_concatref& operator = ( const char* v_p )
378 {
379 sc_unsigned v(m_len);
380 v = v_p;
381 m_right_p->concat_set(v, 0);
382 m_left_p->concat_set(v, m_len_r);
383 return *this;
384 }
385
386 const sc_concatref& operator = ( const sc_bv_base& v )
387 {
388 sc_unsigned temp(v.length());
389 temp = v;
390 m_right_p->concat_set(temp, 0);
391 m_left_p->concat_set(temp, m_len_r);
392 return *this;
393 }
394
395 const sc_concatref& operator = ( const sc_lv_base& v )
396 {
397 sc_unsigned data(v.length());
398 data = v;
399 m_right_p->concat_set(data, 0);
400 m_left_p->concat_set(data, m_len_r);
401 return *this;
402 }
403
404
405 // reduce methods
406
407 bool and_reduce() const
408 { return value().and_reduce(); }
409
410 bool nand_reduce() const
411 { return value().nand_reduce(); }
412
413 bool or_reduce() const
414 { return value().or_reduce(); }
415
416 bool nor_reduce() const
417 { return value().nor_reduce(); }
418
419 bool xor_reduce() const
420 { return value().xor_reduce(); }
421
422 bool xnor_reduce() const
423 { return value().xnor_reduce(); }
424
425 // other methods
426
427 void print( ::std::ostream& os = ::std::cout ) const
428 { os << this->value(); }
429
430 void scan( ::std::istream& is )
431 {
432 std::string s;
433 is >> s;
434 *this = s.c_str();
435 }
436
437public:
439 cf_none = 0, // Normal value.
440 cf_xz_present = 1 // X and/or Z values present.
441 };
442
443protected:
444 sc_value_base* m_left_p; // Left hand operand of concatenation.
445 sc_value_base* m_right_p; // Right hand operand of concatenation.
446 int m_len; // Length of concatenation.
447 int m_len_r; // Length of m_rightt_p.
448 concat_flags m_flags; // Value is read only.
449
450private:
452 sc_concatref() : m_left_p(0), m_right_p(0), m_len(0), m_len_r(0), m_flags()
453 {}
454};
455
456
457// functional notation for the reduce methods
458
459inline
460bool
462{
463 return a.and_reduce();
464}
465
466inline
467bool
469{
470 return a.nand_reduce();
471}
472
473inline
474bool
476{
477 return a.or_reduce();
478}
479
480inline
481bool
483{
484 return a.nor_reduce();
485}
486
487inline
488bool
490{
491 return a.xor_reduce();
492}
493
494inline
495bool
497{
498 return a.xnor_reduce();
499}
500
501
502// SHIFT OPERATORS FOR sc_concatref OBJECT INSTANCES:
503//
504// Because sc_concatref has implicit casts to both uint64 and sc_unsigned
505// it is necessary to disambiguate the use of the shift operators. We do
506// this in favor of sc_unsigned so that precision is not lost. To get an
507// integer-based result use a cast to uint64 before performing the shift.
508
509inline const sc_unsigned operator << (const sc_concatref& target, uint64 shift)
510{
511 return target.value() << (int)shift;
512}
513
514inline const sc_unsigned operator << (const sc_concatref& target, int64 shift)
515{
516 return target.value() << (int)shift;
517}
518
520 const sc_concatref& target, unsigned long shift )
521{
522 return target.value() << (int)shift;
523}
524
526 const sc_concatref& target, int shift )
527{
528 return target.value() << shift;
529}
530
532 const sc_concatref& target, unsigned int shift )
533{
534 return target.value() << (int)shift;
535}
536
537inline const sc_unsigned operator << ( const sc_concatref& target, long shift )
538{
539 return target.value() << (int)shift;
540}
541
542inline const sc_unsigned operator >> (const sc_concatref& target, uint64 shift)
543{
544 return target.value() >> (int)shift;
545}
546
547inline const sc_unsigned operator >> (const sc_concatref& target, int64 shift)
548{
549 return target.value() >> (int)shift;
550}
551
553 const sc_concatref& target, unsigned long shift )
554{
555 return target.value() >> (int)shift;
556}
557
559 const sc_concatref& target, int shift )
560{
561 return target.value() >> shift;
562}
563
565 const sc_concatref& target, unsigned int shift )
566{
567 return target.value() >> (int)shift;
568}
569
570inline const sc_unsigned operator >> ( const sc_concatref& target, long shift )
571{
572 return target.value() >> (int)shift;
573}
574
575
576// STREAM OPERATORS FOR sc_concatref OBJECT INSTANCES:
577
578inline
579::std::ostream&
580operator << ( ::std::ostream& os, const sc_concatref& v )
581{
582 return os << v.value();
583}
584
585inline
586::std::istream&
587operator >> ( ::std::istream& is, sc_concatref& a )
588{
589 sc_unsigned temp(a.concat_length(0));
590 temp.scan( is );
591 a = temp;
592 return is;
593}
594
595
596// ----------------------------------------------------------------------------
597// CLASS TEMPLATE : sc_concat_bool
598//
599// Proxy class for read-only boolean values in concatenations.
600// ----------------------------------------------------------------------------
601
603{
604 protected:
605 bool m_value; // Value for this obj.
606
607 public:
608
609 // constructor:
610
612 : sc_value_base(), m_value()
613 {}
614
615 // destructor:
616
618 { }
619
620 // allocation of temporary object:
621
622 static inline sc_concat_bool* allocate( bool v )
623 {
625 sc_concat_bool* result_p = pool.allocate();
626 result_p->m_value = v;
627 return result_p;
628 }
629
630 // concatenation:
631
632 virtual int concat_length( bool* xz_present_p ) const
633 {
634 if ( xz_present_p ) *xz_present_p = false;
635 return 1;
636 }
637
638 virtual bool concat_get_ctrl( sc_digit* dst_p, int low_i ) const
639 {
640 int bit = 1 << SC_BIT_INDEX(low_i);
641 int word_i = SC_DIGIT_INDEX(low_i);
642 dst_p[word_i] &= ~bit;
643 return false;
644 }
645
646 virtual bool concat_get_data( sc_digit* dst_p, int low_i ) const
647 {
648 int bit = 1 << SC_BIT_INDEX(low_i);
649 int word_i = SC_DIGIT_INDEX(low_i);
650 if ( m_value )
651 dst_p[word_i] |= bit;
652 else
653 dst_p[word_i] &= ~bit;
654 return m_value;
655 }
656
657 virtual uint64 concat_get_uint64() const
658 {
659 return m_value ? 1 : 0;
660 }
661};
662
663
664// ----------------------------------------------------------------------------
665// ARITHMETIC AND LOGIC OPERATORS FOR sc_concatref
666// ----------------------------------------------------------------------------
667
668#define SC_CONCAT_OP_TYPE(RESULT,OP,OTHER_TYPE) \
669 inline RESULT operator OP ( const sc_concatref& a, OTHER_TYPE b ) \
670 { \
671 return a.value() OP b; \
672 } \
673 inline RESULT operator OP ( OTHER_TYPE a, const sc_concatref& b ) \
674 { \
675 return a OP b.value(); \
676 }
677
678
679#define SC_CONCAT_OP(RESULT,OP) \
680 inline RESULT operator OP ( const sc_concatref& a, const sc_concatref& b ) \
681 { \
682 return a.value() OP b.value(); \
683 } \
684 SC_CONCAT_OP_TYPE(const sc_signed,OP,int) \
685 SC_CONCAT_OP_TYPE(const sc_signed,OP,long) \
686 SC_CONCAT_OP_TYPE(const sc_signed,OP,int64) \
687 SC_CONCAT_OP_TYPE(RESULT,OP,unsigned int) \
688 SC_CONCAT_OP_TYPE(RESULT,OP,unsigned long) \
689 SC_CONCAT_OP_TYPE(RESULT,OP,uint64) \
690 SC_CONCAT_OP_TYPE(const sc_signed,OP,const sc_int_base&) \
691 SC_CONCAT_OP_TYPE(RESULT,OP,const sc_uint_base&) \
692 SC_CONCAT_OP_TYPE(const sc_signed,OP,const sc_signed&) \
693 SC_CONCAT_OP_TYPE(RESULT,OP,const sc_unsigned&) \
694 inline RESULT operator OP ( const sc_concatref& a, bool b ) \
695 { \
696 return a.value() OP (int)b; \
697 } \
698 inline RESULT operator OP ( bool a, const sc_concatref& b ) \
699 { \
700 return (int)a OP b.value(); \
701 }
702
703#define SC_CONCAT_BOOL_OP(OP) \
704 inline bool operator OP ( const sc_concatref& a, const sc_concatref& b ) \
705 { \
706 return a.value() OP b.value(); \
707 } \
708 SC_CONCAT_OP_TYPE(bool,OP,int) \
709 SC_CONCAT_OP_TYPE(bool,OP,long) \
710 SC_CONCAT_OP_TYPE(bool,OP,int64) \
711 SC_CONCAT_OP_TYPE(bool,OP,unsigned int) \
712 SC_CONCAT_OP_TYPE(bool,OP,unsigned long) \
713 SC_CONCAT_OP_TYPE(bool,OP,uint64) \
714 SC_CONCAT_OP_TYPE(bool,OP,const sc_int_base&) \
715 SC_CONCAT_OP_TYPE(bool,OP,const sc_uint_base&) \
716 SC_CONCAT_OP_TYPE(bool,OP,const sc_signed&) \
717 SC_CONCAT_OP_TYPE(bool,OP,const sc_unsigned&) \
718 inline bool operator OP ( const sc_concatref& a, bool b ) \
719 { \
720 return a.value() OP (int)b; \
721 } \
722 inline bool operator OP ( bool a, const sc_concatref& b ) \
723 { \
724 return (int)a OP b.value(); \
725 }
726
727SC_CONCAT_OP(const sc_unsigned,+)
728SC_CONCAT_OP(const sc_signed,-)
729SC_CONCAT_OP(const sc_unsigned,*)
730SC_CONCAT_OP(const sc_unsigned,/)
731SC_CONCAT_OP(const sc_unsigned,%)
732SC_CONCAT_OP(const sc_unsigned,&)
733SC_CONCAT_OP(const sc_unsigned,|)
734SC_CONCAT_OP(const sc_unsigned,^)
741
742#undef SC_CONCAT_OP
743#undef SC_CONCAT_OP_TYPE
744
745
746// ----------------------------------------------------------------------------
747// CONCATENATION FUNCTION AND OPERATOR FOR STANDARD SYSTEM C DATA TYPES:
748// ----------------------------------------------------------------------------
749
751{
752 static sc_core::sc_vpool<sc_concatref> pool(9);
753 sc_dt::sc_concatref* result_p = pool.allocate();
754 return result_p;
755}
756
759{
760 sc_dt::sc_concatref* result_p; // Proxy for the concatenation.
761
762 result_p = temporary_concatref();
763 result_p->initialize( a, b );
764 return *result_p;
765}
766
767inline
768const
771{
772 sc_dt::sc_concatref* result_p; // Proxy for the concatenation.
773
774 result_p = temporary_concatref();
775 result_p->initialize( a, b );
776 return *result_p;
777}
778
779inline
780const
782{
783 const sc_dt::sc_concat_bool* b_p; // Proxy for boolean value.
784 sc_dt::sc_concatref* result_p; // Proxy for the concatenation.
785
787 result_p = temporary_concatref();
788 result_p->initialize( a, *b_p );
789 return *result_p;
790}
791
792inline
793const
795{
796 const sc_dt::sc_concat_bool* a_p; // Proxy for boolean value.
797 sc_dt::sc_concatref* result_p; // Proxy for the concatenation.
798
800 result_p = temporary_concatref();
801 result_p->initialize( *a_p, b );
802 return *result_p;
803}
804
807{
808 sc_dt::sc_concatref* result_p; // Proxy for the concatenation.
809
810 result_p = temporary_concatref();
811 result_p->initialize( a, b );
812 return *result_p;
813}
814
815inline
816const
819{
820 sc_dt::sc_concatref* result_p; // Proxy for the concatenation.
821
822 result_p = temporary_concatref();
823 result_p->initialize( a, b );
824 return *result_p;
825}
826
827inline
828const
830{
831 const sc_dt::sc_concat_bool* b_p; // Proxy for boolean value.
832 sc_dt::sc_concatref* result_p; // Proxy for the concatenation.
833
835 result_p = temporary_concatref();
836 result_p->initialize( a, *b_p );
837 return *result_p;
838}
839
840inline
841const
843{
844 const sc_dt::sc_concat_bool* a_p; // Proxy for boolean value.
845 sc_dt::sc_concatref* result_p; // Proxy for the concatenation.
846
848 result_p = temporary_concatref();
849 result_p->initialize( *a_p, b );
850 return *result_p;
851}
852
853} // namespace sc_dt
854
855#endif // SC_CONCATREF_H
856
#define SC_DIGIT_INDEX(BIT_INDEX)
Definition: sc_nbdefs.h:186
#define DIV_CEIL(x)
Definition: sc_nbdefs.h:212
#define SC_BIT_INDEX(BIT)
Definition: sc_nbdefs.h:185
#define SC_BASE_VEC_DIGITS
Definition: sc_nbdefs.h:127
#define SC_CONCAT_OP(RESULT, OP)
Definition: sc_concatref.h:679
#define SC_CONCAT_BOOL_OP(OP)
Definition: sc_concatref.h:703
#define SC_API
Definition: sc_cmnhdr.h:148
sc_proxy< X >::value_type or_reduce(const sc_proxy< X > &a)
Definition: sc_proxy.h:1496
sc_proxy< X >::value_type xor_reduce(const sc_proxy< X > &a)
Definition: sc_proxy.h:1512
const sc_big_op_info< WL, true, WR, true >::add_result operator+(const sc_bigint< WL > &left, const sc_bigint< WR > &right)
Definition: sc_big_ops.h:125
sc_digit_heap SC_API sc_temporary_digits
sc_numrep
Definition: sc_string.h:56
@ SC_DEC
Definition: sc_string.h:60
static sc_dt::sc_concatref * temporary_concatref()
Definition: sc_concatref.h:750
unsigned long long uint64
Definition: sc_nbdefs.h:216
const sc_big_op_info< WL, true, WR, true >::sub_result operator-(const sc_bigint< WL > &left, const sc_bigint< WR > &right)
Definition: sc_big_ops.h:884
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > concat(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > operator,(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
sc_proxy< X >::value_type nor_reduce(const sc_proxy< X > &a)
Definition: sc_proxy.h:1504
unsigned int sc_digit
Definition: sc_nbdefs.h:161
inline::std::istream & operator>>(::std::istream &is, sc_bit &a)
Definition: sc_bit.h:396
sc_proxy< X >::value_type and_reduce(const sc_proxy< X > &a)
Definition: sc_proxy.h:1480
inline::std::ostream & operator<<(::std::ostream &os, const sc_bit &a)
Definition: sc_bit.h:388
uint64 const sc_uint_base int b
Definition: sc_fxval.h:955
sc_proxy< X >::value_type xnor_reduce(const sc_proxy< X > &a)
Definition: sc_proxy.h:1520
sc_proxy< X >::value_type nand_reduce(const sc_proxy< X > &a)
Definition: sc_proxy.h:1488
sc_bit operator~(const sc_bit &a)
Definition: sc_bit.h:312
long long int64
Definition: sc_nbdefs.h:215
sc_core::sc_signal_in_if< T > & value(const T &val)
Definition: sc_stub.h:217
int length() const
Definition: sc_bv_base.h:194
int length() const
Definition: sc_lv_base.h:203
sc_digit * allocate(size_t digits_n)
Definition: sc_nbutils.h:288
virtual void concat_set(int64 src, int low_i)
static sc_unsigned * temporary()
Definition: sc_unsigned.h:766
sc_digit base_vec[SC_BASE_VEC_DIGITS >0?SC_BASE_VEC_DIGITS:1]
Definition: sc_unsigned.h:1141
void scan(::std::istream &is=::std::cin)
void to_sc_signed(sc_signed &target) const
Definition: sc_concatref.h:275
unsigned int to_uint() const
Definition: sc_concatref.h:266
long to_long() const
Definition: sc_concatref.h:268
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
Definition: sc_concatref.h:177
sc_value_base * m_left_p
Definition: sc_concatref.h:444
bool xnor_reduce() const
Definition: sc_concatref.h:422
virtual uint64 concat_get_uint64() const
Definition: sc_concatref.h:184
double to_double() const
Definition: sc_concatref.h:272
bool and_reduce() const
Definition: sc_concatref.h:407
void initialize(sc_value_base &left, sc_value_base &right)
Definition: sc_concatref.h:112
const std::string to_string(sc_numrep numrep=SC_DEC) const
Definition: sc_concatref.h:302
virtual void concat_set(const sc_unsigned &src, int low_i)
Definition: sc_concatref.h:207
virtual void concat_set(uint64 src, int low_i)
Definition: sc_concatref.h:213
virtual int concat_length(bool *xz_present_p) const
Definition: sc_concatref.h:157
virtual void concat_clear_data(bool to_ones)
Definition: sc_concatref.h:164
void initialize(const sc_value_base &left, const sc_value_base &right)
Definition: sc_concatref.h:126
sc_value_base * m_right_p
Definition: sc_concatref.h:445
bool nor_reduce() const
Definition: sc_concatref.h:416
bool or_reduce() const
Definition: sc_concatref.h:413
void scan(::std::istream &is)
Definition: sc_concatref.h:430
const std::string to_string(sc_numrep numrep, bool w_prefix) const
Definition: sc_concatref.h:305
unsigned long to_ulong() const
Definition: sc_concatref.h:270
bool nand_reduce() const
Definition: sc_concatref.h:410
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
Definition: sc_concatref.h:170
uint64 to_uint64() const
Definition: sc_concatref.h:222
void print(::std::ostream &os=::std::cout) const
Definition: sc_concatref.h:427
bool xor_reduce() const
Definition: sc_concatref.h:419
virtual void concat_set(const sc_signed &src, int low_i)
Definition: sc_concatref.h:201
virtual void concat_set(int64 src, int low_i)
Definition: sc_concatref.h:195
void to_sc_unsigned(sc_unsigned &target) const
Definition: sc_concatref.h:278
int64 to_int64() const
Definition: sc_concatref.h:260
virtual ~sc_concatref()
Definition: sc_concatref.h:141
concat_flags m_flags
Definition: sc_concatref.h:448
const sc_unsigned & value() const
Definition: sc_concatref.h:242
int to_int() const
Definition: sc_concatref.h:264
unsigned int length() const
Definition: sc_concatref.h:147
virtual uint64 concat_get_uint64() const
Definition: sc_concatref.h:657
virtual int concat_length(bool *xz_present_p) const
Definition: sc_concatref.h:632
virtual bool concat_get_ctrl(sc_digit *dst_p, int low_i) const
Definition: sc_concatref.h:638
virtual bool concat_get_data(sc_digit *dst_p, int low_i) const
Definition: sc_concatref.h:646
static sc_concat_bool * allocate(bool v)
Definition: sc_concatref.h:622