main

AUTHOR
Version 
Mon Dec 6 2021 

Table of Contents

Table of contents

Namespace Index
Namespace List
Here is a list of all namespaces with brief descriptions:
main  	pagenum

Class Index
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
main.Cache  	pagenum
main.CacheLine  	pagenum

File Index
File List
Here is a list of all files with brief descriptions:
main.py  	pagenum

Namespace Documentation
main Namespace Reference
Classes
class Cache
class CacheLine
Functions
def main ()
def cacheRead (address, val)
def cacheWrite (address, val)
def cacheFlush (address, val)
def cacheView (address, val)
def hexBuilder (lineAddress)
def hex2Decimal (hex)
def memoryView (address, val)
def cacheDump (address, val)
def memoryDump (address, val)
def default (address, val)
def switch (command, address, val)
Variables
c = Cache()
list RAM = ["00"] * 256

Function Documentation
def main.cacheDump (  address,   val)

Copies data of the cache into a text file

address: Not Used
val: Not Used

return: None
 
def main.cacheFlush (  address,   val)

Clears out the entire cache and resets everything to 0

addresss: Not Used
val: Not Used

return: None
 
def main.cacheRead (  address,   val)

PUT DOCUMENTATION HERE 
def main.cacheView (  address,   val)

Displays the entire queue for the user to see while also displaying policies

address: Not Used
val: Not Used

return: None
 
def main.cacheWrite (  address,   val)

PUT DOCUMENTATION 
def main.default (  address,   val)

Runs if switch statement recieves invalid input

address: Not Used
val: Not Used

return: None
 
def main.hex2Decimal (  hex)

Converts a hexadecimal number into decimal

hex: hexadecimal number as a string

return: decimal number as an int
 
def main.hexBuilder (  lineAddress)

Converts an address from decimal to hexadecimal

lineAddress: Address is decimal form

return: Hexadecimal as a string
 
def main.main ()

Main function that runs the whole program
 
def main.memoryDump (  address,   val)

Copies data of the RAM into a text file

address: Not Used
val: Not Used

return: None
 
def main.memoryView (  address,   val)

Displays the current RAM for user

address: Not Used
val: Not Used

return: None
 
def main.switch (  command,   address,   val)

Switch statement equivalent for python 3

command: user input of which command to run
address: address value for cache-read/write
val: value for cache

return: user inputted function call

Variable Documentation
main.c = Cache()
list main.RAM = ["00"] * 256

Class Documentation
main.Cache Class Reference
Public Member Functions
def __init__ (self)
Public Attributes
size
total cache size 

block_size
size of each block 

e_val
associativity 

set_size
size of each set 

tag_l
length of tag address bit 

s_l
length of set address bits 

b_l
length of data block address bits 

pol
replacement policy 

hit
hit policy 

miss
miss policy 

num_hits
total number of hits 

num_misses
total number of misses 

sets
list of sets 

line_qs
queue of lines 

Detailed Description

Class to represent the entire cache based on user inputs

Attributes:
    size: total cache size
    block_size: size of each block
    e_val: associativity setting
    set_size: size of each set
    tag_l: length of set address bit
    s_l: length of set address bits
    b_l: length of data block address bits
    pol: replacement policy
    hit: hit policy
    miss: miss policy
    num_hits: total number of hits
    num_misses: total number of misses
    sets: list of sets
    lines_qs: queue of lines

Constructor & Destructor Documentation
def main.Cache.__init__ (  self)

Member Data Documentation
main.Cache.b_l

length of data block address bits 
main.Cache.block_size

size of each block 
main.Cache.e_val

associativity 
main.Cache.hit

hit policy 
main.Cache.line_qs

queue of lines 
main.Cache.miss

miss policy 
main.Cache.num_hits

total number of hits 
main.Cache.num_misses

total number of misses 
main.Cache.pol

replacement policy 
main.Cache.s_l

length of set address bits 
main.Cache.set_size

size of each set 
main.Cache.sets

list of sets 
main.Cache.size

total cache size 
main.Cache.tag_l

length of tag address bit 

The documentation for this class was generated from the following file:
main.py

main.CacheLine Class Reference
Public Member Functions
def __init__ (self)
def __str__ (self)
Public Attributes
valid
valid bit 

dirty
dirty bit 

tag
tag address as string 

data
Data as a dictionary. 

Detailed Description

Class to represent a line inside a cache block

Attributes:
    valid: valid bit
    dirty: dirty bit
    tag: tag bits
    data: dictionary representing the data bits in the line 

Constructor & Destructor Documentation
def main.CacheLine.__init__ (  self)

Member Function Documentation
def main.CacheLine.__str__ (  self)

toString method to display a line as: valid dirty tag data

Member Data Documentation
main.CacheLine.data

Data as a dictionary. 
main.CacheLine.dirty

dirty bit 
main.CacheLine.tag

tag address as string 
main.CacheLine.valid

valid bit 

The documentation for this class was generated from the following file:
main.py

File Documentation
main.py File Reference
Classes
class main.CacheLine
class main.Cache
Namespaces
namespace main
Functions
def main.main ()
def main.cacheRead (address, val)
def main.cacheWrite (address, val)
def main.cacheFlush (address, val)
def main.cacheView (address, val)
def main.hexBuilder (lineAddress)
def main.hex2Decimal (hex)
def main.memoryView (address, val)
def main.cacheDump (address, val)
def main.memoryDump (address, val)
def main.default (address, val)
def main.switch (command, address, val)
Variables
main.c = Cache()
list main.RAM = ["00"] * 256

Index
INDEX