Compare commits
4 Commits
452056f71c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f2c96180e4 | |||
| d5aed3cdeb | |||
| 00eefba7b7 | |||
| 59b086ce1c |
32
README.md
Normal file
32
README.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# CacheSim
|
||||||
|
CacheSim is an Elm-based website to simulate various cache hierarchy configurations. It supports
|
||||||
|
fully associative, direct mapped, and n-way set associative caches.
|
||||||
|
|
||||||
|
## Building and Hosting
|
||||||
|
CacheSim is entirely a front-end project. As long as the HTML, CSS, and generated JavaScript
|
||||||
|
are hosted somewhere, it will work.
|
||||||
|
|
||||||
|
CacheSim is built using Elm and Sass. As such, you will need the compilers for the two
|
||||||
|
languages. On Arch Linux, this means `sassc` for Sass, and `elm-platform-bin` (from AUR).
|
||||||
|
On other platforms, you can use npm:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install -g elm sass
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, to build the project, you can use the following commands:
|
||||||
|
```
|
||||||
|
mkdir -p static/js
|
||||||
|
mkdir -p static/css
|
||||||
|
sassc static/scss/style.scss static/css/style.css
|
||||||
|
elm make src/Main.elm --output=static/js/elm.js --optimize
|
||||||
|
```
|
||||||
|
Replace `sassc` with `sass` in the third command if you installed Sass from npm.
|
||||||
|
|
||||||
|
Now, the `index.html` file and everything in the `static` folder can be safely copied
|
||||||
|
into any directory exposed by a web server. I use my university `public_html` folder.
|
||||||
|
Below are the _SFTP commands_ I use to upload a fresh copy of the project:
|
||||||
|
```
|
||||||
|
put index.html public_html/ECE472/index.html
|
||||||
|
put -r static public_html/ECE472/static
|
||||||
|
```
|
||||||
@@ -137,7 +137,10 @@ viewCache level (cm, cs) =
|
|||||||
slotHtml s =
|
slotHtml s =
|
||||||
case s of
|
case s of
|
||||||
Empty -> td [] [ text "" ]
|
Empty -> td [] [ text "" ]
|
||||||
Used l a -> td [] [ text <| String.fromInt a ]
|
Used l a -> td [] [ text <|
|
||||||
|
(String.fromInt (a * cm.blockSize * 4)) ++
|
||||||
|
"-" ++
|
||||||
|
(String.fromInt ((a + 1) * cm.blockSize * 4 - 1)) ]
|
||||||
in
|
in
|
||||||
List.map slotHtml set
|
List.map slotHtml set
|
||||||
cacheRow = List.concat <| List.map setRow cs
|
cacheRow = List.concat <| List.map setRow cs
|
||||||
|
|||||||
Reference in New Issue
Block a user