Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/__pycache__/block.cpython-38.pyc
Binary file not shown.
Binary file added src/__pycache__/cache.cpython-38.pyc
Binary file not shown.
Binary file added src/__pycache__/colorer.cpython-38.pyc
Binary file not shown.
Binary file added src/__pycache__/response.cpython-38.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions src/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, name, word_size, block_size, n_blocks, associativity, hit_tim
self.logger = logger

#Total number of sets in the cache
self.n_sets = n_blocks / associativity
self.n_sets = int(n_blocks / associativity)

#Dictionary that holds the actual cache data
self.data = {}
Expand Down Expand Up @@ -48,7 +48,7 @@ def read(self, address, current_step):
block_offset, index, tag = self.parse_address(address)

#Get the tags in this set
in_cache = self.data[index].keys()
in_cache = list(self.data[index].keys())

#If this tag exists in the set, this is a hit
if tag in in_cache:
Expand Down Expand Up @@ -88,7 +88,7 @@ def write(self, address, from_cpu, current_step):
r = response.Response({self.name:True}, self.write_time)
else:
block_offset, index, tag = self.parse_address(address)
in_cache = self.data[index].keys()
in_cache = list(self.data[index].keys())

if tag in in_cache:
#Set dirty bit to true if this block was in cache
Expand Down
Loading