cloud9_root/src/cloud9/lib/Core/CacheSideChannel.cpp
// generate set equality constraints for <symbolic,symbolic> constraint pairs
generate set equality constraints for  constraint pairs
generate set equality constraints for constraint pairs
ref<Expr> CacheChannel::generateSetCnstrSS(ref<Expr>& addressI, ref<Expr>& addressJ) {
	pairT setPair(addressI, addressJ);
	ref<Expr> setAddrI, setAddrJ;
	atomicCnstr++;
	{
		if (setPairCache.count(setPair)) {
#ifdef _CACHE_CHANNEL_DEBUG
			fprintf(stdout, "cached result found.....\n");
			fflush(stdout);
#endif
			return tagPairCache[setPair];
		}
	}
	if (setCache.count(addressI)) setAddrI = setCache[addressI];
	else {
		ref<Expr> blAddr = LShrExpr::create(addressI, ConstantExpr::alloc(log_base2(line), addressI->getWidth()));
		setAddrI = AndExpr::create(blAddr, ConstantExpr::alloc(nset - 1, addressI->getWidth()));
		setCache[addressI] = setAddrI;
	}
	if (setCache.count(addressJ)) setAddrJ = setCache[addressJ];
	else {
		ref<Expr> blAddr = LShrExpr::create(addressJ, ConstantExpr::alloc(log_base2(line), addressJ->getWidth()));
		setAddrJ = AndExpr::create(blAddr, ConstantExpr::alloc(nset - 1, addressJ->getWidth()));
		setCache[addressJ] = setAddrJ;
	}
	setPairCache[setPair] = EqExpr::create(setAddrI, setAddrJ);
	return setPairCache[setPair];
}
ref < Expr > CacheChannel :: generateSetCnstrSS ( ref < Expr > & addressI , ref < Expr > & addressJ ) { pairT setPair ( addressI , addressJ ) ; ref < Expr > setAddrI , setAddrJ ; atomicCnstr ++ ; { if ( setPairCache . count ( setPair ) ) { #ifdef _CACHE_CHANNEL_DEBUG fprintf ( stdout , " \n " ) ; fflush ( stdout ) ; #endif return tagPairCache [ setPair ] ; } } if ( setCache . count ( addressI ) ) setAddrI = setCache [ addressI ] ; else { ref < Expr > blAddr = LShrExpr :: create ( addressI , ConstantExpr :: alloc ( log_base2 ( line ) , addressI -> getWidth ( ) ) ) ; setAddrI = AndExpr :: create ( blAddr , ConstantExpr :: alloc ( nset - 1 , addressI -> getWidth ( ) ) ) ; setCache [ addressI ] = setAddrI ; } if ( setCache . count ( addressJ ) ) setAddrJ = setCache [ addressJ ] ; else { ref < Expr > blAddr = LShrExpr :: create ( addressJ , ConstantExpr :: alloc ( log_base2 ( line ) , addressJ -> getWidth ( ) ) ) ; setAddrJ = AndExpr :: create ( blAddr , ConstantExpr :: alloc ( nset - 1 , addressJ -> getWidth ( ) ) ) ; setCache [ addressJ ] = setAddrJ ; } setPairCache [ setPair ] = EqExpr :: create ( setAddrI , setAddrJ ) ; return setPairCache [ setPair ] ; }
generate set equality constraints for <symbolic,symbolic> constraint pairs
generate set equality constraints for <symbolic symbolic > constraint pairs
/* optimization to reduce memory consumption */ /* end optimization branch */ /* more optimization */ /* more optimization ends */