SystemC 3.0.0
Accellera SystemC proof-of-concept library
sc_proxy.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_proxy.h -- Proxy base class for vector data types.
23
24 This class is created for several purposes:
25 1) hiding operators from the global namespace that would be
26 otherwise found by Koenig lookup
27 2) avoiding repeating the same operations in every class
28 including proxies that could also be achieved by common
29 base class, but this method allows
30 3) improve performance by using non-virtual functions
31
32 Original Author: Gene Bushuyev, Synopsys, Inc.
33
34 *****************************************************************************/
35
36/*****************************************************************************
37
38 MODIFICATION LOG - modifiers, enter your name, affiliation, date and
39 changes you are making here.
40
41 Name, Affiliation, Date:
42 Description of Modification:
43
44 *****************************************************************************/
45
46// $Log: sc_proxy.h,v $
47// Revision 1.3 2010/12/07 20:09:07 acg
48// Andy Goodrich: Fix for returning enough data
49//
50// Revision 1.2 2009/02/28 00:26:14 acg
51// Andy Goodrich: bug fixes.
52//
53// Revision 1.1.1.1 2006/12/15 20:31:36 acg
54// SystemC 2.2
55//
56// Revision 1.3 2006/01/13 18:53:53 acg
57// Andy Goodrich: added $Log command so that CVS comments are reproduced in
58// the source.
59//
60
61#ifndef SC_PROXY_H
62#define SC_PROXY_H
63
64
76
77
78namespace sc_dt
79{
80
81// classes defined in this module
82template <class X> class sc_proxy;
83
84// forward class declarations
85class sc_bv_base;
86class sc_lv_base;
87template <class X> class sc_bitref_r;
88template <class X> class sc_bitref;
89template <class X> class sc_subref_r;
90template <class X> class sc_subref;
91template <class X, class Y> class sc_concref_r;
92template <class X, class Y> class sc_concref;
93
94
95const int SC_DIGIT_SIZE = BITS_PER_BYTE * sizeof( sc_digit );
96
100
101SC_API void sc_proxy_out_of_bounds(const char* msg = NULL, int64 val = 0);
102
103// assignment functions; forward declarations
104
105template <class X, class Y>
106inline
107void
108assign_p_( sc_proxy<X>& px, const sc_proxy<Y>& py );
109
110// Vector types that are not derived from sc_proxy must have a length()
111// function and an operator [].
112
113template <class X, class T>
114inline
115void
116assign_v_( sc_proxy<X>& px, const T& a );
117
118
119// other functions; forward declarations
120
121SC_API std::string convert_to_bin( const char* s );
122SC_API std::string convert_to_fmt( const std::string& s, sc_numrep numrep, bool );
123
124// ----------------------------------------------------------------------------
125// CLASS TEMPLATE : sc_proxy_traits
126//
127// Template traits helper to select the correct bit/value/vector_types for
128// sc_proxy-based vector classes.
129//
130// All types derived from/based on a bit-vector contain typedef to a plain bool,
131// all others point to the sc_logic_value_t/sc_logic/sc_lv_base types.
132// ----------------------------------------------------------------------------
133
134template<typename X> struct sc_proxy_traits;
135
136template<> struct sc_proxy_traits<sc_bv_base>
137{
139 typedef bool value_type;
140 typedef sc_logic bit_type; // sc_logic needed for mixed expressions
142};
143
144template<> struct sc_proxy_traits<sc_lv_base>
145{
150};
151
152
153template<typename X> struct sc_proxy_traits<sc_bitref_r<X> >
154 : sc_proxy_traits<X> {};
155
156template<typename X> struct sc_proxy_traits<sc_bitref<X> >
157 : sc_proxy_traits<X> {};
158
159
160template<typename X> struct sc_proxy_traits<sc_subref_r<X> >
161 : sc_proxy_traits<X> {};
162
163template<typename X> struct sc_proxy_traits<sc_subref<X> >
164 : sc_proxy_traits<X> {};
165
166
167template<typename X> struct sc_proxy_traits<sc_proxy<X> >
168 : sc_proxy_traits<X> {};
169
170
171template< typename X, typename Y > struct sc_mixed_proxy_traits_helper
172 : sc_proxy_traits<sc_lv_base> {}; // logic vector by default
173
174template<typename X> struct sc_mixed_proxy_traits_helper<X,X>
175 : X {};
176
177
178template<typename X, typename Y> struct sc_proxy_traits< sc_concref_r<X,Y> >
179 : sc_mixed_proxy_traits_helper< typename X::traits_type
180 , typename Y::traits_type >
181{};
182
183template<typename X, typename Y> struct sc_proxy_traits<sc_concref<X,Y> >
184 : sc_mixed_proxy_traits_helper< typename X::traits_type
185 , typename Y::traits_type >
186{};
187
188
189// ----------------------------------------------------------------------------
190// CLASS TEMPLATE : sc_proxy
191//
192// Base class template for bit/logic vector classes.
193// (Barton/Nackmann implementation)
194// ----------------------------------------------------------------------------
195
196template <class X>
197class sc_proxy // #### : public sc_value_base
198{
199public:
201 typedef typename traits_type::bit_type bit_type;
202 typedef typename traits_type::value_type value_type;
203
204 // virtual destructor
205
206 virtual ~sc_proxy() {}
207
208
209 // casts
210
212 { return static_cast<X&>( *this ); }
213
214 const X& back_cast() const
215 { return static_cast<const X&>( *this ); }
216
217
218 // assignment operators
219
220 template <class Y>
221 X& assign_( const sc_proxy<Y>& a )
222 { assign_p_( *this, a ); return back_cast(); }
223
224 X& assign_( const char* a );
225 X& assign_( const bool* a );
226 X& assign_( const sc_logic* a );
227
228 X& assign_( const sc_unsigned& a )
229 { assign_v_( *this, a ); return back_cast(); }
230
231 X& assign_( const sc_signed& a )
232 { assign_v_( *this, a ); return back_cast(); }
233
234 X& assign_( const sc_uint_base& a )
235 { return assign_( (uint64) a ); }
236
237 X& assign_( const sc_int_base& a )
238 { return assign_( (int64) a ); }
239
240 X& assign_( unsigned int a );
241 X& assign_( int a );
242
243 X& assign_( unsigned long a );
244
245 X& assign_( long a );
246
248 X& assign_( int64 a );
249
250
251 // bitwise operators and functions
252
253 // bitwise complement
254
255 X& b_not();
256
257 sc_lv_base operator ~ () const;
258
259
260 // bitwise and
261
262 X& operator &= ( const char* b );
263 X& operator &= ( const bool* b );
264 X& operator &= ( const sc_logic* b );
267
269 { return operator &= ( (uint64) b ); }
270
272 { return operator &= ( (int64) b ); }
273
274 X& operator &= ( unsigned long b );
275 X& operator &= ( long b );
276
277 X& operator &= ( unsigned int b )
278 { return operator &= ( (unsigned long) b ); }
279
280 X& operator &= ( int b )
281 { return operator &= ( (long) b ); }
282
285
286
287 sc_lv_base operator & ( const char* b ) const;
288 sc_lv_base operator & ( const bool* b ) const;
294 sc_lv_base operator & ( unsigned long b ) const;
295 sc_lv_base operator & ( long b ) const;
296 sc_lv_base operator & ( unsigned int b ) const;
300
301
302 // bitwise or
303
304 X& operator |= ( const char* b );
305 X& operator |= ( const bool* b );
306 X& operator |= ( const sc_logic* b );
309
311 { return operator |= ( (uint64) b ); }
312
314 { return operator |= ( (int64) b ); }
315
316 X& operator |= ( unsigned long b );
317 X& operator |= ( long b );
318
319 X& operator |= ( unsigned int b )
320 { return operator |= ( (unsigned long) b ); }
321
322 X& operator |= ( int b )
323 { return operator |= ( (long) b ); }
324
327
328
329 sc_lv_base operator | ( const char* b ) const;
330 sc_lv_base operator | ( const bool* b ) const;
336 sc_lv_base operator | ( unsigned long b ) const;
337 sc_lv_base operator | ( long b ) const;
338 sc_lv_base operator | ( unsigned int b ) const;
342
343
344 // bitwise xor
345
346 X& operator ^= ( const char* b );
347 X& operator ^= ( const bool* b );
348 X& operator ^= ( const sc_logic* b );
351
353 { return operator ^= ( (uint64) b ); }
354
356 { return operator ^= ( (int64) b ); }
357
358 X& operator ^= ( unsigned long b );
359 X& operator ^= ( long b );
360
361 X& operator ^= ( unsigned int b )
362 { return operator ^= ( (unsigned long) b ); }
363
364 X& operator ^= ( int b )
365 { return operator ^= ( (long) b ); }
366
369
370
371 sc_lv_base operator ^ ( const char* b ) const;
372 sc_lv_base operator ^ ( const bool* b ) const;
378 sc_lv_base operator ^ ( unsigned long b ) const;
379 sc_lv_base operator ^ ( long b ) const;
380 sc_lv_base operator ^ ( unsigned int b ) const;
384
385
386 // bitwise left shift
387
388 X& operator <<= ( int n );
389
390 sc_lv_base operator << ( int n ) const;
391
392
393 // bitwise right shift
394
395 X& operator >>= ( int n );
396
397 sc_lv_base operator >> ( int n ) const;
398
399
400 // bitwise left rotate
401
402 X& lrotate( int n );
403
404
405 // bitwise right rotate
406
407 X& rrotate( int n );
408
409
410 // bitwise reverse
411
413
414
415 // bit selection
416
418 { return sc_bitref<X>( back_cast(), i ); }
419
421 { return sc_bitref_r<X>( back_cast(), i ); }
422
424 { return sc_bitref<X>( back_cast(), i ); }
425
426 sc_bitref_r<X> bit( int i ) const
427 { return sc_bitref_r<X>( back_cast(), i ); }
428
429
430 // part selection
431
432 sc_subref<X> operator () ( int hi, int lo )
433 { return sc_subref<X>( back_cast(), hi, lo ); }
434
435 sc_subref_r<X> operator () ( int hi, int lo ) const
436 { return sc_subref_r<X>( back_cast(), hi, lo ); }
437
438 sc_subref<X> range( int hi, int lo )
439 { return sc_subref<X>( back_cast(), hi, lo ); }
440
441 sc_subref_r<X> range( int hi, int lo ) const
442 { return sc_subref_r<X>( back_cast(), hi, lo ); }
443
444
445 // reduce functions
446
448
450 { return sc_logic::not_table[and_reduce()]; }
451
453
455 { return sc_logic::not_table[or_reduce()]; }
456
458
460 { return sc_logic::not_table[xor_reduce()]; }
461
462
463 // relational operators
464
465 bool operator == ( const char* b ) const;
466 bool operator == ( const bool* b ) const;
467 bool operator == ( const sc_logic* b ) const;
468 bool operator == ( const sc_unsigned& b ) const;
469 bool operator == ( const sc_signed& b ) const;
470 bool operator == ( const sc_uint_base& b ) const;
471 bool operator == ( const sc_int_base& b ) const;
472 bool operator == ( unsigned long b ) const;
473 bool operator == ( long b ) const;
474 bool operator == ( unsigned int b ) const;
475 bool operator == ( int b ) const;
476 bool operator == ( uint64 b ) const;
477 bool operator == ( int64 b ) const;
478
479
480 // explicit conversions to character string
481
482 std::string to_string() const;
483 std::string to_string( sc_numrep ) const;
484 std::string to_string( sc_numrep, bool ) const;
485
486
487 // explicit conversions
488
489 // because bit fields are unsigned to_uint64() is used for all to_XXXX conversions to
490 // native C++ types.
491 inline uint64 to_uint64() const;
492
493 inline int64 to_int64() const
494 { return to_uint64(); }
495
496 int to_int() const
497 { return (int)to_uint64(); }
498
499 unsigned int to_uint() const
500 { return (unsigned int)to_uint64(); }
501
502 long to_long() const
503 { return (long)to_uint64(); }
504
505 unsigned long to_ulong() const
506 { return (unsigned long)to_uint64(); }
507
508#ifdef SC_DT_DEPRECATED
509
510 int to_signed() const
511 { return to_int(); }
512
513 sc_digit to_unsigned() const
514 { return to_uint(); }
515
516#endif
517
518
519 // other methods
520
521 void print( ::std::ostream& os = ::std::cout ) const
522 {
523 // the test below will force printing in binary if decimal is
524 // specified.
525 if ( sc_io_base(os, SC_DEC) == SC_DEC )
526 os << to_string();
527 else
529 }
530
531 void scan( ::std::istream& is = ::std::cin );
532
533protected:
534
535 void check_bounds( int n ) const; // check if bit n accessible
536 void check_wbounds( int n ) const; // check if word n accessible
537};
538
539
540// ----------------------------------------------------------------------------
541
542// bitwise operators and functions
543
544// bitwise and
545
546template <class X, class Y>
547inline
548X&
549operator &= ( sc_proxy<X>& px, const sc_proxy<Y>& py );
550
551
552template <class X, class Y>
553inline
555operator & ( const sc_proxy<X>& px, const sc_proxy<Y>& py );
556
557
558#define DECL_BITWISE_AND_OP_T(tp) \
559template <class X> \
560inline \
561sc_lv_base \
562operator & ( tp b, const sc_proxy<X>& px );
563
564DECL_BITWISE_AND_OP_T(const char*)
565DECL_BITWISE_AND_OP_T(const bool*)
567DECL_BITWISE_AND_OP_T(const sc_unsigned&)
568DECL_BITWISE_AND_OP_T(const sc_signed&)
569DECL_BITWISE_AND_OP_T(const sc_uint_base&)
570DECL_BITWISE_AND_OP_T(const sc_int_base&)
571DECL_BITWISE_AND_OP_T(unsigned long)
573DECL_BITWISE_AND_OP_T(unsigned int)
577
578#undef DECL_BITWISE_AND_OP_T
579
580
581// bitwise or
582
583template <class X, class Y>
584inline
585X&
586operator |= ( sc_proxy<X>& px, const sc_proxy<Y>& py );
587
588
589template <class X, class Y>
590inline
591sc_lv_base
592operator | ( const sc_proxy<X>& px, const sc_proxy<Y>& py );
593
594
595#define DECL_BITWISE_OR_OP_T(tp) \
596template <class X> \
597inline \
598sc_lv_base \
599operator | ( tp a, const sc_proxy<X>& px );
600
601DECL_BITWISE_OR_OP_T(const char*)
602DECL_BITWISE_OR_OP_T(const bool*)
604DECL_BITWISE_OR_OP_T(const sc_unsigned&)
605DECL_BITWISE_OR_OP_T(const sc_signed&)
606DECL_BITWISE_OR_OP_T(const sc_uint_base&)
607DECL_BITWISE_OR_OP_T(const sc_int_base&)
608DECL_BITWISE_OR_OP_T(unsigned long)
610DECL_BITWISE_OR_OP_T(unsigned int)
614
615#undef DECL_BITWISE_OR_OP_T
616
617
618// bitwise xor
619
620template <class X, class Y>
621inline
622X&
623operator ^= ( sc_proxy<X>& px, const sc_proxy<Y>& py );
624
625
626template <class X, class Y>
627inline
628sc_lv_base
629operator ^ ( const sc_proxy<X>& px, const sc_proxy<Y>& py );
630
631
632#define DECL_BITWISE_XOR_OP_T(tp) \
633template <class X> \
634inline \
635sc_lv_base \
636operator ^ ( tp a, const sc_proxy<X>& px );
637
638DECL_BITWISE_XOR_OP_T(const char*)
639DECL_BITWISE_XOR_OP_T(const bool*)
641DECL_BITWISE_XOR_OP_T(const sc_unsigned&)
642DECL_BITWISE_XOR_OP_T(const sc_signed&)
643DECL_BITWISE_XOR_OP_T(const sc_uint_base&)
644DECL_BITWISE_XOR_OP_T(const sc_int_base&)
645DECL_BITWISE_XOR_OP_T(unsigned long)
647DECL_BITWISE_XOR_OP_T(unsigned int)
651
652#undef DECL_BITWISE_XOR_OP_T
653
654
655// relational operators
656
657template <class X, class Y>
658inline
659bool
660operator == ( const sc_proxy<X>& px, const sc_proxy<Y>& py );
661
662template <class X, class Y>
663inline
664bool
665operator != ( const sc_proxy<X>& px, const sc_proxy<Y>& py );
666
667
668#define DECL_REL_OP_T(tp) \
669template <class X> \
670inline \
671bool \
672operator == ( tp b, const sc_proxy<X>& px ); \
673 \
674template <class X> \
675inline \
676bool \
677operator != ( const sc_proxy<X>& px, tp b ); \
678 \
679template <class X> \
680inline \
681bool \
682operator != ( tp b, const sc_proxy<X>& px );
683
684DECL_REL_OP_T(const char*)
685DECL_REL_OP_T(const bool*)
687DECL_REL_OP_T(const sc_unsigned&)
688DECL_REL_OP_T(const sc_signed&)
689DECL_REL_OP_T(const sc_uint_base&)
690DECL_REL_OP_T(const sc_int_base&)
691DECL_REL_OP_T(unsigned long)
692DECL_REL_OP_T(long)
693DECL_REL_OP_T(unsigned int)
694DECL_REL_OP_T(int)
697
698#undef DECL_REL_OP_T
699
700
701// l-value concatenation
702
703// Due to the fact that temporary objects cannot be passed to non-const
704// references, we have to enumerate, use call by value, and use dynamic
705// memory allocation (and deallocation).
706
707
708// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
709
710template <class X>
711inline
712void
713get_words_( const X& x, int wi, sc_digit& x_dw, sc_digit& x_cw )
714{
715 x_dw = x.get_word( wi );
716 x_cw = x.get_cword( wi );
717}
718
719template <class X>
720inline
721void
722set_words_( X& x, int wi, sc_digit x_dw, sc_digit x_cw )
723{
724 x.set_word( wi, x_dw );
725 x.set_cword( wi, x_cw );
726}
727
728template <class X>
729inline
730void
731extend_sign_w_( X& x, int wi, bool sign )
732{
733 int sz = x.size();
734 unsigned int sgn = (sign ? ~SC_DIGIT_ZERO : SC_DIGIT_ZERO);
735 for( int i = wi; i < sz; ++ i ) {
736 set_words_( x, i, sgn, SC_DIGIT_ZERO );
737 }
738}
739
740
741// assignment functions
742
743template <class X, class Y>
744inline
745void
747{
748 if( (void*) &px != (void*) &py ) {
749 X& x = px.back_cast();
750 const Y& y = py.back_cast();
751 int sz = x.size();
752 int min_sz = sc_min( sz, y.size() );
753 int i = 0;
754 for( ; i < min_sz; ++ i ) {
755 set_words_( x, i, y.get_word( i ), y.get_cword( i ) );
756 }
757 // extend with zeros
758 extend_sign_w_( x, i, false );
759 x.clean_tail();
760 }
761}
762
763// Vector types that are not derived from sc_proxy, sc_int_base,
764// sc_uint_base, sc_signed, or sc_unsigned, must have a length()
765// function and an operator []. The vector argument type must support
766// accessing bits that are beyond the msb. The vector argument type
767// decides what to do there (e.g. sign extension or zero padding).
768
769template <class X, class T>
770inline
771void
772assign_v_( sc_proxy<X>& px, const T& a )
773{
774 X& x = px.back_cast();
775 int i;
776 int len_x = x.length();
777 int len_a = a.length();
778 if ( len_a > len_x ) len_a = len_x;
779 for( i = 0 ; i < len_a; ++ i ) {
780 x.set_bit( i, sc_logic_value_t( (bool) a[i] ) );
781 }
782 for( ; i < len_x; ++ i ) {
783 x.set_bit( i, sc_logic_value_t( false ) );
784 }
785}
786
787template <class X>
788inline
789void
791{
792 X& x = px.back_cast();
793 int i;
794 bool sign = a < 0;
795 int len_x = x.length();
796 int len_a = a.length();
797 if ( len_a > len_x ) len_a = len_x;
798 for( i = 0 ; i < len_a; ++ i ) {
799 x.set_bit( i, sc_logic_value_t( (bool) a[i] ) );
800 }
801 for( ; i < len_x; ++ i ) {
802 x.set_bit( i, sc_logic_value_t( sign ) );
803 }
804}
805
806template <class X>
807inline
808void
810{
811 X& x = px.back_cast();
812 int i;
813 bool sign = a.is_negative();
814 int len_x = x.length();
815 int len_a = a.length();
816 if ( len_a > len_x ) len_a = len_x;
817 for( i = 0 ; i < len_a; ++ i ) {
818 x.set_bit( i, sc_logic_value_t( (bool) a[i] ) );
819 }
820 for( ; i < len_x; ++ i ) {
821 x.set_bit( i, sc_logic_value_t( sign ) );
822 }
823}
824
825template <class X>
826inline
827void
829{
830 X& x = px.back_cast();
831 int i;
832 int len_x = x.length();
833 int len_a = a.length();
834 if ( len_a > len_x ) len_a = len_x;
835 for( i = 0 ; i < len_a; ++ i ) {
836 x.set_bit( i, sc_logic_value_t( (bool) a[i] ) );
837 }
838 for( ; i < len_x; ++ i ) {
839 x.set_bit( i, sc_logic_value_t( false ) );
840 }
841}
842
843template <class X>
844inline
845void
847{
848 X& x = px.back_cast();
849 int i;
850 int len_x = x.length();
851 int len_a = a.length();
852 if ( len_a > len_x ) len_a = len_x;
853 for( i = 0 ; i < len_a; ++ i ) {
854 x.set_bit( i, sc_logic_value_t( (bool) a[i] ) );
855 }
856 for( ; i < len_x; ++ i ) {
857 x.set_bit( i, sc_logic_value_t( false ) );
858 }
859}
860
861
862// assignment operators
863
864template <class X>
865inline
866X&
867sc_proxy<X>::assign_( const char* a )
868{
869 X& x = back_cast();
870 std::string s = convert_to_bin( a );
871 int len = x.length();
872 int s_len = s.length() - 1;
873 int min_len = sc_min( len, s_len );
874 int i = 0;
875 for( ; i < min_len; ++ i ) {
876 char c = s[s_len - i - 1];
877 x.set_bit( i, sc_logic::char_to_logic[(int)c] );
878 }
879 // if formatted, fill the rest with sign(s), otherwise fill with zeros
880 sc_logic_value_t fill = (s[s_len] == 'F' ? sc_logic_value_t( s[0] - '0' )
881 : sc_logic_value_t( 0 ));
882 for( ; i < len; ++ i ) {
883 x.set_bit( i, fill );
884 }
885 return x;
886}
887
888template <class X>
889inline
890X&
891sc_proxy<X>::assign_( const bool* a )
892{
893 // the length of 'a' must be larger than or equal to the length of 'this'
894 X& x = back_cast();
895 int len = x.length();
896 for( int i = 0; i < len; ++ i ) {
897 x.set_bit( i, sc_logic_value_t( a[i] ) );
898 }
899 return x;
900}
901
902template <class X>
903inline
904X&
906{
907 // the length of 'a' must be larger than or equal to the length of 'this'
908 X& x = back_cast();
909 int len = x.length();
910 for( int i = 0; i < len; ++ i ) {
911 x.set_bit( i, a[i].value() );
912 }
913 return x;
914}
915
916template <class X>
917inline
918X&
919sc_proxy<X>::assign_( unsigned int a )
920{
921 X& x = back_cast();
922 set_words_( x, 0, (sc_digit)a, SC_DIGIT_ZERO );
923 // extend with zeros
924 extend_sign_w_( x, 1, false );
925 x.clean_tail();
926 return x;
927}
928
929template <class X>
930inline
931X&
933{
934 X& x = back_cast();
935 set_words_( x, 0, (sc_digit) a, SC_DIGIT_ZERO );
936 // extend with sign(a)
937 extend_sign_w_( x, 1, (a < 0) );
938 x.clean_tail();
939 return x;
940}
941
942#if defined(SC_LONG_64)
943 template <class X>
944 inline
945 X&
946 sc_proxy<X>::assign_( unsigned long a )
947 {
948 X& x = back_cast();
950 if( x.size() > 1 ) {
951 set_words_( x, 1,
954 // extend with zeros
955 extend_sign_w_( x, 2, false );
956 }
957 x.clean_tail();
958 return x;
959 }
960
961 template <class X>
962 inline
963 X&
964 sc_proxy<X>::assign_( long a )
965 {
966 X& x = back_cast();
968 if( x.size() > 1 ) {
969 set_words_( x, 1,
972 // extend with sign(a)
973 extend_sign_w_( x, 2, (a < 0) );
974 }
975 x.clean_tail();
976 return x;
977 }
978
979#else
980 template <class X>
981 inline
982 X&
983 sc_proxy<X>::assign_( unsigned long a )
984 {
985 X& x = back_cast();
986 set_words_( x, 0, (sc_digit)a, SC_DIGIT_ZERO );
987 // extend with zeros
988 extend_sign_w_( x, 1, false );
989 x.clean_tail();
990 return x;
991 }
992
993 template <class X>
994 inline
995 X&
997 {
998 X& x = back_cast();
999 set_words_( x, 0, (sc_digit) a, SC_DIGIT_ZERO );
1000 // extend with sign(a)
1001 extend_sign_w_( x, 1, (a < 0) );
1002 x.clean_tail();
1003 return x;
1004 }
1005#endif
1006template <class X>
1007inline
1008X&
1010{
1011 X& x = back_cast();
1013 if( x.size() > 1 ) {
1014 set_words_( x, 1,
1015 ((sc_digit) (a >> SC_DIGIT_SIZE) & ~SC_DIGIT_ZERO),
1016 SC_DIGIT_ZERO );
1017 // extend with zeros
1018 extend_sign_w_( x, 2, false );
1019 }
1020 x.clean_tail();
1021 return x;
1022}
1023
1024template <class X>
1025inline
1026X&
1028{
1029 X& x = back_cast();
1031 if( x.size() > 1 ) {
1032 set_words_( x, 1,
1034 SC_DIGIT_ZERO );
1035 // extend with sign(a)
1036 extend_sign_w_( x, 2, (a < 0) );
1037 }
1038 x.clean_tail();
1039 return x;
1040}
1041
1042
1043// bitwise operators and functions
1044
1045// bitwise complement
1046
1047template <class X>
1048inline
1049X&
1051{
1052 X& x = back_cast();
1053 int sz = x.size();
1054 for( int i = 0; i < sz; ++ i ) {
1055 sc_digit x_dw, x_cw;
1056 get_words_( x, i, x_dw, x_cw );
1057 x.set_word( i, x_cw | ~x_dw );
1058 }
1059 x.clean_tail();
1060 return x;
1061}
1062
1063
1064// bitwise and
1065
1066template <class X, class Y>
1067inline
1068X&
1070{
1071 X& x = px.back_cast();
1072 const Y& y = py.back_cast();
1073 sc_assert( x.length() == y.length() );
1074 int sz = x.size();
1075 for( int i = 0; i < sz; ++ i ) {
1076 sc_digit x_dw, x_cw, y_dw, y_cw;
1077 get_words_( x, i, x_dw, x_cw );
1078 get_words_( y, i, y_dw, y_cw );
1079 sc_digit cw = (x_dw & y_cw) | (x_cw & y_dw) | (x_cw & y_cw);
1080 sc_digit dw = cw | (x_dw & y_dw);
1081 set_words_( x, i, dw, cw );
1082 }
1083 // tail cleaning not needed
1084 return x;
1085}
1086
1087
1088// bitwise or
1089
1090template <class X, class Y>
1091inline
1092X&
1094{
1095 X& x = px.back_cast();
1096 const Y& y = py.back_cast();
1097 sc_assert( x.length() == y.length() );
1098 int sz = x.size();
1099 for( int i = 0; i < sz; ++ i ) {
1100 sc_digit x_dw, x_cw, y_dw, y_cw;
1101 get_words_( x, i, x_dw, x_cw );
1102 get_words_( y, i, y_dw, y_cw );
1103 sc_digit cw = (x_cw & y_cw) | (x_cw & ~y_dw) | (~x_dw & y_cw);
1104 sc_digit dw = cw | x_dw | y_dw;
1105 set_words_( x, i, dw, cw );
1106 }
1107 // tail cleaning not needed
1108 return x;
1109}
1110
1111
1112// bitwise xor
1113
1114template <class X, class Y>
1115inline
1116X&
1118{
1119 X& x = a.back_cast();
1120 const Y& y = b.back_cast();
1121 sc_assert( x.length() == y.length() );
1122 int sz = x.size();
1123 for( int i = 0; i < sz; ++ i ) {
1124 sc_digit x_dw, x_cw, y_dw, y_cw;
1125 get_words_( x, i, x_dw, x_cw );
1126 get_words_( y, i, y_dw, y_cw );
1127 sc_digit cw = x_cw | y_cw;
1128 sc_digit dw = cw | (x_dw ^ y_dw);
1129 set_words_( x, i, dw, cw );
1130 }
1131 // tail cleaning not needed
1132 return x;
1133}
1134
1135
1136// bitwise left shift
1137
1138template <class X>
1139inline
1142{
1143 X& x = back_cast();
1144 if( n < 0 ) {
1145 sc_proxy_out_of_bounds( "left shift operation is only allowed with "
1146 "positive shift values, shift value = ", n );
1147 return x;
1148 }
1149 if( n >= x.length() ) {
1150 extend_sign_w_( x, 0, false );
1151 // no tail cleaning needed
1152 return x;
1153 }
1154 int sz = x.size();
1155 int wn = n / SC_DIGIT_SIZE;
1156 int bn = n % SC_DIGIT_SIZE;
1157 if( wn != 0 ) {
1158 // shift words
1159 int i = sz - 1;
1160 for( ; i >= wn; -- i ) {
1161 set_words_( x, i, x.get_word( i - wn ), x.get_cword( i - wn ) );
1162 }
1163 for( ; i >= 0; -- i ) {
1165 }
1166 }
1167 if( bn != 0 ) {
1168 // shift bits
1169 for( int i = sz - 1; i >= 1; -- i ) {
1170 sc_digit x_dw, x_cw;
1171 get_words_( x, i, x_dw, x_cw );
1172 x_dw <<= bn;
1173 x_dw |= x.get_word( i - 1 ) >> (SC_DIGIT_SIZE - bn);
1174 x_cw <<= bn;
1175 x_cw |= x.get_cword( i - 1 ) >> (SC_DIGIT_SIZE - bn);
1176 set_words_( x, i, x_dw, x_cw );
1177 }
1178 sc_digit x_dw, x_cw;
1179 get_words_( x, 0, x_dw, x_cw );
1180 x_dw <<= bn;
1181 x_cw <<= bn;
1182 set_words_( x, 0, x_dw, x_cw );
1183 }
1184 x.clean_tail();
1185 return x;
1186}
1187
1188
1189// bitwise right shift
1190
1191
1192template <class X>
1193inline
1194X&
1196{
1197 X& x = back_cast();
1198 if( n < 0 ) {
1199 sc_proxy_out_of_bounds( "right shift operation is only allowed with "
1200 "positive shift values, shift value = ", n );
1201 return x;
1202 }
1203 if( n >= x.length() ) {
1204 extend_sign_w_( x, 0, false );
1205 // no tail cleaning needed
1206 return x;
1207 }
1208 int sz = x.size();
1209 int wn = n / SC_DIGIT_SIZE;
1210 int bn = n % SC_DIGIT_SIZE;
1211 if( wn != 0 ) {
1212 // shift words
1213 int i = 0;
1214 for( ; i < (sz - wn); ++ i ) {
1215 set_words_( x, i, x.get_word( i + wn ), x.get_cword( i + wn ) );
1216 }
1217 for( ; i < sz; ++ i ) {
1219 }
1220 }
1221 if( bn != 0 ) {
1222 // shift bits
1223 for( int i = 0; i < (sz - 1); ++ i ) {
1224 sc_digit x_dw, x_cw;
1225 get_words_( x, i, x_dw, x_cw );
1226 x_dw >>= bn;
1227 x_dw |= x.get_word( i + 1 ) << (SC_DIGIT_SIZE - bn);
1228 x_cw >>= bn;
1229 x_cw |= x.get_cword( i + 1 ) << (SC_DIGIT_SIZE - bn);
1230 set_words_( x, i, x_dw, x_cw );
1231 }
1232 sc_digit x_dw, x_cw;
1233 get_words_( x, sz - 1, x_dw, x_cw );
1234 x_dw >>= bn;
1235 x_cw >>= bn;
1236 set_words_( x, sz - 1, x_dw, x_cw );
1237 }
1238 x.clean_tail();
1239 return x;
1240}
1241
1242
1243// bitwise left rotate
1244
1245template <class X>
1246inline
1248lrotate( const sc_proxy<X>& x, int n );
1249
1250
1251// bitwise right rotate
1252
1253template <class X>
1254inline
1256rrotate( const sc_proxy<X>& x, int n );
1257
1258
1259// bitwise reverse
1260
1261template <class X>
1262inline
1263X&
1265{
1266 X& x = back_cast();
1267 int len = x.length();
1268 int half_len = len / 2;
1269 for( int i = 0, j = len - 1; i < half_len; ++ i, --j ) {
1270 value_type t = x.get_bit( i );
1271 x.set_bit( i, x.get_bit( j ) );
1272 x.set_bit( j, t );
1273 }
1274 return x;
1275}
1276
1277template <class X>
1278inline
1280reverse( const sc_proxy<X>& a );
1281
1282
1283// reduce functions
1284
1285template <class X>
1286inline
1289{
1290 const X& x = back_cast();
1291 value_type result = value_type( 1 );
1292 int len = x.length();
1293 for( int i = 0; i < len; ++ i ) {
1294 result = sc_logic::and_table[result][x.get_bit( i )];
1295 }
1296 return result;
1297}
1298
1299template <class X>
1300inline
1303{
1304 const X& x = back_cast();
1305 value_type result = value_type( 0 );
1306 int len = x.length();
1307 for( int i = 0; i < len; ++ i ) {
1308 result = sc_logic::or_table[result][x.get_bit( i )];
1309 }
1310 return result;
1311}
1312
1313template <class X>
1314inline
1317{
1318 const X& x = back_cast();
1319 value_type result = value_type( 0 );
1320 int len = x.length();
1321 for( int i = 0; i < len; ++ i ) {
1322 result = sc_logic::xor_table[result][x.get_bit( i )];
1323 }
1324 return result;
1325}
1326
1327
1328// relational operators
1329
1330template <class X, class Y>
1331inline
1332bool
1333operator != ( const sc_proxy<X>& px, const sc_proxy<Y>& py )
1334{
1335 return !( px == py );
1336}
1337
1338
1339#define DEFN_REL_OP_T(tp) \
1340template <class X> \
1341inline \
1342bool \
1343operator == ( tp b, const sc_proxy<X>& px ) \
1344{ \
1345 return ( px == b ); \
1346} \
1347 \
1348template <class X> \
1349inline \
1350bool \
1351operator != ( const sc_proxy<X>& px, tp b ) \
1352{ \
1353 return !( px == b ); \
1354} \
1355 \
1356template <class X> \
1357inline \
1358bool \
1359operator != ( tp b, const sc_proxy<X>& px ) \
1360{ \
1361 return !( px == b ); \
1362}
1363
1364DEFN_REL_OP_T(const char*)
1365DEFN_REL_OP_T(const bool*)
1366DEFN_REL_OP_T(const sc_logic*)
1367DEFN_REL_OP_T(const sc_unsigned&)
1368DEFN_REL_OP_T(const sc_signed&)
1369DEFN_REL_OP_T(const sc_uint_base&)
1370DEFN_REL_OP_T(const sc_int_base&)
1371DEFN_REL_OP_T(unsigned long)
1372DEFN_REL_OP_T(long)
1373DEFN_REL_OP_T(unsigned int)
1374DEFN_REL_OP_T(int)
1377
1378#undef DEFN_REL_OP_T
1379
1380
1381// explicit conversions to character string
1382
1383template <class X>
1384inline
1385std::string
1387{
1388 const X& x = back_cast();
1389 int len = x.length();
1390 std::string s; // ( len + 1 );
1391 for( int i = 0; i < len; ++ i ) {
1392 s += sc_logic::logic_to_char[x.get_bit( len - i - 1 )];
1393 }
1394 return s;
1395}
1396
1397template <class X>
1398inline
1399std::string
1401{
1402 return convert_to_fmt( to_string(), numrep, true );
1403}
1404
1405template <class X>
1406inline
1407std::string
1408sc_proxy<X>::to_string( sc_numrep numrep, bool w_prefix ) const
1409{
1410 return convert_to_fmt( to_string(), numrep, w_prefix );
1411}
1412
1413
1414// other methods
1415
1416template <class X>
1417inline
1418void
1419sc_proxy<X>::scan( ::std::istream& is )
1420{
1421 std::string s;
1422 is >> s;
1423 back_cast() = s.c_str();
1424}
1425
1426
1427template <class X>
1428inline
1429void
1430sc_proxy<X>::check_bounds( int n ) const // check if bit n accessible
1431{
1432 if( n < 0 || n >= back_cast().length() ) {
1433 sc_proxy_out_of_bounds(NULL, n);
1434 sc_core::sc_abort(); // can't recover from here
1435 }
1436}
1437
1438template <class X>
1439inline
1440void
1441sc_proxy<X>::check_wbounds( int n ) const // check if word n accessible
1442{
1443 if( n < 0 || n >= back_cast().size() ) {
1444 sc_proxy_out_of_bounds(NULL, n);
1445 sc_core::sc_abort(); // can't recover from here
1446 }
1447}
1448
1449
1450template <class X>
1451inline
1452uint64
1454{
1455 // only 0 word is returned
1456 // can't convert logic values other than 0 and 1
1457 const X& x = back_cast();
1458 int len = x.length();
1459 int64 w = 0;
1460
1461 if( len > SC_DIGIT_SIZE )
1462 {
1463 if( x.get_cword( 1 ) != SC_DIGIT_ZERO )
1465 w = x.get_word(1);
1466 }
1467 if( x.get_cword( 0 ) != SC_DIGIT_ZERO )
1469 w = (w << SC_DIGIT_SIZE) | x.get_word( 0 );
1470 return w;
1471}
1472
1473// ----------------------------------------------------------------------------
1474
1475// functional notation for the reduce methods
1476
1477template <class X>
1478inline
1481{
1482 return a.and_reduce();
1483}
1484
1485template <class X>
1486inline
1489{
1490 return a.nand_reduce();
1491}
1492
1493template <class X>
1494inline
1497{
1498 return a.or_reduce();
1499}
1500
1501template <class X>
1502inline
1505{
1506 return a.nor_reduce();
1507}
1508
1509template <class X>
1510inline
1513{
1514 return a.xor_reduce();
1515}
1516
1517template <class X>
1518inline
1521{
1522 return a.xnor_reduce();
1523}
1524
1525
1526// ----------------------------------------------------------------------------
1527
1528template <class X>
1529inline
1530::std::ostream&
1531operator << ( ::std::ostream& os, const sc_proxy<X>& a )
1532{
1533 a.print( os );
1534 return os;
1535}
1536
1537template <class X>
1538inline
1539::std::istream&
1540operator >> ( ::std::istream& is, sc_proxy<X>& a )
1541{
1542 a.scan( is );
1543 return is;
1544}
1545
1546} // namespace sc_dt
1547
1548
1549#endif
#define DECL_REL_OP_T(tp)
Definition: sc_proxy.h:668
#define DECL_BITWISE_AND_OP_T(tp)
Definition: sc_proxy.h:558
#define DEFN_REL_OP_T(tp)
Definition: sc_proxy.h:1339
#define DECL_BITWISE_OR_OP_T(tp)
Definition: sc_proxy.h:595
#define DECL_BITWISE_XOR_OP_T(tp)
Definition: sc_proxy.h:632
#define BITS_PER_BYTE
Definition: sc_nbdefs.h:140
#define SC_API
Definition: sc_cmnhdr.h:148
#define sc_assert(expr)
Definition: sc_report.h:248
#define SC_REPORT_WARNING(msg_type, msg)
Definition: sc_report.h:213
SC_API void sc_abort()
const char SC_ID_VECTOR_CONTAINS_LOGIC_VALUE_[]
void assign_v_(sc_proxy< X > &px, const T &a)
Definition: sc_proxy.h:772
const sc_digit SC_DIGIT_ONE
Definition: sc_proxy.h:98
sc_numrep sc_io_base(systemc_ostream &stream_object, sc_numrep def_base)
Definition: sc_string.h:108
X & operator|=(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_lv_base.h:474
sc_lv_base lrotate(const sc_proxy< X > &x, int n)
Definition: sc_lv_base.h:803
bool sc_io_show_base(systemc_ostream &stream_object)
Definition: sc_string.h:113
sc_logic_value_t
Definition: sc_logic.h:87
sc_proxy< X >::value_type or_reduce(const sc_proxy< X > &a)
Definition: sc_proxy.h:1496
const int SC_DIGIT_SIZE
Definition: sc_proxy.h:95
X & b_or_assign_(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_proxy.h:1093
sc_bit operator&(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:331
SC_API std::string convert_to_fmt(const std::string &s, sc_numrep numrep, bool)
sc_proxy< X >::value_type xor_reduce(const sc_proxy< X > &a)
Definition: sc_proxy.h:1512
sc_bit operator^(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:337
const sc_digit SC_DIGIT_ZERO
Definition: sc_proxy.h:97
void get_words_(const X &x, int wi, sc_digit &x_dw, sc_digit &x_cw)
Definition: sc_proxy.h:713
void set_words_(X &x, int wi, sc_digit x_dw, sc_digit x_cw)
Definition: sc_proxy.h:722
sc_numrep
Definition: sc_string.h:56
@ SC_BIN
Definition: sc_string.h:58
@ SC_DEC
Definition: sc_string.h:60
X & operator^=(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_lv_base.h:613
unsigned long long uint64
Definition: sc_nbdefs.h:216
bool operator==(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:285
const T sc_min(const T &a, const T &b)
Definition: sc_macros.h:40
sc_proxy< X >::value_type nor_reduce(const sc_proxy< X > &a)
Definition: sc_proxy.h:1504
SC_API std::string to_string(sc_enc)
SC_API void sc_proxy_out_of_bounds(const char *msg=NULL, int64 val=0)
X & b_and_assign_(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_proxy.h:1069
class SC_API sc_logic
Definition: sc_signal_ifs.h:39
sc_lv_base reverse(const sc_proxy< X > &x)
Definition: sc_lv_base.h:852
X & b_xor_assign_(sc_proxy< X > &a, const sc_proxy< Y > &b)
Definition: sc_proxy.h:1117
sc_lv_base rrotate(const sc_proxy< X > &x, int n)
Definition: sc_lv_base.h:840
SC_API std::string convert_to_bin(const char *s)
void assign_p_(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_proxy.h:746
X & operator&=(sc_proxy< X > &px, const sc_proxy< Y > &py)
Definition: sc_lv_base.h:340
const sc_digit SC_DIGIT_TWO
Definition: sc_proxy.h:99
unsigned int sc_digit
Definition: sc_nbdefs.h:161
bool operator!=(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:288
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
void extend_sign_w_(X &x, int wi, bool sign)
Definition: sc_proxy.h:731
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, const sc_bit &b)
Definition: sc_bit.h:334
long long int64
Definition: sc_nbdefs.h:215
sc_core::sc_signal_in_if< T > & value(const T &val)
Definition: sc_stub.h:217
static const sc_logic_value_t or_table[4][4]
Definition: sc_logic.h:155
static const sc_logic_value_t xor_table[4][4]
Definition: sc_logic.h:156
static const sc_logic_value_t and_table[4][4]
Definition: sc_logic.h:154
static const sc_logic_value_t char_to_logic[128]
Definition: sc_logic.h:152
static const char logic_to_char[4]
Definition: sc_logic.h:153
static const sc_logic_value_t not_table[4]
Definition: sc_logic.h:157
std::string to_string() const
Definition: sc_proxy.h:1386
X & operator>>=(int n)
Definition: sc_proxy.h:1195
X & lrotate(int n)
Definition: sc_lv_base.h:778
long to_long() const
Definition: sc_proxy.h:502
X & operator&=(const char *b)
void check_bounds(int n) const
Definition: sc_proxy.h:1430
void scan(::std::istream &is=::std::cin)
Definition: sc_proxy.h:1419
sc_bitref< X > operator[](int i)
Definition: sc_proxy.h:417
traits_type::value_type value_type
Definition: sc_proxy.h:202
X & operator<<=(int n)
Definition: sc_proxy.h:1141
X & operator^=(const char *b)
value_type and_reduce() const
Definition: sc_proxy.h:1288
X & assign_(unsigned long a)
Definition: sc_proxy.h:983
X & assign_(const sc_int_base &a)
Definition: sc_proxy.h:237
sc_lv_base operator^(const char *b) const
X & assign_(unsigned int a)
Definition: sc_proxy.h:919
sc_lv_base operator>>(int n) const
Definition: sc_lv_base.h:766
X & assign_(const sc_unsigned &a)
Definition: sc_proxy.h:228
sc_bitref_r< X > bit(int i) const
Definition: sc_proxy.h:426
int64 to_int64() const
Definition: sc_proxy.h:493
value_type nand_reduce() const
Definition: sc_proxy.h:449
X & assign_(int a)
Definition: sc_proxy.h:932
sc_lv_base operator<<(int n) const
Definition: sc_lv_base.h:753
unsigned int to_uint() const
Definition: sc_proxy.h:499
value_type or_reduce() const
Definition: sc_proxy.h:1302
sc_lv_base operator&(const char *b) const
sc_lv_base operator|(const char *b) const
void check_wbounds(int n) const
Definition: sc_proxy.h:1441
sc_bitref< X > bit(int i)
Definition: sc_proxy.h:423
sc_lv_base operator~() const
Definition: sc_lv_base.h:328
unsigned long to_ulong() const
Definition: sc_proxy.h:505
value_type nor_reduce() const
Definition: sc_proxy.h:454
X & assign_(uint64 a)
Definition: sc_proxy.h:1009
std::string to_string(sc_numrep, bool) const
Definition: sc_proxy.h:1408
X & assign_(const sc_proxy< Y > &a)
Definition: sc_proxy.h:221
traits_type::bit_type bit_type
Definition: sc_proxy.h:201
X & assign_(int64 a)
Definition: sc_proxy.h:1027
X & assign_(const sc_uint_base &a)
Definition: sc_proxy.h:234
X & assign_(const sc_signed &a)
Definition: sc_proxy.h:231
int to_int() const
Definition: sc_proxy.h:496
X & assign_(const bool *a)
Definition: sc_proxy.h:891
value_type xor_reduce() const
Definition: sc_proxy.h:1316
sc_subref< X > range(int hi, int lo)
Definition: sc_proxy.h:438
sc_subref< X > operator()(int hi, int lo)
Definition: sc_proxy.h:432
sc_subref_r< X > range(int hi, int lo) const
Definition: sc_proxy.h:441
virtual ~sc_proxy()
Definition: sc_proxy.h:206
value_type xnor_reduce() const
Definition: sc_proxy.h:459
X & assign_(const char *a)
Definition: sc_proxy.h:867
bool operator==(const char *b) const
sc_proxy_traits< X >::traits_type traits_type
Definition: sc_proxy.h:200
X & assign_(long a)
Definition: sc_proxy.h:996
uint64 to_uint64() const
Definition: sc_proxy.h:1453
std::string to_string(sc_numrep) const
Definition: sc_proxy.h:1400
X & back_cast()
Definition: sc_proxy.h:211
X & assign_(const sc_logic *a)
Definition: sc_proxy.h:905
X & rrotate(int n)
Definition: sc_lv_base.h:815
void print(::std::ostream &os=::std::cout) const
Definition: sc_proxy.h:521
const X & back_cast() const
Definition: sc_proxy.h:214
X & operator|=(const char *b)
sc_proxy_traits< sc_bv_base > traits_type
Definition: sc_proxy.h:138
sc_proxy_traits< sc_lv_base > traits_type
Definition: sc_proxy.h:146
int length() const
Definition: sc_int_base.h:789
bool is_negative() const
Definition: sc_signed.h:887
int length() const
Definition: sc_signed.h:807
int length() const
Definition: sc_uint_base.h:757
int length() const
Definition: sc_unsigned.h:808