|
1 | | -"# CacheSimulator" |
| 1 | +# cache tables |
| 2 | +## Created for education oriented stuff, this library will let students create cache tables extremelly easy so they can learn more about the hardware and spend less time doing this stuff by hand. |
| 3 | +### Author: @notZombieFood |
| 4 | + |
| 5 | +## How to |
| 6 | +First, be sure you have installed pip and run this command. |
| 7 | +```shell |
| 8 | +pip install cache_tables |
| 9 | +``` |
| 10 | +Load the libray into python |
| 11 | +```python |
| 12 | +import cache_tables |
| 13 | +cache_tables.demo() #this will run some functions to demonstrate the functionality |
| 14 | +``` |
| 15 | +## Code example, this should be easy to understand |
| 16 | +```python |
| 17 | +addresses = [3,180,43,2,191,88,190,14,181,44,186,253] |
| 18 | +print ("Example 1 \nDirect Associative, with 8 blocks of 1 word \n") |
| 19 | +cache_tables.directAssociative(addresses,8,1) |
| 20 | +print ("Example 2 \nDirect Associative, with 4 blocks of 2 word\n") |
| 21 | +cache_tables.directAssociative(addresses,4,2) |
| 22 | +print ("Example 3 \nDirect Associative, with 2 blocks of 4 word\n") |
| 23 | +cache_tables.directAssociative(addresses,2,4) |
| 24 | +print ("Example 4 \nFull Associative Random, with 4 word\n") |
| 25 | +cache_tables.fullAssociative(addresses,4,"RANDOM") |
| 26 | +print ("Example 4 \nFull Associative FIFO, with 4 word\n") |
| 27 | +cache_tables.fullAssociative(addresses,4,"FIFO") |
| 28 | +print ("Example 4 \nFull Associative MRU, with 8 word\n") |
| 29 | +cache_tables.fullAssociative(addresses,4,"MRU") |
| 30 | +print ("Example 4 \nFull Associative LRU, with 8 word\n") |
| 31 | +cache_tables.fullAssociative(addresses,4,"LRU") |
| 32 | +``` |
| 33 | +## Help, this will give you further info |
| 34 | +```python |
| 35 | +help(cache_tables.fullAssociative) |
| 36 | +``` |
| 37 | + |
| 38 | +## Will I implement partial associative? |
| 39 | +Yes, sometime. But I can also receive some help if any of you wants to! |
| 40 | + |
| 41 | + |
0 commit comments