cloud9_root/src/cloud9/lib/Core/CacheDriver.cpp
// add cache-conflict and/or cold-miss related constraints
add cache-conflict and/or cold-miss related constraints
add cache - conflict and / or cold - miss related constraints
void CacheDriver::addConflictConstraints(ExecutionState& state, logT& constraintLog) {
	int count = 0;
	for (addrT::iterator II = allConstraintLog.begin(); II != allConstraintLog.end(); II++) {
		state.addConstraint(*II);
		fprintf(stdout, "adding constraint %d\n", count++);
	}
	for (unsigned II = 0; II < state.memAddrs.size(); II++) {
		if (constraintLog.count(II)) {
			state.addConstraint(constraintLog[II].first);
			state.addConstraint(constraintLog[II].second);
			fprintf(stdout, "adding constraint(c) %d\n", count++);
			if (nassoc > 1) {
				assert(setAssocConflictCnstrLog.count(II) && "something went wrong in processing \
					constraints for set-associative caches");
				for (unsigned JJ = 0; JJ < setAssocConflictCnstrLog[II].size(); JJ++) {
					state.addConstraint(setAssocConflictCnstrLog[II][JJ].first);
					state.addConstraint(setAssocConflictCnstrLog[II][JJ].second);
				}
			}
		}
	}
	fprintf(stdout, "\n\n########## calling the solver with constraint size %d ##########\n\n", count + 1);
}
void CacheDriver :: addConflictConstraints ( ExecutionState & state , logT & constraintLog ) { int count = 0 ; for ( addrT :: iterator II = allConstraintLog . begin ( ) ; II != allConstraintLog . end ( ) ; II ++ ) { state . addConstraint ( * II ) ; fprintf ( stdout , " \n " , count ++ ) ; } for ( unsigned II = 0 ; II < state . memAddrs . size ( ) ; II ++ ) { if ( constraintLog . count ( II ) ) { state . addConstraint ( constraintLog [ II ] . first ) ; state . addConstraint ( constraintLog [ II ] . second ) ; fprintf ( stdout , " \n " , count ++ ) ; if ( nassoc > 1 ) { assert ( setAssocConflictCnstrLog . count ( II ) && " \
 " ) ; for ( unsigned JJ = 0 ; JJ < setAssocConflictCnstrLog [ II ] . size ( ) ; JJ ++ ) { state . addConstraint ( setAssocConflictCnstrLog [ II ] [ JJ ] . first ) ; state . addConstraint ( setAssocConflictCnstrLog [ II ] [ JJ ] . second ) ; } } } } fprintf ( stdout , " \n \n \n \n " , count + 1 ) ; }
add cache-conflict and/or cold-miss related constraints
add cache - conflict and / or cold - miss related constraints
/* adding cold miss constraint */ /* for getting model of the solution */ /* sudiptac: experimenting a different order of constraints for insertion */ /* only for set-associative caches */ /* add bounds for cache conflicts */