src/CacheSim/Cache.py
def checkCache(self,address):
        '''Check the current Cache to see if there is a cache hit for a given
        memory address.  The method will return back a boolean True or False
        True: There was a Cache hit
        False: There was a Cache Miss '''

        #Get Slot number
        slotMASK = 0b000011110000
        slot = (slotMASK & address) >> 4
        #print('Slot: ' + str(slot))

        #Get Tag
        tagMASK = 0b111100000000
        tag = (tagMASK & address) >> 8
        #print('Tag: ' + str(tag))

        #get Offset
        offsetMASK = 0b000000001111
        offset = (offsetMASK & address)
        #print('Offset: ' + str(offset))

        #Check if the current slow with the slot of input address is valid
        # and then check if the tag matches up
        if self.slots[slot].valid == 1:
            if self.slots[slot].tag == tag:
                return True
        else:
            return False
Check the current Cache to see if there is a cache hit for a given
        memory address.  The method will return back a boolean True or False
        True: There was a Cache hit
        False: There was a Cache Miss 
Check the current Cache to see if there is a cache hit for a given
memory address.  The method will return back a boolean True or False
True: There was a Cache hit
False: There was a Cache Miss
Check the current Cache to see if there is a cache hit for a given memory address . The method will return back a boolean True or False True : There was a Cache hit False : There was a Cache Miss
def checkCache(self,address):
        slotMASK = 0b000011110000
        slot = (slotMASK & address) >> 4
        tagMASK = 0b111100000000
        tag = (tagMASK & address) >> 8
        offsetMASK = 0b000000001111
        offset = (offsetMASK & address)
        if self.slots[slot].valid == 1:
            if self.slots[slot].tag == tag:
                return True
        else:
            return False
def checkCache ( self , address ) : slotMASK = 0b000011110000 slot = ( slotMASK & address ) >> 4 tagMASK = 0b111100000000 tag = ( tagMASK & address ) >> 8 offsetMASK = 0b000000001111 offset = ( offsetMASK & address ) if self . slots [ slot ] . valid == 1 : if self . slots [ slot ] . tag == tag : return True else : return False
Check the current Cache to see if there is a cache hit for a given
memory address.
Check the current Cache to see if there is a cache hit for a given memory address .
'''Check the current Cache to see if there is a cache hit for a given
        memory address.  The method will return back a boolean True or False
        True: There was a Cache hit
        False: There was a Cache Miss ''' #Get Slot number #print('Slot: ' + str(slot)) #Get Tag #print('Tag: ' + str(tag)) #get Offset #print('Offset: ' + str(offset)) #Check if the current slow with the slot of input address is valid # and then check if the tag matches up
self
address