SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_lv_base.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_lv_base.h -- Arbitrary size logic vector class.
23 */
32 /*****************************************************************************
33 
34  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
35  changes you are making here.
36 
37  Name, Affiliation, Date:
38  Description of Modification:
39  Andy Goodrich, Forte Design Systems
40  Fixed bug in clean_tail for sizes that are modulo 32, which caused
41  zeroing of values.
42 
43  *****************************************************************************/
44 
45 // $Log: sc_lv_base.h,v $
46 // Revision 1.4 2011/08/26 22:32:00 acg
47 // Torsten Maehne: added parentheses to make opearator ordering more obvious.
48 //
49 // Revision 1.3 2010/01/27 19:41:29 acg
50 // Andy Goodrich: fix 8 instances of sc_concref constructor invocations
51 // that failed to indicate that their arguments should be freed when the
52 // object was freed.
53 //
54 // Revision 1.2 2009/02/28 00:26:14 acg
55 // Andy Goodrich: bug fixes.
56 //
57 // Revision 1.2 2007/03/14 17:47:49 acg
58 // Andy Goodrich: Formatting.
59 //
60 // Revision 1.1.1.1 2006/12/15 20:31:36 acg
61 // SystemC 2.2
62 //
63 // Revision 1.3 2006/01/13 18:53:53 acg
64 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
65 // the source.
66 //
67 
68 #ifndef SC_LV_BASE_H
69 #define SC_LV_BASE_H
70 
71 
76 
77 
78 namespace sc_dt
79 {
80 
81 // classes defined in this module
82 class sc_lv_base;
83 
84 
92  : public sc_proxy<sc_lv_base>
93 {
94  friend class sc_bv_base;
95 
96 
97  void init( int length_, const sc_logic& init_value = SC_LOGIC_X );
98 
99  void assign_from_string( const std::string& );
100 
101 public:
102 
103  // typedefs
104 
106  typedef base_type::value_type value_type;
107 
108 
109  // constructors
110 
111  explicit sc_lv_base( int length_ = sc_length_param().len() )
112  : m_len( 0 ), m_size( 0 ), m_data( 0 ), m_ctrl( 0 )
113  { init( length_ ); }
114 
115  explicit sc_lv_base( const sc_logic& a,
116  int length_ = sc_length_param().len() )
117  : m_len( 0 ), m_size( 0 ), m_data( 0 ), m_ctrl( 0 )
118  { init( length_, a ); }
119 
120  sc_lv_base( const char* a );
121 
122  sc_lv_base( const char* a, int length_ );
123 
124  template <class X>
126  : m_len( 0 ), m_size( 0 ), m_data( 0 ), m_ctrl( 0 )
127  { init( a.back_cast().length() ); base_type::assign_( a ); }
128 
129  sc_lv_base( const sc_lv_base& a );
130 
131 #ifdef SC_DT_DEPRECATED
132 
133  explicit sc_lv_base( const sc_unsigned& a )
134  : m_len( 0 ), m_size( 0 ), m_data( 0 ), m_ctrl( 0 )
135  { init( a.length() ); base_type::assign_( a ); }
136 
137  explicit sc_lv_base( const sc_signed& a )
138  : m_len( 0 ), m_size( 0 ), m_data( 0 ), m_ctrl( 0 )
139  { init( a.length() ); base_type::assign_( a ); }
140 
141  explicit sc_lv_base( const sc_uint_base& a )
142  : m_len( 0 ), m_size( 0 ), m_data( 0 ), m_ctrl( 0 )
143  { init( a.length() ); base_type::assign_( a ); }
144 
145  explicit sc_lv_base( const sc_int_base& a )
146  : m_len( 0 ), m_size( 0 ), m_data( 0 ), m_ctrl( 0 )
147  { init( a.length() ); base_type::assign_( a ); }
148 
149 #endif
150 
151 
152  // destructor
153 
154  virtual ~sc_lv_base()
155  { delete [] m_data; }
156 
157 
158  // assignment operators
159 
160  template <class X>
161  sc_lv_base& operator = ( const sc_proxy<X>& a )
162  { assign_p_( *this, a ); return *this; }
163 
164  sc_lv_base& operator = ( const sc_lv_base& a )
165  { assign_p_( *this, a ); return *this; }
166 
167  sc_lv_base& operator = ( const char* a );
168 
169  sc_lv_base& operator = ( const bool* a )
170  { base_type::assign_( a ); return *this; }
171 
172  sc_lv_base& operator = ( const sc_logic* a )
173  { base_type::assign_( a ); return *this; }
174 
175  sc_lv_base& operator = ( const sc_unsigned& a )
176  { base_type::assign_( a ); return *this; }
177 
178  sc_lv_base& operator = ( const sc_signed& a )
179  { base_type::assign_( a ); return *this; }
180 
181  sc_lv_base& operator = ( const sc_uint_base& a )
182  { base_type::assign_( a ); return *this; }
183 
184  sc_lv_base& operator = ( const sc_int_base& a )
185  { base_type::assign_( a ); return *this; }
186 
187  sc_lv_base& operator = ( unsigned long a )
188  { base_type::assign_( a ); return *this; }
189 
190  sc_lv_base& operator = ( long a )
191  { base_type::assign_( a ); return *this; }
192 
193  sc_lv_base& operator = ( unsigned int a )
194  { base_type::assign_( a ); return *this; }
195 
196  sc_lv_base& operator = ( int a )
197  { base_type::assign_( a ); return *this; }
198 
199  sc_lv_base& operator = ( uint64 a )
200  { base_type::assign_( a ); return *this; }
201 
202  sc_lv_base& operator = ( int64 a )
203  { base_type::assign_( a ); return *this; }
204 
205  // common methods
206 
207  int length() const
208  { return m_len; }
209 
210  int size() const
211  { return m_size; }
212 
213  value_type get_bit( int i ) const;
214  void set_bit( int i, value_type value );
215 
216  sc_digit get_word( int wi ) const
217  { return m_data[wi]; }
218 
219  // note the test for out of range access here. this is necessary
220  // because of the hair-brained way concatenations are set up.
221  // an extend_sign on a concatenation uses the whole length of
222  // the concatenation to determine how many words to set.
223  void set_word( int wi, sc_digit w )
224  { sc_assert ( wi < m_size ); m_data[wi] = w; }
225 
226 
227  sc_digit get_cword( int wi ) const
228  { return m_ctrl[wi]; }
229 
230  void set_cword( int wi, sc_digit w )
231  { sc_assert ( wi < m_size ); m_ctrl[wi] = w; }
232 
233  void clean_tail();
234 
235 
236  // other methods
237 
238  bool is_01() const;
239 
240 protected:
241 
242  int m_len; // length in bits
243  int m_size; // size of the data array
244  sc_digit* m_data; // data array
245  sc_digit* m_ctrl; // dito (control part)
246 };
247 
248 
249 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
250 
251 #if 0
252 
253 // bitwise left rotate
254 
255 inline
256 const sc_lv_base
257 lrotate( const sc_lv_base& x, int n )
258 {
259  sc_lv_base a( x );
260  return a.lrotate( n );
261 }
262 
263 
264 // bitwise right rotate
265 
266 inline
267 const sc_lv_base
268 rrotate( const sc_lv_base& x, int n )
269 {
270  sc_lv_base a( x );
271  return a.rrotate( n );
272 }
273 
274 #endif
275 
276 
277 inline
279 sc_lv_base::get_bit( int i ) const
280 {
281  int wi = i / SC_DIGIT_SIZE;
282  int bi = i % SC_DIGIT_SIZE;
283  return value_type( ((m_data[wi] >> bi) & SC_DIGIT_ONE) |
284  (((m_ctrl[wi] >> bi) << 1) & SC_DIGIT_TWO) );
285 }
286 
287 inline
288 void
289 sc_lv_base::set_bit( int i, value_type value )
290 {
291  int wi = i / SC_DIGIT_SIZE; // word index
292  int bi = i % SC_DIGIT_SIZE; // bit index
293  sc_digit mask = SC_DIGIT_ONE << bi;
294  m_data[wi] |= mask; // set bit to 1
295  m_ctrl[wi] |= mask; // set bit to 1
296  m_data[wi] &= value << bi | ~mask;
297  m_ctrl[wi] &= value >> 1 << bi | ~mask;
298 }
299 
300 
301 inline
302 void
304 {
305  int wi = m_size - 1;
306  int bi = m_len % SC_DIGIT_SIZE;
307  sc_digit mask = ~SC_DIGIT_ZERO >> (SC_DIGIT_SIZE - bi);
308  if ( mask )
309  {
310  m_data[wi] &= mask;
311  m_ctrl[wi] &= mask;
312  }
313 }
314 
315 
323 // bitwise operators and functions
324 
325 // bitwise complement
326 
327 template <class X>
328 inline
329 const sc_lv_base
331 {
332  sc_lv_base a( back_cast() );
333  return a.b_not();
334 }
335 
336 
337 // bitwise and
338 
339 template <class X, class Y>
340 inline
341 X&
343 {
344  X& x = px.back_cast();
345  sc_lv_base a( x.length() );
346  a = py.back_cast();
347  return b_and_assign_( x, a );
348 }
349 
350 
351 #define DEFN_BITWISE_AND_ASN_OP_T(tp) \
352 template <class X> \
353 inline \
354 X& \
355 sc_proxy<X>::operator &= ( tp b ) \
356 { \
357  X& x = back_cast(); \
358  sc_lv_base a( x.length() ); \
359  a = b; \
360  return b_and_assign_( x, a ); \
361 }
362 
363 DEFN_BITWISE_AND_ASN_OP_T(const char*)
364 DEFN_BITWISE_AND_ASN_OP_T(const bool*)
366 DEFN_BITWISE_AND_ASN_OP_T(const sc_unsigned&)
367 DEFN_BITWISE_AND_ASN_OP_T(const sc_signed&)
368 DEFN_BITWISE_AND_ASN_OP_T(unsigned long)
372 
373 #undef DEFN_BITWISE_AND_ASN_OP_T
374 
375 
376 template <class X, class Y>
377 inline
378 const sc_lv_base
379 operator & ( const sc_proxy<X>& px, const sc_proxy<Y>& py )
380 {
381  sc_lv_base a( px.back_cast() );
382  return ( a &= py.back_cast() );
383 }
384 
385 
386 #define DEFN_BITWISE_AND_OP_T_A(tp) \
387 template <class X> \
388 inline \
389 const sc_lv_base \
390 sc_proxy<X>::operator & ( tp b ) const \
391 { \
392  sc_lv_base a( back_cast() ); \
393  return ( a &= b ); \
394 }
395 
396 DEFN_BITWISE_AND_OP_T_A(const char*)
397 DEFN_BITWISE_AND_OP_T_A(const bool*)
399 DEFN_BITWISE_AND_OP_T_A(const sc_unsigned&)
400 DEFN_BITWISE_AND_OP_T_A(const sc_signed&)
401 DEFN_BITWISE_AND_OP_T_A(const sc_uint_base&)
402 DEFN_BITWISE_AND_OP_T_A(const sc_int_base&)
403 DEFN_BITWISE_AND_OP_T_A(unsigned long)
405 DEFN_BITWISE_AND_OP_T_A(unsigned int)
409 
410 #undef DEFN_BITWISE_AND_OP_T_A
411 
412 
413 #define DEFN_BITWISE_AND_OP_T_B(tp) \
414 template <class X> \
415 inline \
416 const sc_lv_base \
417 operator & ( tp b, const sc_proxy<X>& px ) \
418 { \
419  return ( px & b ); \
420 }
421 
422 DEFN_BITWISE_AND_OP_T_B(const char*)
423 DEFN_BITWISE_AND_OP_T_B(const bool*)
425 DEFN_BITWISE_AND_OP_T_B(const sc_unsigned&)
426 DEFN_BITWISE_AND_OP_T_B(const sc_signed&)
427 DEFN_BITWISE_AND_OP_T_B(const sc_uint_base&)
428 DEFN_BITWISE_AND_OP_T_B(const sc_int_base&)
429 DEFN_BITWISE_AND_OP_T_B(unsigned long)
431 DEFN_BITWISE_AND_OP_T_B(unsigned int)
435 
436 #undef DEFN_BITWISE_AND_OP_T_B
437 
438 
439 // bitwise or
440 
441 template <class X, class Y>
442 inline
443 X&
445 {
446  X& x = px.back_cast();
447  sc_lv_base a( x.length() );
448  a = py.back_cast();
449  return b_or_assign_( x, a );
450 }
451 
452 
453 #define DEFN_BITWISE_OR_ASN_OP_T(tp) \
454 template <class X> \
455 inline \
456 X& \
457 sc_proxy<X>::operator |= ( tp b ) \
458 { \
459  X& x = back_cast(); \
460  sc_lv_base a( x.length() ); \
461  a = b; \
462  return b_or_assign_( x, a ); \
463 }
464 
465 DEFN_BITWISE_OR_ASN_OP_T(const char*)
466 DEFN_BITWISE_OR_ASN_OP_T(const bool*)
468 DEFN_BITWISE_OR_ASN_OP_T(const sc_unsigned&)
469 DEFN_BITWISE_OR_ASN_OP_T(const sc_signed&)
470 DEFN_BITWISE_OR_ASN_OP_T(unsigned long)
474 
475 #undef DEFN_BITWISE_OR_ASN_OP_T
476 
477 
478 template <class X, class Y>
479 inline
480 const sc_lv_base
481 operator | ( const sc_proxy<X>& px, const sc_proxy<Y>& py )
482 {
483  sc_lv_base a( px.back_cast() );
484  return ( a |= py.back_cast() );
485 }
486 
487 
488 #define DEFN_BITWISE_OR_OP_T_A(tp) \
489 template <class X> \
490 inline \
491 const sc_lv_base \
492 sc_proxy<X>::operator | ( tp b ) const \
493 { \
494  sc_lv_base a( back_cast() ); \
495  return ( a |= b ); \
496 }
497 
498 DEFN_BITWISE_OR_OP_T_A(const char*)
499 DEFN_BITWISE_OR_OP_T_A(const bool*)
501 DEFN_BITWISE_OR_OP_T_A(const sc_unsigned&)
502 DEFN_BITWISE_OR_OP_T_A(const sc_signed&)
503 DEFN_BITWISE_OR_OP_T_A(const sc_uint_base&)
504 DEFN_BITWISE_OR_OP_T_A(const sc_int_base&)
505 DEFN_BITWISE_OR_OP_T_A(unsigned long)
507 DEFN_BITWISE_OR_OP_T_A(unsigned int)
511 
512 #undef DEFN_BITWISE_OR_OP_T_A
513 
514 
515 #define DEFN_BITWISE_OR_OP_T_B(tp) \
516 template <class X> \
517 inline \
518 const sc_lv_base \
519 operator | ( tp b, const sc_proxy<X>& px ) \
520 { \
521  return ( px | b ); \
522 }
523 
524 DEFN_BITWISE_OR_OP_T_B(const char*)
525 DEFN_BITWISE_OR_OP_T_B(const bool*)
527 DEFN_BITWISE_OR_OP_T_B(const sc_unsigned&)
528 DEFN_BITWISE_OR_OP_T_B(const sc_signed&)
529 DEFN_BITWISE_OR_OP_T_B(const sc_uint_base&)
530 DEFN_BITWISE_OR_OP_T_B(const sc_int_base&)
531 DEFN_BITWISE_OR_OP_T_B(unsigned long)
533 DEFN_BITWISE_OR_OP_T_B(unsigned int)
537 
538 #undef DEFN_BITWISE_OR_OP_T_B
539 
540 
541 // bitwise xor
542 
543 template <class X, class Y>
544 inline
545 X&
547 {
548  X& x = px.back_cast();
549  sc_lv_base a( x.length() );
550  a = py.back_cast();
551  return b_xor_assign_( x, a );
552 }
553 
554 
555 #define DEFN_BITWISE_XOR_ASN_OP_T(tp) \
556 template <class X> \
557 inline \
558 X& \
559 sc_proxy<X>::operator ^= ( tp b ) \
560 { \
561  X& x = back_cast(); \
562  sc_lv_base a( x.length() ); \
563  a = b; \
564  return b_xor_assign_( x, a ); \
565 }
566 
567 DEFN_BITWISE_XOR_ASN_OP_T(const char*)
568 DEFN_BITWISE_XOR_ASN_OP_T(const bool*)
570 DEFN_BITWISE_XOR_ASN_OP_T(const sc_unsigned&)
571 DEFN_BITWISE_XOR_ASN_OP_T(const sc_signed&)
572 DEFN_BITWISE_XOR_ASN_OP_T(unsigned long)
576 
577 #undef DEFN_BITWISE_XOR_ASN_OP_T
578 
579 
580 template <class X, class Y>
581 inline
582 const sc_lv_base
583 operator ^ ( const sc_proxy<X>& px, const sc_proxy<Y>& py )
584 {
585  sc_lv_base a( px.back_cast() );
586  return ( a ^= py.back_cast() );
587 }
588 
589 
590 #define DEFN_BITWISE_XOR_OP_T_A(tp) \
591 template <class X> \
592 inline \
593 const sc_lv_base \
594 sc_proxy<X>::operator ^ ( tp b ) const \
595 { \
596  sc_lv_base a( back_cast() ); \
597  return ( a ^= b ); \
598 }
599 
600 DEFN_BITWISE_XOR_OP_T_A(const char*)
601 DEFN_BITWISE_XOR_OP_T_A(const bool*)
603 DEFN_BITWISE_XOR_OP_T_A(const sc_unsigned&)
604 DEFN_BITWISE_XOR_OP_T_A(const sc_signed&)
605 DEFN_BITWISE_XOR_OP_T_A(const sc_uint_base&)
606 DEFN_BITWISE_XOR_OP_T_A(const sc_int_base&)
607 DEFN_BITWISE_XOR_OP_T_A(unsigned long)
609 DEFN_BITWISE_XOR_OP_T_A(unsigned int)
613 
614 #undef DEFN_BITWISE_XOR_OP_T_A
615 
616 
617 #define DEFN_BITWISE_XOR_OP_T_B(tp) \
618 template <class X> \
619 inline \
620 const sc_lv_base \
621 operator ^ ( tp b, const sc_proxy<X>& px ) \
622 { \
623  return ( px ^ b ); \
624 }
625 
626 DEFN_BITWISE_XOR_OP_T_B(const char*)
627 DEFN_BITWISE_XOR_OP_T_B(const bool*)
629 DEFN_BITWISE_XOR_OP_T_B(const sc_unsigned&)
630 DEFN_BITWISE_XOR_OP_T_B(const sc_signed&)
631 DEFN_BITWISE_XOR_OP_T_B(const sc_uint_base&)
632 DEFN_BITWISE_XOR_OP_T_B(const sc_int_base&)
633 DEFN_BITWISE_XOR_OP_T_B(unsigned long)
635 DEFN_BITWISE_XOR_OP_T_B(unsigned int)
639 
640 #undef DEFN_BITWISE_XOR_OP_T_B
641 
642 
643 // bitwise left shift
644 
645 template <class X>
646 inline
647 const sc_lv_base
649 {
650  sc_lv_base a( back_cast().length()+n );
651  a = back_cast();
652  return ( a <<= n );
653 }
654 
655 
656 // bitwise right shift
657 
658 template <class X>
659 inline
660 const sc_lv_base
662 {
663  sc_lv_base a( back_cast() );
664  return ( a >>= n );
665 }
666 
667 
668 // bitwise left rotate
669 
670 template <class X>
671 inline
672 X&
674 {
675  X& x = back_cast();
676  if( n < 0 ) {
677  sc_proxy_out_of_bounds( "left rotate operation is only allowed with "
678  "positive rotate values, rotate value = ", n );
679  return x;
680  }
681  int len = x.length();
682  n %= len;
683  // x = (x << n) | (x >> (len - n));
684  sc_lv_base a( x << n );
685  sc_lv_base b( x >> (len - n) );
686  int sz = x.size();
687  for( int i = 0; i < sz; ++ i ) {
688  x.set_word( i, a.get_word( i ) | b.get_word( i ) );
689  x.set_cword( i, a.get_cword( i ) | b.get_cword( i ) );
690  }
691  x.clean_tail();
692  return x;
693 }
694 
695 template <class X>
696 inline
697 const sc_lv_base
698 lrotate( const sc_proxy<X>& x, int n )
699 {
700  sc_lv_base a( x.back_cast() );
701  return a.lrotate( n );
702 }
703 
704 
705 // bitwise right rotate
706 
707 template <class X>
708 inline
709 X&
711 {
712  X& x = back_cast();
713  if( n < 0 ) {
714  sc_proxy_out_of_bounds( "right rotate operation is only allowed with "
715  "positive rotate values, rotate value = ", n );
716  return x;
717  }
718  int len = x.length();
719  n %= len;
720  // x = (x >> n) | (x << (len - n));
721  sc_lv_base a( x >> n );
722  sc_lv_base b( x << (len - n) );
723  int sz = x.size();
724  for( int i = 0; i < sz; ++ i ) {
725  x.set_word( i, a.get_word( i ) | b.get_word( i ) );
726  x.set_cword( i, a.get_cword( i ) | b.get_cword( i ) );
727  }
728  x.clean_tail();
729  return x;
730 }
731 
732 template <class X>
733 inline
734 const sc_lv_base
735 rrotate( const sc_proxy<X>& x, int n )
736 {
737  sc_lv_base a( x.back_cast() );
738  return a.rrotate( n );
739 }
740 
741 
742 // bitwise reverse
743 
744 template <class X>
745 inline
746 const sc_lv_base
747 reverse( const sc_proxy<X>& x )
748 {
749  sc_lv_base a( x.back_cast() );
750  return a.reverse();
751 }
752 
753 
754 // relational operators
755 
756 template <class X, class Y>
757 inline
758 bool
759 operator == ( const sc_proxy<X>& px, const sc_proxy<Y>& py )
760 {
761  const X& x = px.back_cast();
762  const Y& y = py.back_cast();
763  int x_len = x.length();
764  int y_len = y.length();
765  if( x_len != y_len ) {
766  return false;
767  }
768  int sz = x.size();
769  for( int i = 0; i < sz; ++ i ) {
770  if( x.get_word( i ) != y.get_word( i ) ||
771  x.get_cword( i ) != y.get_cword( i ) ) {
772  return false;
773  }
774  }
775  return true;
776 }
777 
778 
779 #define DEFN_REL_OP_T(tp) \
780 template <class X> \
781 inline \
782 bool \
783 sc_proxy<X>::operator == ( tp b ) const \
784 { \
785  const X& x = back_cast(); \
786  sc_lv_base y( x.length() ); \
787  y = b; \
788  return ( x == y ); \
789 }
790 
791 DEFN_REL_OP_T(const char*)
792 DEFN_REL_OP_T(const bool*)
793 DEFN_REL_OP_T(const sc_logic*)
794 DEFN_REL_OP_T(const sc_unsigned&)
795 DEFN_REL_OP_T(const sc_signed&)
796 DEFN_REL_OP_T(const sc_uint_base&)
797 DEFN_REL_OP_T(const sc_int_base&)
798 DEFN_REL_OP_T(unsigned long)
799 DEFN_REL_OP_T(long)
800 DEFN_REL_OP_T(unsigned int)
801 DEFN_REL_OP_T(int)
804 
805 #undef DEFN_REL_OP_T
806 
807 
814 // r-value concatenation operators and functions
815 
816 template <class T>
817 inline
818 sc_concref_r<sc_bitref_r<T>,sc_lv_base>
819 operator , ( sc_bitref_r<T> a, const char* b )
820 {
821  return sc_concref_r<sc_bitref_r<T>,sc_lv_base>(
822  *a.clone(), *new sc_lv_base( b ), 3 );
823 }
824 
825 template <class T>
826 inline
828 operator , ( const char* a, sc_bitref_r<T> b )
829 {
831  *new sc_lv_base( a ), *b.clone(), 3 );
832 }
833 
834 template <class T>
835 inline
836 sc_concref_r<sc_bitref_r<T>,sc_lv_base>
838 {
839  return sc_concref_r<sc_bitref_r<T>,sc_lv_base>(
840  *a.clone(), *new sc_lv_base( b, 1 ), 3 );
841 }
842 
843 template <class T>
844 inline
847 {
849  *new sc_lv_base( a, 1 ), *b.clone(), 3 );
850 }
851 
852 template <class T>
853 inline
854 sc_concref_r<sc_bitref_r<T>,sc_bv_base>
856 {
857  return sc_concref_r<sc_bitref_r<T>,sc_bv_base>
858  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
859 }
860 
861 template <class T>
862 inline
865 {
867  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
868 }
869 
870 
871 template <class T>
872 inline
873 sc_concref_r<sc_bitref_r<T>,sc_lv_base>
874 concat( sc_bitref_r<T> a, const char* b )
875 {
876  return sc_concref_r<sc_bitref_r<T>,sc_lv_base>(
877  *a.clone(), *new sc_lv_base( b ), 3 );
878 }
879 
880 template <class T>
881 inline
883 concat( const char* a, sc_bitref_r<T> b )
884 {
886  *new sc_lv_base( a ), *b.clone(), 3 );
887 }
888 
889 template <class T>
890 inline
891 sc_concref_r<sc_bitref_r<T>,sc_lv_base>
893 {
894  return sc_concref_r<sc_bitref_r<T>,sc_lv_base>(
895  *a.clone(), *new sc_lv_base( b, 1 ), 3 );
896 }
897 
898 template <class T>
899 inline
902 {
904  *new sc_lv_base( a, 1 ), *b.clone(), 3 );
905 }
906 
907 template <class T>
908 inline
909 sc_concref_r<sc_bitref_r<T>,sc_bv_base>
911 {
912  return sc_concref_r<sc_bitref_r<T>,sc_bv_base>
913  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
914 }
915 
916 template <class T>
917 inline
920 {
922  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
923 }
924 
925 
926 #ifdef SC_DT_MIXED_COMMA_OPERATORS
927 
928 template <class T>
929 inline
930 sc_concref_r<sc_bitref_r<T>,sc_lv_base>
931 operator , ( sc_bitref<T> a, const char* b )
932 {
933  return sc_concref_r<sc_bitref_r<T>,sc_lv_base>(
934  *a.clone(), *new sc_lv_base( b ), 3 );
935 }
936 
937 template <class T>
938 inline
940 operator , ( const char* a, sc_bitref<T> b )
941 {
943  *new sc_lv_base( a ), *b.clone(), 3 );
944 }
945 
946 template <class T>
947 inline
948 sc_concref_r<sc_bitref_r<T>,sc_lv_base>
950 {
951  return sc_concref_r<sc_bitref_r<T>,sc_lv_base>(
952  *a.clone(), *new sc_lv_base( b, 1 ), 3 );
953 }
954 
955 template <class T>
956 inline
959 {
961  *new sc_lv_base( a, 1 ), *b.clone(), 3 );
962 }
963 
964 template <class T>
965 inline
966 sc_concref_r<sc_bitref_r<T>,sc_bv_base>
968 {
969  return sc_concref_r<sc_bitref_r<T>,sc_bv_base>
970  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
971 }
972 
973 template <class T>
974 inline
977 {
979  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
980 }
981 
982 
983 template <class T>
984 inline
985 sc_concref_r<sc_bitref_r<T>,sc_lv_base>
986 concat( sc_bitref<T> a, const char* b )
987 {
988  return sc_concref_r<sc_bitref_r<T>,sc_lv_base>(
989  *a.clone(), *new sc_lv_base( b ), 3 );
990 }
991 
992 template <class T>
993 inline
995 concat( const char* a, sc_bitref<T> b )
996 {
998  *new sc_lv_base( a ), *b.clone(), 3 );
999 }
1000 
1001 template <class T>
1002 inline
1003 sc_concref_r<sc_bitref_r<T>,sc_lv_base>
1005 {
1006  return sc_concref_r<sc_bitref_r<T>,sc_lv_base>(
1007  *a.clone(), *new sc_lv_base( b, 1 ), 3 );
1008 }
1009 
1010 template <class T>
1011 inline
1014 {
1016  *new sc_lv_base( a, 1 ), *b.clone(), 3 );
1017 }
1018 
1019 template <class T>
1020 inline
1021 sc_concref_r<sc_bitref_r<T>,sc_bv_base>
1023 {
1024  return sc_concref_r<sc_bitref_r<T>,sc_bv_base>
1025  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
1026 }
1027 
1028 template <class T>
1029 inline
1032 {
1034  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
1035 }
1036 
1037 #endif
1038 
1039 
1046 // r-value concatenation operators and functions
1047 
1048 template <class T>
1049 inline
1051 operator , ( sc_subref_r<T> a, const char* b )
1052 {
1053  return sc_concref_r<sc_subref_r<T>,sc_lv_base>(
1054  *a.clone(), *new sc_lv_base( b ), 3 );
1055 }
1056 
1057 template <class T>
1058 inline
1060 operator , ( const char* a, sc_subref_r<T> b )
1061 {
1063  *new sc_lv_base( a ), *b.clone(), 3 );
1064 }
1065 
1066 template <class T>
1067 inline
1068 sc_concref_r<sc_subref_r<T>,sc_lv_base>
1070 {
1071  return sc_concref_r<sc_subref_r<T>,sc_lv_base>(
1072  *a.clone(), *new sc_lv_base( b, 1 ), 3 );
1073 }
1074 
1075 template <class T>
1076 inline
1079 {
1081  *new sc_lv_base( a, 1 ), *b.clone(), 3 );
1082 }
1083 
1084 template <class T>
1085 inline
1086 sc_concref_r<sc_subref_r<T>,sc_bv_base>
1088 {
1089  return sc_concref_r<sc_subref_r<T>,sc_bv_base>
1090  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
1091 }
1092 
1093 template <class T>
1094 inline
1097 {
1099  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
1100 }
1101 
1102 
1103 template <class T>
1104 inline
1105 sc_concref_r<sc_subref_r<T>,sc_lv_base>
1106 concat( sc_subref_r<T> a, const char* b )
1107 {
1108  return sc_concref_r<sc_subref_r<T>,sc_lv_base>(
1109  *a.clone(), *new sc_lv_base( b ), 3 );
1110 }
1111 
1112 template <class T>
1113 inline
1115 concat( const char* a, sc_subref_r<T> b )
1116 {
1118  *new sc_lv_base( a ), *b.clone(), 3 );
1119 }
1120 
1121 template <class T>
1122 inline
1123 sc_concref_r<sc_subref_r<T>,sc_lv_base>
1125 {
1126  return sc_concref_r<sc_subref_r<T>,sc_lv_base>(
1127  *a.clone(), *new sc_lv_base( b, 1 ), 3 );
1128 }
1129 
1130 template <class T>
1131 inline
1134 {
1136  *new sc_lv_base( a, 1 ), *b.clone(), 3 );
1137 }
1138 
1139 template <class T>
1140 inline
1141 sc_concref_r<sc_subref_r<T>,sc_bv_base>
1143 {
1144  return sc_concref_r<sc_subref_r<T>,sc_bv_base>
1145  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
1146 }
1147 
1148 template <class T>
1149 inline
1152 {
1154  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
1155 }
1156 
1157 
1158 #ifdef SC_DT_MIXED_COMMA_OPERATORS
1159 
1160 template <class T>
1161 inline
1162 sc_concref_r<sc_subref_r<T>,sc_lv_base>
1163 operator , ( sc_subref<T> a, const char* b )
1164 {
1165  return sc_concref_r<sc_subref_r<T>,sc_lv_base>(
1166  *a.clone(), *new sc_lv_base( b ), 3 );
1167 }
1168 
1169 template <class T>
1170 inline
1172 operator , ( const char* a, sc_subref<T> b )
1173 {
1175  *new sc_lv_base( a ), *b.clone(), 3 );
1176 }
1177 
1178 template <class T>
1179 inline
1180 sc_concref_r<sc_subref_r<T>,sc_lv_base>
1182 {
1183  return sc_concref_r<sc_subref_r<T>,sc_lv_base>(
1184  *a.clone(), *new sc_lv_base( b, 1 ), 3 );
1185 }
1186 
1187 template <class T>
1188 inline
1191 {
1193  *new sc_lv_base( a, 1 ), *b.clone(), 3 );
1194 }
1195 
1196 template <class T>
1197 inline
1198 sc_concref_r<sc_subref_r<T>,sc_bv_base>
1200 {
1201  return sc_concref_r<sc_subref_r<T>,sc_bv_base>
1202  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
1203 }
1204 
1205 template <class T>
1206 inline
1209 {
1211  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
1212 }
1213 
1214 
1215 template <class T>
1216 inline
1217 sc_concref_r<sc_subref_r<T>,sc_lv_base>
1218 concat( sc_subref<T> a, const char* b )
1219 {
1220  return sc_concref_r<sc_subref_r<T>,sc_lv_base>(
1221  *a.clone(), *new sc_lv_base( b ), 3 );
1222 }
1223 
1224 template <class T>
1225 inline
1227 concat( const char* a, sc_subref<T> b )
1228 {
1230  *new sc_lv_base( a ), *b.clone(), 3 );
1231 }
1232 
1233 template <class T>
1234 inline
1235 sc_concref_r<sc_subref_r<T>,sc_lv_base>
1237 {
1238  return sc_concref_r<sc_subref_r<T>,sc_lv_base>(
1239  *a.clone(), *new sc_lv_base( b, 1 ), 3 );
1240 }
1241 
1242 template <class T>
1243 inline
1246 {
1248  *new sc_lv_base( a, 1 ), *b.clone(), 3 );
1249 }
1250 
1251 template <class T>
1252 inline
1253 sc_concref_r<sc_subref_r<T>,sc_bv_base>
1255 {
1256  return sc_concref_r<sc_subref_r<T>,sc_bv_base>
1257  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
1258 }
1259 
1260 template <class T>
1261 inline
1264 {
1266  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
1267 }
1268 
1269 #endif
1270 
1271 
1278 template <class X>
1279 inline
1280 sc_subref<X>&
1282 {
1283  sc_lv_base t( b ); // (partial) self assignment protection
1284  int len = sc_min( this->length(), t.length() );
1285  if( ! this->reversed() ) {
1286  for( int i = len - 1; i >= 0; -- i ) {
1287  this->m_obj.set_bit( this->m_lo + i, t[i].value() );
1288  }
1289  } else {
1290  for( int i = len - 1; i >= 0; -- i ) {
1291  this->m_obj.set_bit( this->m_lo - i, t[i].value() );
1292  }
1293  }
1294  return *this;
1295 }
1296 
1297 template <class X>
1298 inline
1299 sc_subref<X>&
1301 {
1302  sc_lv_base t( b ); // (partial) self assignment protection
1303  int len = sc_min( this->length(), t.length() );
1304  if( ! this->reversed() ) {
1305  for( int i = len - 1; i >= 0; -- i ) {
1306  this->m_obj.set_bit( this->m_lo + i, t[i].value() );
1307  }
1308  } else {
1309  for( int i = len - 1; i >= 0; -- i ) {
1310  this->m_obj.set_bit( this->m_lo - i, t[i].value() );
1311  }
1312  }
1313  return *this;
1314 }
1315 
1316 
1323 // r-value concatenation operators and functions
1324 
1325 template <class T1, class T2>
1326 inline
1329 {
1331  *a.clone(), *new sc_lv_base( b ), 3 );
1332 }
1333 
1334 template <class T1, class T2>
1335 inline
1338 {
1340  *new sc_lv_base( a ), *b.clone(), 3 );
1341 }
1342 
1343 template <class T1, class T2>
1344 inline
1347 {
1348  return sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>(
1349  *a.clone(), *new sc_lv_base( b, 1 ), 3 );
1350 }
1351 
1352 template <class T1, class T2>
1353 inline
1356 {
1358  *new sc_lv_base( a, 1 ), *b.clone(), 3 );
1359 }
1360 
1361 template <class T1, class T2>
1362 inline
1363 sc_concref_r<sc_concref_r<T1,T2>,sc_bv_base>
1365 {
1366  return sc_concref_r<sc_concref_r<T1,T2>,sc_bv_base>
1367  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
1368 }
1369 
1370 template <class T1, class T2>
1371 inline
1374 {
1376  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
1377 }
1378 
1379 
1380 template <class T1, class T2>
1381 inline
1382 sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1383 concat( sc_concref_r<T1,T2> a, const char* b )
1384 {
1385  return sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1386  ( *a.clone(), *new sc_lv_base( b ), 3 );
1387 }
1388 
1389 template <class T1, class T2>
1390 inline
1392 concat( const char* a, sc_concref_r<T1,T2> b )
1393 {
1395  ( *new sc_lv_base( a ), *b.clone(), 3 );
1396 }
1397 
1398 template <class T1, class T2>
1399 inline
1400 sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1402 {
1403  return sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1404  ( *a.clone(), *new sc_lv_base( b, 1 ), 3 );
1405 }
1406 
1407 template <class T1, class T2>
1408 inline
1411 {
1413  ( *new sc_lv_base( a, 1 ), *b.clone(), 3 );
1414 }
1415 
1416 template <class T1, class T2>
1417 inline
1418 sc_concref_r<sc_concref_r<T1,T2>,sc_bv_base>
1420 {
1421  return sc_concref_r<sc_concref_r<T1,T2>,sc_bv_base>
1422  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
1423 }
1424 
1425 template <class T1, class T2>
1426 inline
1429 {
1431  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
1432 }
1433 
1434 
1435 #ifdef SC_DT_MIXED_COMMA_OPERATORS
1436 
1437 template <class T1, class T2>
1438 inline
1439 sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1441 {
1442  return sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1443  ( *a.clone(), *new sc_lv_base( b ), 3 );
1444 }
1445 
1446 template <class T1, class T2>
1447 inline
1450 {
1452  ( *new sc_lv_base( a ), *b.clone(), 3 );
1453 }
1454 
1455 template <class T1, class T2>
1456 inline
1457 sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1459 {
1460  return sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1461  ( *a.clone(), *new sc_lv_base( b, 1 ), 3 );
1462 }
1463 
1464 template <class T1, class T2>
1465 inline
1468 {
1470  ( *new sc_lv_base( a, 1 ), *b.clone(), 3 );
1471 }
1472 
1473 template <class T1, class T2>
1474 inline
1475 sc_concref_r<sc_concref_r<T1,T2>,sc_bv_base>
1477 {
1478  return sc_concref_r<sc_concref_r<T1,T2>,sc_bv_base>
1479  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
1480 }
1481 
1482 template <class T1, class T2>
1483 inline
1486 {
1488  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
1489 }
1490 
1491 
1492 template <class T1, class T2>
1493 inline
1494 sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1495 concat( sc_concref<T1,T2> a, const char* b )
1496 {
1497  return sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1498  ( *a.clone(), *new sc_lv_base( b ), 3 );
1499 }
1500 
1501 template <class T1, class T2>
1502 inline
1504 concat( const char* a, sc_concref<T1,T2> b )
1505 {
1507  ( *new sc_lv_base( a ), *b.clone(), 3 );
1508 }
1509 
1510 template <class T1, class T2>
1511 inline
1512 sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1514 {
1515  return sc_concref_r<sc_concref_r<T1,T2>,sc_lv_base>
1516  ( *a.clone(), *new sc_lv_base( b, 1 ), 3 );
1517 }
1518 
1519 template <class T1, class T2>
1520 inline
1523 {
1525  ( *new sc_lv_base( a, 1 ), *b.clone(), 3 );
1526 }
1527 
1528 template <class T1, class T2>
1529 inline
1530 sc_concref_r<sc_concref_r<T1,T2>,sc_bv_base>
1532 {
1533  return sc_concref_r<sc_concref_r<T1,T2>,sc_bv_base>
1534  ( *a.clone(), *new sc_bv_base( b, 1 ), 3 );
1535 }
1536 
1537 template <class T1, class T2>
1538 inline
1541 {
1543  ( *new sc_bv_base( a, 1 ), *b.clone(), 3 );
1544 }
1545 
1546 #endif
1547 
1548 
1556 // r-value concatenation operators and functions
1557 
1558 template <class T>
1559 inline
1561 operator , ( const sc_proxy<T>& a, const char* b )
1562 {
1564  ( a.back_cast(), *new sc_lv_base( b ), 2 );
1565 }
1566 
1567 template <class T>
1568 inline
1570 operator , ( const char* a, const sc_proxy<T>& b )
1571 {
1573  ( *new sc_lv_base( a ), b.back_cast(), 1 );
1574 }
1575 
1576 template <class T>
1577 inline
1579 operator , ( const sc_proxy<T>& a, const sc_logic& b )
1580 {
1582  ( a.back_cast(), *new sc_lv_base( b, 1 ), 2 );
1583 }
1584 
1585 template <class T>
1586 inline
1588 operator , ( const sc_logic& a, const sc_proxy<T>& b )
1589 {
1591  ( *new sc_lv_base( a, 1 ), b.back_cast(), 1 );
1592 }
1593 
1594 template <class T>
1595 inline
1597 operator , ( const sc_proxy<T>& a, bool b )
1598 {
1600  ( a.back_cast(), *new sc_bv_base( b, 1 ), 2 );
1601 }
1602 
1603 template <class T>
1604 inline
1606 operator , ( bool a, const sc_proxy<T>& b )
1607 {
1609  ( *new sc_bv_base( a, 1 ), b.back_cast(), 1 );
1610 }
1611 
1612 
1613 template <class T>
1614 inline
1616 concat( const sc_proxy<T>& a, const char* b )
1617 {
1619  ( a.back_cast(), *new sc_lv_base( b ), 2 );
1620 }
1621 
1622 template <class T>
1623 inline
1625 concat( const char* a, const sc_proxy<T>& b )
1626 {
1628  ( *new sc_lv_base( a ), b.back_cast(), 1 );
1629 }
1630 
1631 template <class T>
1632 inline
1634 concat( const sc_proxy<T>& a, const sc_logic& b )
1635 {
1637  ( a.back_cast(), *new sc_lv_base( b, 1 ), 2 );
1638 }
1639 
1640 template <class T>
1641 inline
1643 concat( const sc_logic& a, const sc_proxy<T>& b )
1644 {
1646  ( *new sc_lv_base( a, 1 ), b.back_cast(), 1 );
1647 }
1648 
1649 template <class T>
1650 inline
1652 concat( const sc_proxy<T>& a, bool b )
1653 {
1655  ( a.back_cast(), *new sc_bv_base( b, 1 ), 2 );
1656 }
1657 
1658 template <class T>
1659 inline
1661 concat( bool a, const sc_proxy<T>& b )
1662 {
1664  ( *new sc_bv_base( a, 1 ), b.back_cast(), 1 );
1665 }
1666 
1667 
1668 #ifdef SC_DT_MIXED_COMMA_OPERATORS
1669 
1670 template <class T>
1671 inline
1673 operator , ( sc_proxy<T>& a, const char* b )
1674 {
1676  ( a.back_cast(), *new sc_lv_base( b ), 2 );
1677 }
1678 
1679 template <class T>
1680 inline
1682 operator , ( const char* a, sc_proxy<T>& b )
1683 {
1685  ( *new sc_lv_base( a ), b.back_cast(), 1 );
1686 }
1687 
1688 template <class T>
1689 inline
1692 {
1694  ( a.back_cast(), *new sc_lv_base( b, 1 ), 2 );
1695 }
1696 
1697 template <class T>
1698 inline
1701 {
1703  ( *new sc_lv_base( a, 1 ), b.back_cast(), 1 );
1704 }
1705 
1706 template <class T>
1707 inline
1710 {
1712  ( a.back_cast(), *new sc_bv_base( b, 1 ), 2 );
1713 }
1714 
1715 template <class T>
1716 inline
1719 {
1721  ( *new sc_bv_base( a, 1 ), b.back_cast(), 1 );
1722 }
1723 
1724 
1725 template <class T>
1726 inline
1728 concat( sc_proxy<T>& a, const char* b )
1729 {
1731  ( a.back_cast(), *new sc_lv_base( b ), 2 );
1732 }
1733 
1734 template <class T>
1735 inline
1737 concat( const char* a, sc_proxy<T>& b )
1738 {
1740  ( *new sc_lv_base( a ), b.back_cast(), 1 );
1741 }
1742 
1743 template <class T>
1744 inline
1747 {
1749  ( a.back_cast(), *new sc_lv_base( b, 1 ), 2 );
1750 }
1751 
1752 template <class T>
1753 inline
1756 {
1758  ( *new sc_lv_base( a, 1 ), b.back_cast(), 1 );
1759 }
1760 
1761 template <class T>
1762 inline
1764 concat( sc_proxy<T>& a, bool b )
1765 {
1767  ( a.back_cast(), *new sc_bv_base( b, 1 ), 2 );
1768 }
1769 
1770 template <class T>
1771 inline
1773 concat( bool a, sc_proxy<T>& b )
1774 {
1776  ( *new sc_bv_base( a, 1 ), b.back_cast(), 1 );
1777 }
1778 
1779 #endif
1780 
1781 // extern template instantiations
1784 
1785 } // namespace sc_dt
1786 
1787 
1788 #endif
int size() const
Definition: sc_lv_base.h:210
base_type::value_type value_type
Definition: sc_lv_base.h:106
int length() const
Definition: sc_lv_base.h:207
#define sc_assert(expr)
Definition: sc_report.h:270
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > concat(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
const sc_digit SC_DIGIT_TWO
Definition: sc_proxy.h:101
X & lrotate(int n)
Definition: sc_lv_base.h:673
sc_concref_r< X, Y > * clone() const
void set_word(int wi, sc_digit w)
Definition: sc_lv_base.h:223
SC_API const sc_logic SC_LOGIC_X
int length() const
Definition: sc_uint_base.h:762
const T sc_min(const T &a, const T &b)
Definition: sc_macros.h:43
const int SC_DIGIT_SIZE
Definition: sc_proxy.h:97
SC_API void sc_proxy_out_of_bounds(const char *msg=NULL, int64 val=0)
bool operator==(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:289
#define DEFN_BITWISE_OR_OP_T_B(tp)
Definition: sc_lv_base.h:515
Base class template for bit/logic vector classes.
#define DEFN_BITWISE_XOR_ASN_OP_T(tp)
Definition: sc_lv_base.h:555
sc_subref_r< X > * clone() const
Proxy class for sc_proxy part selection (r-value and l-value).
X & operator&=(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_lv_base.h:342
const sc_lv_base operator~() const
Definition: sc_lv_base.h:330
virtual ~sc_lv_base()
Definition: sc_lv_base.h:154
int length() const
Definition: sc_unsigned.h:1244
#define DEFN_BITWISE_XOR_OP_T_B(tp)
Definition: sc_lv_base.h:617
int64_t int64
Definition: sc_nbdefs.h:188
value_type get_bit(int i) const
Definition: sc_lv_base.h:279
Base class for sc_uint.
Definition: sc_uint_base.h:534
sc_digit get_cword(int wi) const
Definition: sc_lv_base.h:227
X & operator|=(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_lv_base.h:444
Arbitrary precision signed number.
Definition: sc_signed.h:1099
const sc_digit SC_DIGIT_ONE
Definition: sc_proxy.h:100
Proxy class for sc_proxy part selection (r-value only).
Base class template for bit/logic vector classes.
Definition: sc_proxy.h:84
uint64_t uint64
Definition: sc_nbdefs.h:189
Arbitrary precision unsigned number.
Definition: sc_unsigned.h:1001
Four-valued logic type.
Definition: sc_logic.h:104
unsigned int sc_digit
Definition: sc_nbdefs.h:179
sc_digit * m_ctrl
Definition: sc_lv_base.h:245
X & b_and_assign_(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_proxy.h:1068
uint64 const sc_uint_base int b
Definition: sc_fxval.h:1005
int length() const
Definition: sc_signed.h:1342
const sc_lv_base operator<<(int n) const
Definition: sc_lv_base.h:648
Base class for sc_int.
Definition: sc_int_base.h:548
const sc_bit operator|(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:338
const sc_lv_base lrotate(const sc_proxy< X > &x, int n)
Definition: sc_lv_base.h:698
sc_lv_base(int length_=sc_length_param().len())
Definition: sc_lv_base.h:111
#define DEFN_BITWISE_OR_OP_T_A(tp)
Definition: sc_lv_base.h:488
#define DEFN_BITWISE_AND_ASN_OP_T(tp)
Definition: sc_lv_base.h:351
Arbitrary size logic vector base class.
Definition: sc_lv_base.h:91
#define DEFN_BITWISE_AND_OP_T_A(tp)
Definition: sc_lv_base.h:386
sc_subref< X > * clone() const
sc_concref_r< sc_bitref_r< T1 >, sc_bitref_r< T2 > > operator,(sc_bitref_r< T1 >, sc_bitref_r< T2 >)
Arbitrary size bit vector class.
const sc_lv_base operator>>(int n) const
Definition: sc_lv_base.h:661
const sc_lv_base reverse(const sc_proxy< X > &x)
Definition: sc_lv_base.h:747
sc_clock period is zero sc_clock low time is zero sc_fifo< T > cannot have more than one writer bind interface to port failed complete binding failed remove port failed insert primitive channel failed sc_signal< T > cannot have more than one driver resolved port not bound to resolved signal sc_semaphore requires an initial value
X & b_or_assign_(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_proxy.h:1092
void set_bit(int i, value_type value)
Definition: sc_lv_base.h:289
#define DEFN_REL_OP_T(tp)
Definition: sc_lv_base.h:779
X & back_cast()
Definition: sc_proxy.h:213
#define DEFN_BITWISE_OR_ASN_OP_T(tp)
Definition: sc_lv_base.h:453
void set_cword(int wi, sc_digit w)
Definition: sc_lv_base.h:230
const sc_bit operator^(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:341
Proxy class for sc_proxy bit selection (r-value only).
Length parameter type.
X & operator^=(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_lv_base.h:546
C++ implementation of logic type. Behaves.
Report ids for the datatypes/bit code.
const sc_digit SC_DIGIT_ZERO
Definition: sc_proxy.h:99
#define SC_API_TEMPLATE_DECL_
Definition: sc_cmnhdr.h:177
sc_subref< X > & operator=(const sc_proxy< Y > &a)
sc_lv_base(const sc_proxy< X > &a)
Definition: sc_lv_base.h:125
void assign_p_(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_proxy.h:745
int length() const
Definition: sc_int_base.h:777
X & b_xor_assign_(sc_proxy< X > &a, const sc_proxy< Y > &b)
Definition: sc_proxy.h:1116
X & rrotate(int n)
Definition: sc_lv_base.h:710
const sc_lv_base rrotate(const sc_proxy< X > &x, int n)
Definition: sc_lv_base.h:735
const sc_bit operator&(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:335
#define DEFN_BITWISE_XOR_OP_T_A(tp)
Definition: sc_lv_base.h:590
sc_digit get_word(int wi) const
Definition: sc_lv_base.h:216
sc_digit * m_data
Definition: sc_lv_base.h:244
class SC_API sc_logic
Definition: sc_signal_ifs.h:43
sc_concref< X, Y > * clone() const
#define DEFN_BITWISE_AND_OP_T_B(tp)
Definition: sc_lv_base.h:413
sc_bitref< X > * clone() const
Arbitrary size bit vector base class.
Definition: sc_bv_base.h:80
sc_lv_base(const sc_logic &a, int length_=sc_length_param().len())
Definition: sc_lv_base.h:115
#define SC_API
Definition: sc_cmnhdr.h:168
sc_proxy< sc_lv_base > base_type
Definition: sc_lv_base.h:105