exec_output += PredOpExecute.subst(setendIop)
clrexCode = '''
- unsigned memAccessFlags = ArmISA::TLB::Clrex|3|Request::LLSC;
+ unsigned memAccessFlags = Request::CLREX|3|Request::LLSC;
fault = xc->read(0, (uint32_t&)Mem, memAccessFlags);
'''
clrexIop = InstObjParams("clrex", "Clrex","PredOp",
if (%(predicate_test)s)
{
if (fault == NoFault) {
- unsigned memAccessFlags = ArmISA::TLB::Clrex|3|Request::LLSC;
+ unsigned memAccessFlags = Request::CLREX|3|Request::LLSC;
fault = xc->read(0, (uint32_t&)Mem, memAccessFlags);
}
} else {
// If this is a clrex instruction, provide a PA of 0 with no fault
// This will force the monitor to set the tracked address to 0
// a bit of a hack but this effectively clrears this processors monitor
- if (flags & Clrex){
+ if (flags & Request::CLREX){
req->setPaddr(0);
req->setFlags(Request::UNCACHEABLE);
+ req->setFlags(Request::CLREX);
return NoFault;
}
if ((req->isInstFetch() && (!sctlr.i)) ||
// Because zero otherwise looks like a valid setting and may be used
// accidentally, this bit must be non-zero to show it was used on
// purpose.
- MustBeOne = 0x20,
- Clrex = 0x40
+ MustBeOne = 0x20
};
protected:
typedef std::multimap<Addr, int> PageTable;
Cache<TagStore>::access(PacketPtr pkt, BlkType *&blk,
int &lat, PacketList &writebacks)
{
- int id = pkt->req->hasContextId() ? pkt->req->contextId() : -1;
- blk = tags->accessBlock(pkt->getAddr(), lat, id);
-
- if (pkt->req->isUncacheable()) {
- if (blk != NULL) {
- tags->invalidateBlk(blk);
+ if (pkt->req->isUncacheable()) {
+ if (pkt->req->isClrex()) {
+ tags->clearLocks();
+ } else {
+ blk = tags->findBlock(pkt->getAddr());
+ if (blk != NULL) {
+ tags->invalidateBlk(blk);
+ }
}
blk = NULL;
return false;
}
+ int id = pkt->req->hasContextId() ? pkt->req->contextId() : -1;
+ blk = tags->accessBlock(pkt->getAddr(), lat, id);
DPRINTF(Cache, "%s%s %x %s\n", pkt->cmdString(),
pkt->req->isInstFetch() ? " (ifetch)" : "",
}
if (pkt->req->isUncacheable()) {
- int lat = hitLatency;
- int id = pkt->req->hasContextId() ? pkt->req->contextId() : -1;
- BlkType *blk = tags->accessBlock(pkt->getAddr(), lat, id);
- if (blk != NULL) {
- tags->invalidateBlk(blk);
+ if (pkt->req->isClrex()) {
+ tags->clearLocks();
+ } else {
+ BlkType *blk = tags->findBlock(pkt->getAddr());
+ if (blk != NULL) {
+ tags->invalidateBlk(blk);
+ }
}
// writes go in write buffer, reads use MSHR
* exits.
*/
virtual void cleanupRefs() {}
+
+ /**
+ *iterated through all blocks and clear all locks
+ *Needed to clear all lock tracking at once
+ */
+ virtual void clearLocks() {}
};
class BaseTagsCallback : public Callback
}
return true;
}
+
+void
+FALRU::clearLocks()
+{
+ for (int i = 0; i < numBlocks; i++){
+ blks[i].clearLoadLocks();
+ }
+}
{
return (tag);
}
+
+ /**
+ *iterated through all blocks and clear all locks
+ *Needed to clear all lock tracking at once
+ */
+ virtual void clearLocks();
};
#endif // __MEM_CACHE_TAGS_FA_LRU_HH__
}
}
+void
+IIC::clearLocks()
+{
+ for (int i = 0; i < numTags; i++){
+ tagStore[i].clearLoadLocks();
+ }
+}
+
void
IIC::cleanupRefs()
{
IICTag* findVictim(Addr addr, PacketList &writebacks);
void insertBlock(Addr addr, BlkType *blk, int context_src);
+ /**
+ *iterated through all blocks and clear all locks
+ *Needed to clear all lock tracking at once
+ */
+ virtual void clearLocks();
/**
* Called at end of simulation to complete average block reference stats.
* @param data_ptr The data block to free.
*/
void freeDataBlock(unsigned long data_ptr);
+
};
#endif // __IIC_HH__
}
}
+void
+LRU::clearLocks()
+{
+ for (int i = 0; i < numBlocks; i++){
+ blks[i].clearLoadLocks();
+ }
+}
+
void
LRU::cleanupRefs()
{
{
return hitLatency;
}
+ /**
+ *iterated through all blocks and clear all locks
+ *Needed to clear all lock tracking at once
+ */
+ virtual void clearLocks();
/**
* Called at end of simulation to complete average block reference stats.
static const FlagsType UNCACHEABLE = 0x00001000;
/** This request is to a memory mapped register. */
static const FlagsType MMAPED_IPR = 0x00002000;
+ /** This request is a clear exclusive. */
+ static const FlagsType CLREX = 0x00004000;
/** The request should ignore unaligned access faults */
static const FlagsType NO_ALIGN_FAULT = 0x00020000;
bool isSwap() const { return _flags.isSet(MEM_SWAP|MEM_SWAP_COND); }
bool isCondSwap() const { return _flags.isSet(MEM_SWAP_COND); }
bool isMmapedIpr() const { return _flags.isSet(MMAPED_IPR); }
+ bool isClrex() const { return _flags.isSet(CLREX); }
bool
isMisaligned() const