accls/AES/AES-Synth/aes-rtl-uinst/verilatorInclude/verilated.h
// Left stream operator. Output will always be clean. LHS and RHS must be clean.
// Special "fast" versions for slice sizes that are a power of 2. These use
// shifts and masks to execute faster than the slower for-loop approach where a
// subset of bits is copied in during each iteration.
Left stream operator. Output will always be clean. LHS and RHS must be clean.
Special "fast" versions for slice sizes that are a power of 2. These use
shifts and masks to execute faster than the slower for-loop approach where a
subset of bits is copied in during each iteration.
Left stream operator . Output will always be clean . LHS and RHS must be clean . Special " fast " versions for slice sizes that are a power of 2 . These use shifts and masks to execute faster than the slower for - loop approach where a subset of bits is copied in during each iteration .
static inline IData VL_STREAML_FAST_III(int, int lbits, int, IData ld, IData rd_log2) {
     If lbits is not a multiple of the slice size (i.e., lbits % rd != 0),
     then we end up with a "gap" in our reversed result. For example, if we
     have a 5-bit Verlilog signal (lbits=5) in an 8-bit C data type:
       ld = ---43210
     (where numbers are the Verilog signal bit numbers and '-' is an unused bit).
     Executing the switch statement below with a slice size of two (rd=2,
     rd_log2=1) produces:
       ret = 1032-400
     Pre-shifting the bits in the most-significant slice allows us to avoid
     this gap in the shuffled data:
       ld_adjusted = --4-3210
       ret = 10324---
    IData ret = ld;
    if (rd_log2) {
	vluint32_t lbitsFloor = lbits & ~VL_MASK_I(rd_log2);  max multiple of rd <= lbits
	vluint32_t lbitsRem = lbits - lbitsFloor;  number of bits in most-sig slice (MSS)
	IData msbMask = VL_MASK_I(lbitsRem) << lbitsFloor;  mask to sel only bits in MSS
	ret = (ret & ~msbMask) | ((ret & msbMask) << ((VL_UL(1) << rd_log2) - lbitsRem));
    }
    switch (rd_log2) {
	case 0:
	    ret = ((ret >> 1) & VL_UL(0x55555555)) | ((ret & VL_UL(0x55555555)) << 1);     FALLTHRU
	case 1:
	    ret = ((ret >> 2) & VL_UL(0x33333333)) | ((ret & VL_UL(0x33333333)) << 2);     FALLTHRU
	case 2:
	    ret = ((ret >> 4) & VL_UL(0x0f0f0f0f)) | ((ret & VL_UL(0x0f0f0f0f)) << 4);     FALLTHRU
	case 3:
	    ret = ((ret >> 8) & VL_UL(0x00ff00ff)) | ((ret & VL_UL(0x00ff00ff)) << 8);     FALLTHRU
	case 4:
	    ret = ((ret >> 16) | (ret << 16));
    }
    return ret >> (VL_WORDSIZE - lbits);
}
static inline IData VL_STREAML_FAST_III ( int , int lbits , int , IData ld , IData rd_log2 ) { IData ret = ld ; if ( rd_log2 ) { vluint32_t lbitsFloor = lbits & ~ VL_MASK_I ( rd_log2 ) ; vluint32_t lbitsRem = lbits - lbitsFloor ; IData msbMask = VL_MASK_I ( lbitsRem ) << lbitsFloor ; ret = ( ret & ~ msbMask ) | ( ( ret & msbMask ) << ( ( VL_UL ( 1 ) << rd_log2 ) - lbitsRem ) ) ; } switch ( rd_log2 ) { case 0 : ret = ( ( ret >> 1 ) & VL_UL ( 0x55555555 ) ) | ( ( ret & VL_UL ( 0x55555555 ) ) << 1 ) ; case 1 : ret = ( ( ret >> 2 ) & VL_UL ( 0x33333333 ) ) | ( ( ret & VL_UL ( 0x33333333 ) ) << 2 ) ; case 2 : ret = ( ( ret >> 4 ) & VL_UL ( 0x0f0f0f0f ) ) | ( ( ret & VL_UL ( 0x0f0f0f0f ) ) << 4 ) ; case 3 : ret = ( ( ret >> 8 ) & VL_UL ( 0x00ff00ff ) ) | ( ( ret & VL_UL ( 0x00ff00ff ) ) << 8 ) ; case 4 : ret = ( ( ret >> 16 ) | ( ret << 16 ) ) ; } return ret >> ( VL_WORDSIZE - lbits ) ; }
Left stream operator.
Left stream operator .
// Pre-shift bits in most-significant slice: // // If lbits is not a multiple of the slice size (i.e., lbits % rd != 0), // then we end up with a "gap" in our reversed result. For example, if we // have a 5-bit Verlilog signal (lbits=5) in an 8-bit C data type: // //   ld = ---43210 // // (where numbers are the Verilog signal bit numbers and '-' is an unused bit). // Executing the switch statement below with a slice size of two (rd=2, // rd_log2=1) produces: // //   ret = 1032-400 // // Pre-shifting the bits in the most-significant slice allows us to avoid // this gap in the shuffled data: // //   ld_adjusted = --4-3210 //   ret = 10324--- // max multiple of rd <= lbits // number of bits in most-sig slice (MSS) // mask to sel only bits in MSS // FALLTHRU // FALLTHRU // FALLTHRU // FALLTHRU