-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
191 lines (177 loc) · 8.09 KB
/
Copy pathindex.html
File metadata and controls
191 lines (177 loc) · 8.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSE 351 VM Simulator</title>
<script language="javascript" type="text/javascript" src="../p5lib/p5.min.js"></script>
<script language="javascript" type="text/javascript" src="../p5lib/p5.dom.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.3/seedrandom.min.js"></script>
<script language="javascript" type="module" src="./src/App.js"></script>
<link rel="stylesheet" href="./css/App.css">
</head>
<body>
<h1>351 VM Simulator</h1>
<div class="grid-container">
<!-- System Parameters -->
<div id="sysParam">
<fieldset id="pFieldset">
<legend><b>System Parameters</b></legend>
<table>
<tr>
<!-- The page size choices are temporary for now -->
<td>Virtual Address Width:</td>
<td>
<select id="addrWidth" name="addrWidth">
<option value="10">10</option>
<option value="12" selected>12</option>
<option value="16">16</option>
</select> bits
</td>
</tr>
<tr>
<td>Page Size:</td>
<td>
<select name="pgSize" id="pgSize">
<option value="16" selected>16</option>
<option value="32">32</option>
</select> bytes
</td>
<tr>
<!-- The physical memory choices are temporary for now -->
<td>TLB Size:</td>
<td><select id="tlbSize" name="tlbSize">
<option value="4">4</option>
<option value="8">8</option>
<option value="16" selected>16</option>
<option value="32">32</option>
</select> entries
</td>
<tr>
<td>TLB Associativity:</td>
<td><select name="tlbE" id="tlbE">
<option value="1">1</option>
<option value="2">2</option>
<option value="4" selected>4</option>
<!-- <option value="8">8</option> -->
</select> - way
</td>
</tr>
<tr>
<td>Page Table Size:</td>
<!-- value to be calculated -->
<td id="ptSize">To be calculated</td>
</tr>
<tr>
<td>Physical Memory Size:</td>
<td><select name="physMemSize" id="physMemSize">
<option value="128">128</option>
<option value="256" selected>256</option>
<option value="512">512</option>
</select> Bytes </td>
</tr>
<tr>
<!-- value t be calculated -->
<td>Virtual Memory Size:</td>
<td id="vmSize">To be calculated</td>
</tr>
<tr>
<td class="center-align">
<br><input id="paramButton" type="submit" value="Generate System">
</td>
<td class="center-align bottom-vertical-align">
<input id="paramBox" type="checkbox" name="paramBox">
<label for="explain">Explain</label>
</td>
</tr>
</table>
</fieldset>
</div>
<!-- Manual Memory Access -->
<div id="mma">
<fieldset>
<legend><b>Manual Memory Access:</b></legend>
<table>
<tr>
<td><input id="readButton" type="submit" value="Read"></td>
<td colspan="2">Addr: 0x<input id="rAddr" type="text" name="rAddr" size="4" maxlength="4"></td>
</tr>
<tr>
<td><input id="writeButton" type="submit" value="Write"></td>
<td>Addr: 0x<input id="wAddr" type="text" name="wAddr" size="4" maxlength="4"></td>
<td> Byte: 0x<input id="wData" type="text" name="wData" size="2" maxlength="2"></td>
</tr>
<tr>
<td>
<input id="mmaBox" type="checkbox" name="mmaBox">
<label for="showSteps">Step By Step</label>
</td>
</tr>
</table>
<table class="even-width-cell">
<tr class="grey-bg center-align">
<td>VPN</td>
<td>Offset</td>
<td class="white-bg"></td>
<td>TLB Tag</td>
<td>TLB Index</td>
<td class="white-bg"></td>
<td>PPN</td>
</tr>
<!-- note the id dispO was renamed to dispPO -->
<tr class="white-bg center-align">
<td id="dispVPN" class="green-bg">-</td>
<td id="dispPO" class="green-bg">-</td>
<td></td>
<td id="dispTLBTag" class="yellow-bg">-</td>
<td id="dispTLBIndex" class="yellow-bg">-</td>
<td></td>
<td id="dispPPN" class="purple-bg">-</td>
</tr>
<tr class="grey-bg center-align">
<td>TLB Hits</td>
<td>TLB Misses</td>
<td class="white-bg"></td>
<td>PT Hits</td>
<td>PT Misses</td>
</tr>
<tr class="white-bg center-align">
<td id="dispTLBHit" class="blue-bg">-</td>
<td id="dispTLBMiss" class="blue-bg">-</td>
<td></td>
<td id="dispPTHit" class="pink-bg">-</td>
<td id="dispPTMiss" class="pink-bg">-</td>
</tr>
</table>
</fieldset>
</div>
<!-- History -->
<div id="history">
<fieldset id="historyFieldset" style="text-align: center">
<legend style="text-align: left;"><b>History:</b></legend>
<textarea id="hist" rows="20" cols="19" disabled style="margin-top: 10px; resize: none;"></textarea>
<p></p>
<input id="loadHist" type="submit" value="Load"> ||
<input id="upButton" type="submit" value="↑">
<input id="dnButton" type="submit" value="↓">
</fieldset>
</div>
<!-- Simulation Messages -->
<div id="statusMsg">
<fieldset>
<legend><b>Simulation Messages</b></legend>
<textarea id="msgbox" rows="10" cols="97" disabled></textarea>
</fieldset>
</div>
<!-- Address Translation Diagram -->
<!-- <div id="addrTranslation">
<fieldset>
<legend><b>Address Translation</b></legend>
<div id="p5addrTranslationCanvas"></div>
</fieldset>
</div> -->
</div>
<!-- p5 Canvas to display TLB, PT, VM, Memory, and Disk -->
<div id="p5Canvas"></div>
</body>
</html>