Dear MARSS development group,
I am writing to you because the other day I stumbled upon an interesting
situation.
I noticed, in the coherentCache.cpp source file, that one of my line
pointers was being changed when it was not supposed to. So I looked into
the code a little further and realized that the function
CacheController::is_line_in_use(W64 tag) was not returning true when it
should have.
The function I am referring to is below. It basically checks if the tag (to
be evicted) is equal to any of the outstanding request. What I noticed is
that it checks if the tag is equal to the line address, which considering
how these two functions (tagOf and get_line_address) are calculated, will
never return true.
bool CacheController::is_line_in_use(W64 tag)
{
if (tag == InvalidTag<W64>::INVALID || tag == (W64)-1) {
return false;
}
/* Check each local cache request for same line tag */
CacheQueueEntry* queueEntry;
foreach_list_mutable(pendingRequests_.list(), queueEntry, entry,
prevEntry) {
if (get_line_address(queueEntry->request) == tag) {
return true;
}
}
return false;
}
The function get line address returns: request->get_physical_address() >>
cacheLineBits_
(Note: cacheLineBits_ == log2(LINE_SIZE) )
tagOf function returns: (address & ~(LINE_SIZE-1))
It seems to me that get_line_address puts the tag in the low order bits
while the tagOf function puts the tag in the higher order bits (just
zeroing the data bits).
I am not sure if anyone has found this issue before but it would be nice if
it could be corrected on the main repository, that is assuming my
assessment is correct. If it is not let me know.
What I did to correct is as follows (highlighted in yellow):
bool CacheController::is_line_in_use(W64 tag, W64 lineAddress)
{
if (tag == InvalidTag<W64>::INVALID || tag == (W64)-1) {
return false;
}
/* Check each local cache request for same line tag */
CacheQueueEntry* queueEntry;
foreach_list_mutable(pendingRequests_.list(), queueEntry, entry,
prevEntry) {
if (cacheLines_->tagOf(queueEntry->request->get_physical_address()) ==
tag) {
if (get_line_address(queueEntry->request) == lineAddress) {
return true;
}
}
}
return false;
}
Thank you very much.
Tamara Silbergleit Lehman.
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel