forked from rinz13r/tomasulo-simulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
219 lines (197 loc) · 7.68 KB
/
index.html
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<!DOCTYPE html>
<html lang="en">
<head>
<title>Tomasulo's Algorithm Simulator</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Tomasulo's Algorithm Simulator</h2>
<p>Set instructions and register values and begin the simulation</p>
<!-- Button to Open the Modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">Program Builder</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#regModal">Register Values</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#rsConfigModal">RS Config</button>
<button type="button" class="btn btn-primary" onclick="console.log ('reset'); global_clk = 0; document.getElementById ('cycle').innerHTML = global_clk; reset=true; clearTableBodyById ('rstbl'); clearTableBodyById ('robtbl'), clearTableBodyById ('rftbl')">Reset</button>
<!-- The Modal -->
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Program builder</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
Select Instructions and its operands to run the simulation
<button type="button" class="btn btn-primary" onclick="loadExample1 ()">Example #1</button>
<button type="button" class="btn btn-primary" onclick="loadExample2 ()">Example #2</button>
<table id = "itbl" class="table table-bordered">
<thead>
<tr>
<th>Op</th>
<th>Dest</th>
<th>Src1</th>
<th>Src2</th>
</tr>
</thead>
<tbody></tbody>
<tfoot>
<tr>
<td colspan="100%">
<button style="width:100%" onclick="addRow ()">+</button>
</td>
</tr>
</tfoot>
</table>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="regModal">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Register Values</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
Select Register Values to run the simulation
<table style="max-height:300px;" id = "rtbl" class="table table-responsive">
<thead>
<tr>
<th>Register</th>
<th>Value</th>
</tr>
</thead>
<tbody></tbody>
<tfoot></tfoot>
</table>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="rsConfigModal">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">RS/FU Config</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
Select simulation parameters of RSs & FUs
<table id = "configtbl" class="table table-responsive">
<thead>
<tr>
<th>Op</th>
<th>#RS</th>
<th>#FU</th>
<th>Delay</th>
</tr>
</thead>
<tbody></tbody>
<tfoot></tfoot>
</table>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<div id = "simulation-area" class = "container d-noned">
<div class = "row">
<p></p>
</div>
<div class = "row">
<div class="col">
<button type="button" class="btn btn-danger" id="tick" onclick="run()">+</button>
<button type="button" class="btn btn-danger" id="tick5" onclick="for(var i=0;i<5;i++)run()">+5</button>
</div>
<div class = "col">
<h2>Cycle : <text id = "cycle"></text></h2>
</div>
</div>
<div class = "row">
<div class = "col" id = "rs">
<table id = "rstbl" class="table table-bordered">
<thead>
<tr><th colspan="100%">Reservation stations</th></tr>
<tr>
<th>Instr#</th>
<th>#</th>
<th>Op</th>
<th>Dst</th>
<th>Operand1</th>
<th>Operand2</th>
<th>Discard?</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class = "col" id = "rob">
<table id = "robtbl" class="table table-bordered table-responsive" style="max-height:500px;">
<thead>
<tr><th colspan="100%">ROB</th></tr>
<tr>
<th>Instr#</th>
<th>Pointer</th>
<th>Reg</th>
<th>Value</th>
<th>Done</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class = "col" id = "RegisterFile">
<table id = "rftbl" class="table table-bordered table-responsive" style="max-height:500px;">
<thead>
<tr><th colspan="100%">Register File</th></tr>
<tr>
<th>#</th>
<th>Val</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
<script type = "text/javascript" src = "script.js"></script>
</body>
</html>
<script type = "text/javascript" src = "js/render.js"></script>
<script type = "text/javascript" src = "js/Table.js"></script>
<script type = "text/javascript" src = "js/core/CDB.js"> </script>
<script type = "text/javascript" src = "js/core/RAT.js"> </script>
<script type = "text/javascript" src = "js/core/ROB.js"> </script>
<script type = "text/javascript" src = "js/core/RS.js"> </script>
<script type = "text/javascript" src = "js/core/RegisterFile.js"> </script>
<script type = "text/javascript" src = "js/core/Chip.js"> </script>
<script type = "text/javascript" src = "js/core/Exception.js"> </script>
<script type = "text/javascript" src = "js/core/FunctionalUnit.js"> </script>
<script type = "text/javascript" src = "js/core/IssueUnit.js"> </script>
<script type = "text/javascript" src = "js/app.js"> </script>
</html>