cloud9_root/src/cloud9/lib/Core/CacheDriver.cpp
// constrain one byte with a specific value
constrain one byte with a specific value
constrain one byte with a specific value
ref<Expr> CacheDriver::constrainOneByte(ExecutionState& state, int nbyte, int value) {
	ref<Expr> ret = NULL;
	for (unsigned i = 0; i < state.symbolics.size(); i++) {
		UpdateList ul(state.symbolics[i].second, 0);
		ref<Expr> read = ReadExpr::create(ul, ConstantExpr::create(nbyte, Expr::Int32));
		ref<Expr> valueEx = ConstantExpr::alloc(value, read->getWidth());
		if (ret.isNull())
			ret = EqExpr::create(read, valueEx);
		else
			ret = AndExpr::create(ret, EqExpr::create(read, valueEx));
	}
	assert(ret.isNull()==0 && "constraining byte of a key went wrong");
	return ret;
}
ref < Expr > CacheDriver :: constrainOneByte ( ExecutionState & state , int nbyte , int value ) { ref < Expr > ret = NULL ; for ( unsigned i = 0 ; i < state . symbolics . size ( ) ; i ++ ) { UpdateList ul ( state . symbolics [ i ] . second , 0 ) ; ref < Expr > read = ReadExpr :: create ( ul , ConstantExpr :: create ( nbyte , Expr :: Int32 ) ) ; ref < Expr > valueEx = ConstantExpr :: alloc ( value , read -> getWidth ( ) ) ; if ( ret . isNull ( ) ) ret = EqExpr :: create ( read , valueEx ) ; else ret = AndExpr :: create ( ret , EqExpr :: create ( read , valueEx ) ) ; } assert ( ret . isNull ( ) == 0 && " " ) ; return ret ; }
constrain one byte with a specific value
constrain one byte with a specific value