src/CacheSim/SystemMemoryManager.py
def write(self, address, value):
        '''Writes to memory at the specified address and given value.  Will do
        some level of error checking,
        address: Must be in the range of the current memeory
        value: can not be larger than 8 bits'''
        print('\nWRITE {0:x}'.format(address))
        if self.cache.checkCache(address):
            print('HIT')
            self.cache.updateData(address, value)
            print('Value {0:x}'.format(self.cache.getAddressValue(address)))

        else:
            print('MISS')
            #Write Back to main Memory if current row is dirty
            if self.cache.isDirty(address):
                cacheBlock = self.cache.getBlock(address)
                self.memory.writeBlock(cacheBlock)
            newRow = self.memory.getBlock(address)
            self.cache.insertBlock(newRow)
            self.cache.updateData(address, value)
            print('Value {0:x}'.format(self.cache.getAddressValue(address)))
Writes to memory at the specified address and given value.  Will do
        some level of error checking,
        address: Must be in the range of the current memeory
        value: can not be larger than 8 bits
Writes to memory at the specified address and given value.  Will do
some level of error checking,
address: Must be in the range of the current memeory
value: can not be larger than 8 bits
Writes to memory at the specified address and given value . Will do some level of error checking address : Must be in the range of the current memeory value : can not be larger than 8 bits
def write(self, address, value):
        print('\nWRITE {0:x}'.format(address))
        if self.cache.checkCache(address):
            print('HIT')
            self.cache.updateData(address, value)
            print('Value {0:x}'.format(self.cache.getAddressValue(address)))
        else:
            print('MISS')
            if self.cache.isDirty(address):
                cacheBlock = self.cache.getBlock(address)
                self.memory.writeBlock(cacheBlock)
            newRow = self.memory.getBlock(address)
            self.cache.insertBlock(newRow)
            self.cache.updateData(address, value)
            print('Value {0:x}'.format(self.cache.getAddressValue(address)))
def write ( self , address , value ) : print ( '\nWRITE {0:x}' . format ( address ) ) if self . cache . checkCache ( address ) : print ( 'HIT' ) self . cache . updateData ( address , value ) print ( 'Value {0:x}' . format ( self . cache . getAddressValue ( address ) ) ) else : print ( 'MISS' ) if self . cache . isDirty ( address ) : cacheBlock = self . cache . getBlock ( address ) self . memory . writeBlock ( cacheBlock ) newRow = self . memory . getBlock ( address ) self . cache . insertBlock ( newRow ) self . cache . updateData ( address , value ) print ( 'Value {0:x}' . format ( self . cache . getAddressValue ( address ) ) )
Writes to memory at the specified address and given value.
Writes to memory at the specified address and given value .
'''Writes to memory at the specified address and given value.  Will do
        some level of error checking,
        address: Must be in the range of the current memeory
        value: can not be larger than 8 bits''' #Write Back to main Memory if current row is dirty
self
address
value