LDMX Software
Public Member Functions | Public Attributes | List of all members
_private_range_ref< _AP_W, _AP_S > Struct Template Reference

Concatination reference. More...

#include <ap_private.h>

Public Member Functions

INLINE _private_range_ref (const _private_range_ref< _AP_W, _AP_S > &ref)
 copy ctor.
 
INLINE _private_range_ref (ap_private< _AP_W, _AP_S > *bv, int h, int l)
 direct ctor.
 
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & operator|= (const _private_range_ref< _AP_W2, _AP_S2 > &ref)
 compound or assignment.
 
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & operator|= (const _AP_ROOT_TYPE< _AP_W2, _AP_S2 > &ref)
 compound or assignment with root type.
 
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & operator&= (const _private_range_ref< _AP_W2, _AP_S2 > &ref)
 compound and assignment.
 
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & operator&= (const _AP_ROOT_TYPE< _AP_W2, _AP_S2 > &ref)
 compound and assignment with root type.
 
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & operator^= (const _private_range_ref< _AP_W2, _AP_S2 > &ref)
 compound xor assignment.
 
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & operator^= (const _AP_ROOT_TYPE< _AP_W2, _AP_S2 > &ref)
 compound xor assignment with root type.
 
convertors.
INLINE operator ap_private< _AP_W, false > () const
 
INLINE operator unsigned long long () const
 
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_refoperator= (const ap_private< _AP_W2, _AP_S2 > &val)
 
INLINE _private_range_refoperator= (unsigned long long val)
 
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_refoperator= (const _private_bit_ref< _AP_W2, _AP_S2 > &val)
 
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_refoperator= (const _private_range_ref< _AP_W2, _AP_S2 > &val)
 
template<int _AP_W2, int _AP_I2, bool _AP_S2, ap_q_mode _AP_Q2, ap_o_mode _AP_O2, int _AP_N2>
INLINE _private_range_refoperator= (const ap_fixed_base< _AP_W2, _AP_I2, _AP_S2, _AP_Q2, _AP_O2, _AP_N2 > &val)
 
template<int _AP_W2, int _AP_I2, bool _AP_S2, ap_q_mode _AP_Q2, ap_o_mode _AP_O2, int _AP_N2>
INLINE _private_range_refoperator= (const af_range_ref< _AP_W2, _AP_I2, _AP_S2, _AP_Q2, _AP_O2, _AP_N2 > &val)
 
template<int _AP_W2, int _AP_I2, bool _AP_S2, ap_q_mode _AP_Q2, ap_o_mode _AP_O2, int _AP_N2>
INLINE _private_range_refoperator= (const af_bit_ref< _AP_W2, _AP_I2, _AP_S2, _AP_Q2, _AP_O2, _AP_N2 > &val)
 
template<int _AP_W2, bool _AP_S2>
INLINE bool operator== (const _private_range_ref< _AP_W2, _AP_S2 > &op2)
 
template<int _AP_W2, bool _AP_S2>
INLINE bool operator!= (const _private_range_ref< _AP_W2, _AP_S2 > &op2)
 
template<int _AP_W2, bool _AP_S2>
INLINE bool operator> (const _private_range_ref< _AP_W2, _AP_S2 > &op2)
 
template<int _AP_W2, bool _AP_S2>
INLINE bool operator>= (const _private_range_ref< _AP_W2, _AP_S2 > &op2)
 
template<int _AP_W2, bool _AP_S2>
INLINE bool operator< (const _private_range_ref< _AP_W2, _AP_S2 > &op2)
 
template<int _AP_W2, bool _AP_S2>
INLINE bool operator<= (const _private_range_ref< _AP_W2, _AP_S2 > &op2)
 
template<int _AP_W2>
INLINE void set (const ap_private< _AP_W2, false > &val)
 
INLINE ap_private< _AP_W, false > get () const
 
INLINE ap_private< _AP_W, false > get ()
 
INLINE int length () const
 
INLINE int to_int () const
 
INLINE unsigned int to_uint () const
 
INLINE long to_long () const
 
INLINE unsigned long to_ulong () const
 
INLINE ap_slong to_int64 () const
 
INLINE ap_ulong to_uint64 () const
 
INLINE std::string to_string (uint8_t radix=2) const
 
INLINE bool and_reduce ()
 
INLINE bool or_reduce ()
 
INLINE bool xor_reduce ()
 

Public Attributes

ap_private< _AP_W, _AP_S > & d_bv
 
int l_index
 
int h_index
 

Detailed Description

template<int _AP_W, bool _AP_S>
struct _private_range_ref< _AP_W, _AP_S >

Concatination reference.

Proxy class which allows concatination to be used as rvalue(for reading) and lvalue(for writing) Range(slice) reference Proxy class, which allows part selection to be used as rvalue(for reading) and lvalue(for writing)

Definition at line 6156 of file ap_private.h.

Constructor & Destructor Documentation

◆ _private_range_ref() [1/2]

template<int _AP_W, bool _AP_S>
INLINE _private_range_ref< _AP_W, _AP_S >::_private_range_ref ( const _private_range_ref< _AP_W, _AP_S > &  ref)
inline

copy ctor.

Definition at line 6166 of file ap_private.h.

6167 : d_bv(ref.d_bv), l_index(ref.l_index), h_index(ref.h_index) {}

◆ _private_range_ref() [2/2]

template<int _AP_W, bool _AP_S>
INLINE _private_range_ref< _AP_W, _AP_S >::_private_range_ref ( ap_private< _AP_W, _AP_S > *  bv,
int  h,
int  l 
)
inline

direct ctor.

Definition at line 6170 of file ap_private.h.

6171 : d_bv(*bv), l_index(l), h_index(h) {
6172 _AP_WARNING(h < 0 || l < 0,
6173 "Higher bound (%d) and lower bound (%d) cannot be "
6174 "negative.",
6175 h, l);
6176 _AP_WARNING(h >= _AP_W || l >= _AP_W,
6177 "Higher bound (%d) or lower bound (%d) out of range (%d).", h,
6178 l, _AP_W);
6179 }

Member Function Documentation

◆ and_reduce()

template<int _AP_W, bool _AP_S>
INLINE bool _private_range_ref< _AP_W, _AP_S >::and_reduce ( )
inline

Definition at line 6612 of file ap_private.h.

6612 {
6613 bool ret = true;
6614 bool reverse = l_index > h_index;
6615 unsigned low = reverse ? h_index : l_index;
6616 unsigned high = reverse ? l_index : h_index;
6617 for (unsigned i = low; i != high; ++i) ret &= d_bv[i];
6618 return ret;
6619 }

◆ get() [1/2]

template<int _AP_W, bool _AP_S>
INLINE ap_private< _AP_W, false > _private_range_ref< _AP_W, _AP_S >::get ( )
inline

Definition at line 6552 of file ap_private.h.

6552 {
6553 ap_private<_AP_W, false> val(0);
6554 if (h_index < l_index) {
6555 for (int i = 0, j = l_index; j >= 0 && j >= h_index; j--, i++)
6556 if ((d_bv)[j]) val.set(i);
6557 } else {
6558 val = d_bv;
6559 val >>= l_index;
6560 if (h_index < _AP_W - 1) {
6561 if (_AP_W <= 64) {
6562 static const uint64_t mask = ~0ULL >> (64 > _AP_W ? (64 - _AP_W) : 0);
6563 return val &= ((mask) >> (_AP_W - (h_index - l_index + 1)));
6564 } else {
6565 ap_private<_AP_W, false> mask(-1);
6566 mask >>= _AP_W - (h_index - l_index + 1);
6567 val &= mask;
6568 }
6569 }
6570 }
6571 return val;
6572 }

◆ get() [2/2]

template<int _AP_W, bool _AP_S>
INLINE ap_private< _AP_W, false > _private_range_ref< _AP_W, _AP_S >::get ( ) const
inline

Definition at line 6529 of file ap_private.h.

6529 {
6530 ap_private<_AP_W, false> val(0);
6531 if (h_index < l_index) {
6532 for (int i = 0, j = l_index; j >= 0 && j >= h_index; j--, i++)
6533 if ((d_bv)[j]) val.set(i);
6534 } else {
6535 val = d_bv;
6536 val >>= l_index;
6537 if (h_index < _AP_W - 1) {
6538 if (_AP_W <= 64) {
6539 const static uint64_t mask =
6540 (~0ULL >> (64 > _AP_W ? (64 - _AP_W) : 0));
6541 val &= (mask >> (_AP_W - (h_index - l_index + 1)));
6542 } else {
6543 ap_private<_AP_W, false> mask(-1);
6544 mask >>= _AP_W - (h_index - l_index + 1);
6545 val &= mask;
6546 }
6547 }
6548 }
6549 return val;
6550 }

◆ length()

template<int _AP_W, bool _AP_S>
INLINE int _private_range_ref< _AP_W, _AP_S >::length ( ) const
inline

Definition at line 6574 of file ap_private.h.

6574 {
6575 return h_index >= l_index ? h_index - l_index + 1 : l_index - h_index + 1;
6576 }

◆ operator ap_private< _AP_W, false >()

template<int _AP_W, bool _AP_S>
INLINE _private_range_ref< _AP_W, _AP_S >::operator ap_private< _AP_W, false > ( ) const
inline

Definition at line 6246 of file ap_private.h.

6246 {
6247 ap_private<_AP_W, false> val(0);
6248 if (h_index >= l_index) {
6249 if (_AP_W > 64) {
6250 val = d_bv;
6251 ap_private<_AP_W, false> mask(-1);
6252 mask >>= _AP_W - (h_index - l_index + 1);
6253 val >>= l_index;
6254 val &= mask;
6255 } else {
6256 const static uint64_t mask = (~0ULL >> (64 > _AP_W ? (64 - _AP_W) : 0));
6257 val = (d_bv >> l_index) & (mask >> (_AP_W - (h_index - l_index + 1)));
6258 }
6259 } else {
6260 for (int i = 0, j = l_index; j >= 0 && j >= h_index; j--, i++)
6261 if ((d_bv)[j]) val.set(i);
6262 }
6263 return val;
6264 }

◆ operator unsigned long long()

template<int _AP_W, bool _AP_S>
INLINE _private_range_ref< _AP_W, _AP_S >::operator unsigned long long ( ) const
inline

Definition at line 6266 of file ap_private.h.

6266{ return to_uint64(); }

◆ operator!=()

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE bool _private_range_ref< _AP_W, _AP_S >::operator!= ( const _private_range_ref< _AP_W2, _AP_S2 > &  op2)
inline

Definition at line 6447 of file ap_private.h.

6447 {
6448 ap_private<_AP_W, false> lhs = get();
6449 ap_private<_AP_W2, false> rhs = op2.get();
6450 return lhs != rhs;
6451 }

◆ operator&=() [1/2]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & _private_range_ref< _AP_W, _AP_S >::operator&= ( const _AP_ROOT_TYPE< _AP_W2, _AP_S2 > &  ref)
inline

compound and assignment with root type.

Definition at line 6215 of file ap_private.h.

6216 {
6217 _AP_WARNING((h_index - l_index + 1) != _AP_W2,
6218 "Bitsize mismach for ap_private<>.range() &= _AP_ROOT_TYPE<>.");
6219 this->d_bv &= ref.V;
6220 return *this;
6221 }

◆ operator&=() [2/2]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & _private_range_ref< _AP_W, _AP_S >::operator&= ( const _private_range_ref< _AP_W2, _AP_S2 > &  ref)
inline

compound and assignment.

Definition at line 6204 of file ap_private.h.

6205 {
6206 _AP_WARNING((h_index - l_index) != (ref.h_index - ref.l_index),
6207 "Bitsize mismach for ap_private<>.range() &= "
6208 "ap_private<>.range().");
6209 this->d_bv &= ref.d_bv;
6210 return *this;
6211 };

◆ operator<()

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE bool _private_range_ref< _AP_W, _AP_S >::operator< ( const _private_range_ref< _AP_W2, _AP_S2 > &  op2)
inline

Definition at line 6468 of file ap_private.h.

6468 {
6469 ap_private<_AP_W, false> lhs = get();
6470 ap_private<_AP_W2, false> rhs = op2.get();
6471 return lhs < rhs;
6472 }

◆ operator<=()

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE bool _private_range_ref< _AP_W, _AP_S >::operator<= ( const _private_range_ref< _AP_W2, _AP_S2 > &  op2)
inline

Definition at line 6475 of file ap_private.h.

6475 {
6476 ap_private<_AP_W, false> lhs = get();
6477 ap_private<_AP_W2, false> rhs = op2.get();
6478 return lhs <= rhs;
6479 }

◆ operator=() [1/7]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref & _private_range_ref< _AP_W, _AP_S >::operator= ( const _private_bit_ref< _AP_W2, _AP_S2 > &  val)
inline

Definition at line 6318 of file ap_private.h.

6319 {
6320 return operator=((unsigned long long)(bool)val);
6321 }

◆ operator=() [2/7]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref & _private_range_ref< _AP_W, _AP_S >::operator= ( const _private_range_ref< _AP_W2, _AP_S2 > &  val)
inline

Definition at line 6324 of file ap_private.h.

6325 {
6326 const ap_private<_AP_W, false> tmpVal(val);
6327 return operator=(tmpVal);
6328 }

◆ operator=() [3/7]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, int _AP_I2, bool _AP_S2, ap_q_mode _AP_Q2, ap_o_mode _AP_O2, int _AP_N2>
INLINE _private_range_ref & _private_range_ref< _AP_W, _AP_S >::operator= ( const af_bit_ref< _AP_W2, _AP_I2, _AP_S2, _AP_Q2, _AP_O2, _AP_N2 > &  val)
inline

Definition at line 6356 of file ap_private.h.

6357 {
6358 return operator=((unsigned long long)(bool)val);
6359 }

◆ operator=() [4/7]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, int _AP_I2, bool _AP_S2, ap_q_mode _AP_Q2, ap_o_mode _AP_O2, int _AP_N2>
INLINE _private_range_ref & _private_range_ref< _AP_W, _AP_S >::operator= ( const af_range_ref< _AP_W2, _AP_I2, _AP_S2, _AP_Q2, _AP_O2, _AP_N2 > &  val)
inline

Definition at line 6349 of file ap_private.h.

6350 {
6351 return operator=(val.operator ap_int_base<_AP_W2, false>().V);
6352 }

◆ operator=() [5/7]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, int _AP_I2, bool _AP_S2, ap_q_mode _AP_Q2, ap_o_mode _AP_O2, int _AP_N2>
INLINE _private_range_ref & _private_range_ref< _AP_W, _AP_S >::operator= ( const ap_fixed_base< _AP_W2, _AP_I2, _AP_S2, _AP_Q2, _AP_O2, _AP_N2 > &  val)
inline

Definition at line 6341 of file ap_private.h.

6343 {
6344 return operator=(val.to_ap_int_base().V);
6345 }

◆ operator=() [6/7]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref & _private_range_ref< _AP_W, _AP_S >::operator= ( const ap_private< _AP_W2, _AP_S2 > &  val)
inline

Definition at line 6270 of file ap_private.h.

6270 {
6271 ap_private<_AP_W, false> vval = ap_private<_AP_W, false>(val);
6272 if (l_index > h_index) {
6273 for (int i = 0, j = l_index; j >= 0 && j >= h_index; j--, i++)
6274 (vval)[i] ? d_bv.set(j) : d_bv.clear(j);
6275 } else {
6276 if (_AP_W > 64) {
6277 ap_private<_AP_W, false> mask(-1);
6278 if (l_index > 0) {
6279 mask <<= l_index;
6280 vval <<= l_index;
6281 }
6282 if (h_index < _AP_W - 1) {
6283 ap_private<_AP_W, false> mask2(-1);
6284 mask2 >>= _AP_W - h_index - 1;
6285 mask &= mask2;
6286 vval &= mask2;
6287 }
6288 mask.flip();
6289 d_bv &= mask;
6290 d_bv |= vval;
6291 } else {
6292 unsigned shift = 64 - _AP_W;
6293 uint64_t mask = ~0ULL >> (shift);
6294 if (l_index > 0) {
6295 vval = mask & vval << l_index;
6296 mask = mask & mask << l_index;
6297 }
6298 if (h_index < _AP_W - 1) {
6299 uint64_t mask2 = mask;
6300 mask2 >>= (_AP_W - h_index - 1);
6301 mask &= mask2;
6302 vval &= mask2;
6303 }
6304 mask = ~mask;
6305 d_bv &= mask;
6306 d_bv |= vval;
6307 }
6308 }
6309 return *this;
6310 } // operator=(const ap_private<>&)

◆ operator=() [7/7]

template<int _AP_W, bool _AP_S>
INLINE _private_range_ref & _private_range_ref< _AP_W, _AP_S >::operator= ( unsigned long long  val)
inline

Definition at line 6312 of file ap_private.h.

6312 {
6313 const ap_private<_AP_W, _AP_S> vval = val;
6314 return operator=(vval);
6315 }

◆ operator==()

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE bool _private_range_ref< _AP_W, _AP_S >::operator== ( const _private_range_ref< _AP_W2, _AP_S2 > &  op2)
inline

Definition at line 6440 of file ap_private.h.

6440 {
6441 ap_private<_AP_W, false> lhs = get();
6442 ap_private<_AP_W2, false> rhs = op2.get();
6443 return lhs == rhs;
6444 }

◆ operator>()

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE bool _private_range_ref< _AP_W, _AP_S >::operator> ( const _private_range_ref< _AP_W2, _AP_S2 > &  op2)
inline

Definition at line 6454 of file ap_private.h.

6454 {
6455 ap_private<_AP_W, false> lhs = get();
6456 ap_private<_AP_W2, false> rhs = op2.get();
6457 return lhs > rhs;
6458 }

◆ operator>=()

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE bool _private_range_ref< _AP_W, _AP_S >::operator>= ( const _private_range_ref< _AP_W2, _AP_S2 > &  op2)
inline

Definition at line 6461 of file ap_private.h.

6461 {
6462 ap_private<_AP_W, false> lhs = get();
6463 ap_private<_AP_W2, false> rhs = op2.get();
6464 return lhs >= rhs;
6465 }

◆ operator^=() [1/2]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & _private_range_ref< _AP_W, _AP_S >::operator^= ( const _AP_ROOT_TYPE< _AP_W2, _AP_S2 > &  ref)
inline

compound xor assignment with root type.

Definition at line 6236 of file ap_private.h.

6237 {
6238 _AP_WARNING((h_index - l_index + 1) != _AP_W2,
6239 "Bitsize mismach for ap_private<>.range() ^= _AP_ROOT_TYPE<>.");
6240 this->d_bv ^= ref.V;
6241 return *this;
6242 }

◆ operator^=() [2/2]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & _private_range_ref< _AP_W, _AP_S >::operator^= ( const _private_range_ref< _AP_W2, _AP_S2 > &  ref)
inline

compound xor assignment.

Definition at line 6225 of file ap_private.h.

6226 {
6227 _AP_WARNING((h_index - l_index) != (ref.h_index - ref.l_index),
6228 "Bitsize mismach for ap_private<>.range() ^= "
6229 "ap_private<>.range().");
6230 this->d_bv ^= ref.d_bv;
6231 return *this;
6232 };

◆ operator|=() [1/2]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & _private_range_ref< _AP_W, _AP_S >::operator|= ( const _AP_ROOT_TYPE< _AP_W2, _AP_S2 > &  ref)
inline

compound or assignment with root type.

Definition at line 6194 of file ap_private.h.

6195 {
6196 _AP_WARNING((h_index - l_index + 1) != _AP_W2,
6197 "Bitsize mismach for ap_private<>.range() |= _AP_ROOT_TYPE<>.");
6198 this->d_bv |= ref.V;
6199 return *this;
6200 }

◆ operator|=() [2/2]

template<int _AP_W, bool _AP_S>
template<int _AP_W2, bool _AP_S2>
INLINE _private_range_ref< _AP_W, _AP_S > & _private_range_ref< _AP_W, _AP_S >::operator|= ( const _private_range_ref< _AP_W2, _AP_S2 > &  ref)
inline

compound or assignment.

Definition at line 6183 of file ap_private.h.

6184 {
6185 _AP_WARNING((h_index - l_index) != (ref.h_index - ref.l_index),
6186 "Bitsize mismach for ap_private<>.range() &= "
6187 "ap_private<>.range().");
6188 this->d_bv |= ref.d_bv;
6189 return *this;
6190 }

◆ or_reduce()

template<int _AP_W, bool _AP_S>
INLINE bool _private_range_ref< _AP_W, _AP_S >::or_reduce ( )
inline

Definition at line 6621 of file ap_private.h.

6621 {
6622 bool ret = false;
6623 bool reverse = l_index > h_index;
6624 unsigned low = reverse ? h_index : l_index;
6625 unsigned high = reverse ? l_index : h_index;
6626 for (unsigned i = low; i != high; ++i) ret |= d_bv[i];
6627 return ret;
6628 }

◆ set()

template<int _AP_W, bool _AP_S>
template<int _AP_W2>
INLINE void _private_range_ref< _AP_W, _AP_S >::set ( const ap_private< _AP_W2, false > &  val)
inline

Definition at line 6482 of file ap_private.h.

6482 {
6483 ap_private<_AP_W, _AP_S> vval = val;
6484 if (l_index > h_index) {
6485 for (int i = 0, j = l_index; j >= 0 && j >= h_index; j--, i++)
6486 (vval)[i] ? d_bv.set(j) : d_bv.clear(j);
6487 } else {
6488 if (_AP_W > 64) {
6489 ap_private<_AP_W, _AP_S> mask(-1);
6490 if (l_index > 0) {
6491 ap_private<_AP_W, false> mask1(-1);
6492 mask1 >>= _AP_W - l_index;
6493 mask1.flip();
6494 mask = mask1;
6495 // vval&=mask1;
6496 vval <<= l_index;
6497 }
6498 if (h_index < _AP_W - 1) {
6499 ap_private<_AP_W, false> mask2(-1);
6500 mask2 <<= h_index + 1;
6501 mask2.flip();
6502 mask &= mask2;
6503 vval &= mask2;
6504 }
6505 mask.flip();
6506 d_bv &= mask;
6507 d_bv |= vval;
6508 } else {
6509 uint64_t mask = ~0ULL >> (64 - _AP_W);
6510 if (l_index > 0) {
6511 uint64_t mask1 = mask;
6512 mask1 = mask & (mask1 >> (_AP_W - l_index));
6513 vval = mask & (vval << l_index);
6514 mask = ~mask1 & mask;
6515 // vval&=mask1;
6516 }
6517 if (h_index < _AP_W - 1) {
6518 uint64_t mask2 = ~0ULL >> (64 - _AP_W);
6519 mask2 = mask & (mask2 << (h_index + 1));
6520 mask &= ~mask2;
6521 vval &= ~mask2;
6522 }
6523 d_bv &= (~mask & (~0ULL >> (64 - _AP_W)));
6524 d_bv |= vval;
6525 }
6526 }
6527 }

◆ to_int()

template<int _AP_W, bool _AP_S>
INLINE int _private_range_ref< _AP_W, _AP_S >::to_int ( ) const
inline

Definition at line 6578 of file ap_private.h.

6578 {
6579 ap_private<_AP_W, false> val = get();
6580 return val.to_int();
6581 }

◆ to_int64()

template<int _AP_W, bool _AP_S>
INLINE ap_slong _private_range_ref< _AP_W, _AP_S >::to_int64 ( ) const
inline

Definition at line 6598 of file ap_private.h.

6598 {
6599 ap_private<_AP_W, false> val = get();
6600 return val.to_int64();
6601 }

◆ to_long()

template<int _AP_W, bool _AP_S>
INLINE long _private_range_ref< _AP_W, _AP_S >::to_long ( ) const
inline

Definition at line 6588 of file ap_private.h.

6588 {
6589 ap_private<_AP_W, false> val = get();
6590 return val.to_long();
6591 }

◆ to_string()

template<int _AP_W, bool _AP_S>
INLINE std::string _private_range_ref< _AP_W, _AP_S >::to_string ( uint8_t  radix = 2) const
inline

Definition at line 6608 of file ap_private.h.

6608 {
6609 return get().to_string(radix);
6610 }

◆ to_uint()

template<int _AP_W, bool _AP_S>
INLINE unsigned int _private_range_ref< _AP_W, _AP_S >::to_uint ( ) const
inline

Definition at line 6583 of file ap_private.h.

6583 {
6584 ap_private<_AP_W, false> val = get();
6585 return val.to_uint();
6586 }

◆ to_uint64()

template<int _AP_W, bool _AP_S>
INLINE ap_ulong _private_range_ref< _AP_W, _AP_S >::to_uint64 ( ) const
inline

Definition at line 6603 of file ap_private.h.

6603 {
6604 ap_private<_AP_W, false> val = get();
6605 return val.to_uint64();
6606 }

◆ to_ulong()

template<int _AP_W, bool _AP_S>
INLINE unsigned long _private_range_ref< _AP_W, _AP_S >::to_ulong ( ) const
inline

Definition at line 6593 of file ap_private.h.

6593 {
6594 ap_private<_AP_W, false> val = get();
6595 return val.to_ulong();
6596 }

◆ xor_reduce()

template<int _AP_W, bool _AP_S>
INLINE bool _private_range_ref< _AP_W, _AP_S >::xor_reduce ( )
inline

Definition at line 6630 of file ap_private.h.

6630 {
6631 bool ret = false;
6632 bool reverse = l_index > h_index;
6633 unsigned low = reverse ? h_index : l_index;
6634 unsigned high = reverse ? l_index : h_index;
6635 for (unsigned i = low; i != high; ++i) ret ^= d_bv[i];
6636 return ret;
6637 }

Member Data Documentation

◆ d_bv

template<int _AP_W, bool _AP_S>
ap_private<_AP_W, _AP_S>& _private_range_ref< _AP_W, _AP_S >::d_bv

Definition at line 6160 of file ap_private.h.

◆ h_index

template<int _AP_W, bool _AP_S>
int _private_range_ref< _AP_W, _AP_S >::h_index

Definition at line 6162 of file ap_private.h.

◆ l_index

template<int _AP_W, bool _AP_S>
int _private_range_ref< _AP_W, _AP_S >::l_index

Definition at line 6161 of file ap_private.h.


The documentation for this struct was generated from the following file: