70 std::default_random_engine(
rng->random<
unsigned>(0,UINT_MAX - 1))
99 assert(loc < numAtomicLocs + numNormalLocs && loc >= 0);
109 return ret_atomic_loc;
152 assert(loc_begin <= loc_end);
226 (it->second).first =
true;
260 (it->second).second =
true;
288 if (
p.first && !
p.second) {
296 assert(loc_prop.second == 0);
304 swap(loc_prop, swapped_loc_prop);
312 }
else if (
p.second) {
323 swap(loc_prop, swapped_loc_prop);
331 panic(
"Location in loadStoreMap but wasn't picked in any"
349 assert(loc_prop.second == 1);
356 swap(loc_prop, swapped_loc_prop);
365 assert(loc_prop.second >= 1);
367 if (loc_prop.second == 1) {
374 swap(loc_prop, swapped_loc_prop);
393 std::stringstream exp_val_ss;
395 exp_val_ss <<
" " <<
val;
398 warn(
"Expected return values are:\n\t%s\n", exp_val_ss.str());
412 int new_idx_1 = prop_2.first;
413 int new_idx_2 = prop_1.first;
421 prop_1.first = new_idx_1;
422 prop_2.first = new_idx_2;
428 Value new_value,
Tick cur_tick,
int cu_id)
431 logTable[loc]->update(thread_id, cu_id, episode_id, new_value, cur_tick);
438 return logTable[loc]->getLastStoredValue();
bool inSecondRegion(int idx) const
bool inFirstRegion(int idx) const
void releaseLoc(Location loc)
std::pair< int, int > LocProperty
AtomicStruct(Location atom_loc, Location loc_begin, Location loc_end)
bool inThirdRegion(int idx) const
bool isExpectedValue(Value val)
ExpectedValueSet expectedValues
std::pair< bool, bool > LdStBits
void swap(LocProperty &prop_1, LocProperty &prop_2)
Addr getAddress(Location loc)
AtomicStructTable atomicStructs
Location getStoreLoc(Location atomic_loc)
Value getLoggedValue(Location loc) const
AddressManager(int n_atomic_locs, int numNormalLocsPerAtomic)
AddressMap randAddressMap
std::string printLastWriter(Location loc) const
void updateLogTable(Location loc, int threadId, int episodeId, Value new_value, Tick curTick, int cuId=-1)
static const int INVALID_LOCATION
Location getLoadLoc(Location atomic_loc)
static const int INVALID_VALUE
void finishLocSelection(Location atomic_loc)
void releaseLocation(Location atomic_loc, Location loc)
bool validateAtomicResp(Location loc, Value ret_val)
static constexpr std::enable_if_t< std::is_integral_v< T >, int > floorLog2(T x)
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.