Skip to content

Commit 8c6b1a4

Browse files
endes0oxcabe
andauthored
feat: add stats collection and visualization (#85)
* Add initial stats recollection * wip stats ui * mock stats ui * Add some stats actions and show them * Finished superescalar tab * Fix stats reset on machine reset * fixes * wip show batch execution stats * fix * remove polyfill and updated yarn * finished show batch execution stats * Add download button * minor fixes * better batch stats export * added stats to VLIW and fixes * i18n and style * "fix" the VLIW batch execution * fix(stats): type StatsTabComponent, integrate yarn, minor fixes * changed react-echarts to echarts-for-react * "use strict"; * misspells and names fixes, style and minor fixes --------- Co-authored-by: Óscar Carrasco <[email protected]>
1 parent d577cd8 commit 8c6b1a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3079
-1756
lines changed

.yarn/releases/yarn-4.0.2.cjs renamed to .yarn/releases/yarn-4.1.0.cjs

Lines changed: 336 additions & 336 deletions
Large diffs are not rendered by default.

.yarn/sdks/eslint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint",
3-
"version": "8.52.0-sdk",
3+
"version": "8.57.0-sdk",
44
"main": "./lib/api.js",
55
"type": "commonjs",
66
"bin": {

.yarn/sdks/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript",
3-
"version": "5.2.2-sdk",
3+
"version": "5.3.3-sdk",
44
"main": "./lib/typescript.js",
55
"type": "commonjs",
66
"bin": {

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
yarnPath: .yarn/releases/yarn-4.0.2.cjs
1+
yarnPath: .yarn/releases/yarn-4.1.0.cjs

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<p>JavaScript is required to run this application.</p>
1313
</noscript>
1414
<div id="app"></div>
15-
<script src="https://cdn.polyfill.io/v3/polyfill.min.js"></script>
15+
1616
<script type="module" src="/src/main.tsx"></script>
1717
</html>

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.2.0",
44
"description": "Educational superescalar and VLIW simulator",
55
"type": "module",
6+
"packageManager": "[email protected]",
67
"scripts": {
78
"dev": "vite",
89
"build": "tsc && vite build",
@@ -31,6 +32,8 @@
3132
"@types/react": "^18.2.15",
3233
"@types/react-dom": "^18.2.7",
3334
"bootstrap": "^5.1.3",
35+
"echarts": "^5.4.3",
36+
"echarts-for-react": "^3.0.2",
3437
"i18next": "^22.4.14",
3538
"i18next-browser-languagedetector": "7.1.0",
3639
"i18next-http-backend": "^2.2.0",
@@ -73,6 +76,5 @@
7376
"typescript": "^5.0.2",
7477
"vite": "^4.4.5",
7578
"vitest": "^0.34.6"
76-
},
77-
"packageManager": "[email protected]"
79+
}
7880
}

public/locales/en/common.json

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"load": "Load",
66
"downloadMemory": "Download Memory(JSON)",
77
"downloadContent": "Download content Memory - Registers",
8-
"downloadCode": "Download Code"
8+
"downloadCode": "Download Code",
9+
"downloadStats": "Download stats events(JSON)"
910
},
1011
"view": {
1112
"name": "View",
@@ -41,6 +42,7 @@
4142
"speed": "Speed",
4243
"superescalar": "Superescalar",
4344
"memReg": "Memory - Registers",
45+
"stats": "Stats",
4446
"vliw": "VLIW"
4547
},
4648
"authorModal": {
@@ -150,12 +152,9 @@
150152
"cacheFailLatency": "Cache miss latency"
151153
},
152154
"batchResults": {
153-
"title": "Batch Results",
154-
"replications": "Replications",
155-
"average": "Average cycles per execution",
156-
"standardDeviation": "Standard Deviation",
157-
"worst": "Worst case",
158-
"best": "Best case"
155+
"title": "Batch Execution done",
156+
"subtext": "Go to the stats tab to see the results",
157+
"download": "Download stats events(JSON)"
159158
},
160159
"landingPage": {
161160
"pagetitle": "SIMDEWeb",
@@ -196,5 +195,45 @@
196195
"FloatMult": "xFloat",
197196
"Memory": "Memory",
198197
"Jump": "Jump"
198+
},
199+
200+
"stats": {
201+
"toolbox": {
202+
"dataView": "Data View",
203+
"close": "Close",
204+
"refresh": "Refresh"
205+
},
206+
"units": {
207+
"prefetch": "Prefetch",
208+
"decode": "Decoder",
209+
"rob": "ROB",
210+
"fu0": "Integer + FU",
211+
"fu1": "Integer x FU",
212+
"fu2": "Float + FU",
213+
"fu3": "Float x FU",
214+
"fu4": "Memory FU",
215+
"fu5": "Jump FU",
216+
"rs0": "Integer + RS",
217+
"rs1": "Integer x RS",
218+
"rs2": "Float + RS",
219+
"rs3": "Float x RS",
220+
"rs4": "Memory RS",
221+
"rs5": "Jump RS"
222+
},
223+
"statuses": {
224+
"prefetchNumber": "Prefetching",
225+
"decodeNumber": "Decoding",
226+
"issueNumber": "Issuing",
227+
"executeNumber": "Executing",
228+
"writeBackNumber": "On Write Back",
229+
"commitNumber": "Commiting"
230+
},
231+
"unitsUsage": "Units usage per cycle",
232+
"instrStatuses": "Instructions statuses per cycle",
233+
"cycles": "Cycles per iteration",
234+
"commitDiscard": "Commited vs Discarded instructions",
235+
"commited": "Commited",
236+
"discarded": "Discarded",
237+
"statusAverage": "Per instruction status average cycles"
199238
}
200239
}

public/locales/es/common.json

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"load": "Cargar",
66
"downloadMemory": "Descargar memoria(JSON)",
77
"downloadContent": "Descargar contenido Memoria - Registros",
8-
"downloadCode": "Descargar código"
8+
"downloadCode": "Descargar código",
9+
"downloadStats": "Descargar eventos estadísticos(JSON)"
910
},
1011
"view": {
1112
"name": "Ver",
@@ -41,6 +42,7 @@
4142
"speed": "Velocidad",
4243
"superescalar": "Superescalar",
4344
"memReg": "Memoria - Registros",
45+
"stats": "Estadísticas",
4446
"vliw": "VLIW"
4547
},
4648
"authorModal": {
@@ -149,12 +151,9 @@
149151
"cacheFailLatency": "Latencia en fallos de cachés"
150152
},
151153
"batchResults": {
152-
"title": "Resultados de la ejecución por lotes",
153-
"replications": "Réplicas",
154-
"average": "Número medio de ciclos por ejecución",
155-
"standardDeviation": "Desviación éstandar",
156-
"worst": "Peor caso",
157-
"best": "Mejor caso"
154+
"title": "Ejecución por lotes realizada",
155+
"subtext": "Dirijase a la pestaña de estadísticas para ver los resultados",
156+
"download": "Descargar eventos estadísticos(JSON)"
158157
},
159158
"landingPage": {
160159
"pagetitle": "SIMDEWeb",
@@ -194,5 +193,45 @@
194193
"FloatMult": "xFlotante",
195194
"Memory": "Memoria",
196195
"Jump": "Salto"
196+
},
197+
198+
"stats": {
199+
"toolbox": {
200+
"dataView": "Ver datos",
201+
"close": "Cerrar",
202+
"refresh": "Recargar"
203+
},
204+
"units": {
205+
"prefetch": "Prefetch",
206+
"decode": "Decoder",
207+
"rob": "ROB",
208+
"fu0": "UF + Entera",
209+
"fu1": "UF x Entera",
210+
"fu2": "UF + Flotante",
211+
"fu3": "UF x Flotante",
212+
"fu4": "UF Memoria",
213+
"fu5": "UF Salto",
214+
"rs0": "ER + Entera",
215+
"rs1": "ER x Entera",
216+
"rs2": "ER + Flotante",
217+
"rs3": "ER x Flotante",
218+
"rs4": "ER Memoria",
219+
"rs5": "ER Salto"
220+
},
221+
"statuses": {
222+
"prefetchNumber": "En Prefetching",
223+
"decodeNumber": "En decodificación",
224+
"issueNumber": "En emisión",
225+
"executeNumber": "En ejecución",
226+
"writeBackNumber": "En escritura",
227+
"commitNumber": "En commit"
228+
},
229+
"unitsUsage": "Ocupación de cada unidad por ciclo",
230+
"instrStatuses": "Instrucciones en cada etapa por ciclo",
231+
"cycles": "Ciclos por replica",
232+
"commitDiscard": "Instrucciones commiteadas VS descartadas",
233+
"commited": "Commiteada",
234+
"discarded": "Descartada",
235+
"statusAverage": "Media de ciclos de cada etapa por instrucción"
197236
}
198237
}

src/core/Common/FunctionalUnit.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const FUNCTIONALUNITTYPESQUANTITY =
2525
export interface FunctionalUntitVisualEntry {
2626
id: number;
2727
value: string;
28-
uuid: number;
28+
uid: number;
2929
}
3030

3131
const FunctionalUnitLantencies: Record<FunctionalUnitType, number> = {
@@ -74,6 +74,10 @@ export class FunctionalUnit {
7474
return this._latency;
7575
}
7676

77+
public get usage(): number {
78+
return this._instructions.length / this._latency;
79+
}
80+
7781
constructor(
7882
private _type: FunctionalUnitType,
7983
private _latency: number = FunctionalUnitLantencies[_type]
@@ -129,10 +133,10 @@ export class FunctionalUnit {
129133
return this._stalled > 0;
130134
}
131135

132-
public getReadyInstructionUuid(): number {
136+
public getReadyInstructionUid(): number {
133137
return this._instructions.length > 0 &&
134138
this._instructions[0].blankTimeUnitsAhead == 0
135-
? this._instructions[0].instruction.uuid
139+
? this._instructions[0].instruction.uid
136140
: -1;
137141
}
138142

@@ -241,12 +245,12 @@ export class FunctionalUnit {
241245
list.push({
242246
id: this._instructions[j].instruction.id,
243247
value: this._instructions[j].instruction.toString(),
244-
uuid: this._instructions[j].instruction.uuid,
248+
uid: this._instructions[j].instruction.uid,
245249
});
246250
j++;
247251
lastPos = i + 1;
248252
} else {
249-
list.push({ id: -1, value: "", uuid: -1 });
253+
list.push({ id: -1, value: "", uid: -1 });
250254
}
251255
}
252256

src/core/Common/Instruction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export class Instruction {
1111
protected _label: string;
1212
protected _breakPoint: boolean = false;
1313

14-
public get uuid(): number {
15-
return this._uuid;
14+
public get uid(): number {
15+
return this._uid;
1616
}
1717

1818
public get breakPoint(): boolean {
@@ -35,7 +35,7 @@ export class Instruction {
3535
return this._operandsString;
3636
}
3737

38-
constructor(from?: Instruction, protected _uuid?: number) {
38+
constructor(from?: Instruction, protected _uid?: number) {
3939
if (from) {
4040
this.id = from.id;
4141
this.basicBlock = from.basicBlock;

0 commit comments

Comments
 (0)