Skip to content

Commit

Permalink
misspells and names fixes, style and minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
endes0 committed Mar 8, 2024
1 parent ae4bc39 commit 96ce7c9
Show file tree
Hide file tree
Showing 26 changed files with 289 additions and 284 deletions.
4 changes: 2 additions & 2 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"downloadMemory": "Download Memory(JSON)",
"downloadContent": "Download content Memory - Registers",
"downloadCode": "Download Code",
"downloadStats": "Descargar stats events(JSON)"
"downloadStats": "Download stats events(JSON)"
},
"view": {
"name": "View",
Expand Down Expand Up @@ -228,7 +228,7 @@
"writeBackNumber": "On Write Back",
"commitNumber": "Commiting"
},
"unitsOcupation": "Units ocupation per cycle",
"unitsUsage": "Units usage per cycle",
"instrStatuses": "Instructions statuses per cycle",
"cycles": "Cycles per iteration",
"commitDiscard": "Commited vs Discarded instructions",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
"writeBackNumber": "En escritura",
"commitNumber": "En commit"
},
"unitsOcupation": "Ocupación de cada unidad por ciclo",
"unitsUsage": "Ocupación de cada unidad por ciclo",
"instrStatuses": "Instrucciones en cada etapa por ciclo",
"cycles": "Ciclos por replica",
"commitDiscard": "Instrucciones commiteadas VS descartadas",
Expand Down
12 changes: 6 additions & 6 deletions src/core/Common/FunctionalUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const FUNCTIONALUNITTYPESQUANTITY =
export interface FunctionalUntitVisualEntry {
id: number;
value: string;
uuid: number;
uid: number;
}

const FunctionalUnitLantencies: Record<FunctionalUnitType, number> = {
Expand Down Expand Up @@ -74,7 +74,7 @@ export class FunctionalUnit {
return this._latency;
}

public get ocupation(): number {
public get usage(): number {
return this._instructions.length / this._latency;
}

Expand Down Expand Up @@ -133,10 +133,10 @@ export class FunctionalUnit {
return this._stalled > 0;
}

public getReadyInstructionUuid(): number {
public getReadyInstructionUid(): number {
return this._instructions.length > 0 &&
this._instructions[0].blankTimeUnitsAhead == 0
? this._instructions[0].instruction.uuid
? this._instructions[0].instruction.uid
: -1;
}

Expand Down Expand Up @@ -245,12 +245,12 @@ export class FunctionalUnit {
list.push({
id: this._instructions[j].instruction.id,
value: this._instructions[j].instruction.toString(),
uuid: this._instructions[j].instruction.uuid,
uid: this._instructions[j].instruction.uid,
});
j++;
lastPos = i + 1;
} else {
list.push({ id: -1, value: "", uuid: -1 });
list.push({ id: -1, value: "", uid: -1 });
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/Common/Instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export class Instruction {
protected _label: string;
protected _breakPoint: boolean = false;

public get uuid(): number {
return this._uuid;
public get uid(): number {
return this._uid;
}

public get breakPoint(): boolean {
Expand All @@ -35,7 +35,7 @@ export class Instruction {
return this._operandsString;
}

constructor(from?: Instruction, protected _uuid?: number) {
constructor(from?: Instruction, protected _uid?: number) {
if (from) {
this.id = from.id;
this.basicBlock = from.basicBlock;
Expand Down
6 changes: 3 additions & 3 deletions src/core/Superescalar/PrefetchUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Instruction } from "../Common/Instruction";
export interface PrefetchUnitVisualEntry {
id: number;
value: string;
uuid: number;
uid: number;
}

export class PrefetchUnit {
Expand All @@ -13,7 +13,7 @@ export class PrefetchUnit {
return this._size;
}

public get ocupation() {
public get usage() {
return this._entries.length / this._size;
}

Expand Down Expand Up @@ -45,7 +45,7 @@ export class PrefetchUnit {

public getVisualData(): PrefetchUnitVisualEntry[] {
return this._entries.map((inst) => {
return { id: inst.id, value: inst.toString(), uuid: inst.uuid };
return { id: inst.id, value: inst.toString(), uid: inst.uid };
});
}
}
67 changes: 32 additions & 35 deletions src/core/Superescalar/ReorderBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Instruction } from "../Common/Instruction";
export interface VisualReorderBufferEntry {
instruction: {
id: string;
uuid: number;
uid: number;
value: string;
};
destinyRegister: string;
Expand Down Expand Up @@ -32,7 +32,7 @@ export class ReorderBuffer {
return this._size;
}

public get ocupation() {
public get usage() {
return this._queue.length / this._size;
}

Expand Down Expand Up @@ -82,7 +82,7 @@ export class ReorderBuffer {
}

/**
* getRegisterMapping - this method returns the rob instr uuid wich will write in that register.
* getRegisterMapping - this method returns the rob instr uid wich will write in that register.
*/
public getRegisterMapping(
register: number,
Expand Down Expand Up @@ -131,14 +131,11 @@ export class ReorderBuffer {
}

/**
* commitInstruction - this method commits an instruction from the reorder buffer, returning their uuid
* commitInstruction - this method commits an instruction from the reorder buffer, returning their uid
*/
public commitInstruction(): number {
let e = this._queue.shift();
if (e == undefined) {
return -1;
}
return e.instruction.uuid;
const e = this._queue.shift();
return e ? e.instruction.uid : -1;
}

/**
Expand All @@ -149,9 +146,9 @@ export class ReorderBuffer {
? this._FprMapping
: this._GprMapping;
let register = this._queue[0].destinyRegister;
let uuid = this._queue[0].instruction.uuid;
let uid = this._queue[0].instruction.uid;

if (mapping[register] === uuid) {
if (mapping[register] === uid) {
delete mapping[register];
return true;
}
Expand All @@ -174,16 +171,16 @@ export class ReorderBuffer {

if (instruction.getDestinyRegister() !== -1) {
if (instruction.isDestinyRegisterFloat()) {
this._FprMapping[instruction.getDestinyRegister()] = instruction.uuid;
this._FprMapping[instruction.getDestinyRegister()] = instruction.uid;
} else {
this._GprMapping[instruction.getDestinyRegister()] = instruction.uuid;
this._GprMapping[instruction.getDestinyRegister()] = instruction.uid;
}
}
}

public getInstructionPos(uuid: number): number {
public getInstructionPos(uid: number): number {
for (let i = 0; i < this._queue.length; i++) {
if (this._queue[i].instruction.uuid === uuid) {
if (this._queue[i].instruction.uid === uid) {
return i;
}
}
Expand All @@ -193,39 +190,39 @@ export class ReorderBuffer {
/**
* executeInstruction - this method executes an instruction from the reorder buffer
*/
public executeInstruction(uuid: number) {
this._queue[this.getInstructionPos(uuid)].superStage =
public executeInstruction(uid: number) {
this._queue[this.getInstructionPos(uid)].superStage =
SuperStage.SUPER_EXECUTE;
}

/**
* writeResultValue - this method writes the result value of an instruction to the reorder buffer
*/
public writeResultValue(uuid: number, value: number) {
let pos = this.getInstructionPos(uuid);
public writeResultValue(uid: number, value: number) {
let pos = this.getInstructionPos(uid);
this._queue[pos].value = value;
this._queue[pos].ready = true;
this._queue[pos].superStage = SuperStage.SUPER_WRITERESULT;
}

public getInstruction(uuid: number = -1): Instruction {
let pos = uuid === -1 ? 0 : this.getInstructionPos(uuid);
public getInstruction(uid: number = -1): Instruction {
let pos = uid === -1 ? 0 : this.getInstructionPos(uid);
return this._queue[pos].instruction;
}

/**
* writeResultAddress - this method writes the result address of an instruction to the reorder buffer
*/
public writeResultAddress(uuid: number, address: number) {
let pos = this.getInstructionPos(uuid);
public writeResultAddress(uid: number, address: number) {
let pos = this.getInstructionPos(uid);
this._queue[pos].address = address;
}

/**
* hasResultValue - this method checks if an instruction has already the result value
*/
public hasResultValue(uuid: number): boolean {
let pos = this.getInstructionPos(uuid);
public hasResultValue(uid: number): boolean {
let pos = this.getInstructionPos(uid);
return this._queue[pos].ready;
}

Expand All @@ -239,8 +236,8 @@ export class ReorderBuffer {
/**
* hasResultAddress - this method checks if an instruction has already the result address
*/
public hasResultAddress(uuid: number): boolean {
let pos = this.getInstructionPos(uuid);
public hasResultAddress(uid: number): boolean {
let pos = this.getInstructionPos(uid);
return this._queue[pos].address !== -1;
}

Expand All @@ -254,8 +251,8 @@ export class ReorderBuffer {
/**
* hasPreviousStores - this method checks if there are previous store instructions that write to the same address
*/
public hasPreviousStores(uuid: number): boolean {
let pos = this.getInstructionPos(uuid);
public hasPreviousStores(uid: number): boolean {
let pos = this.getInstructionPos(uid);
let address = this._queue[pos].address;
for (let i = 0; i < pos; i++) {
// check if it is a store instruction and if it the address is the same or if it doesn't have a result address yet
Expand All @@ -273,7 +270,7 @@ export class ReorderBuffer {
return this._queue.map((entry) => {
if (entry != null) {
let aux = {
instruction: { id: "", uuid: -1, value: "" },
instruction: { id: "", uid: -1, value: "" },
destinyRegister:
entry.destinyRegister !== -1 ? "" + entry.destinyRegister : "-",
value: "" + entry.value,
Expand All @@ -289,13 +286,13 @@ export class ReorderBuffer {
}
}
aux.instruction.id = "" + entry.instruction.id;
aux.instruction.uuid = entry.instruction.uuid;
aux.instruction.uid = entry.instruction.uid;
aux.instruction.value = entry.instruction.toString();
}
return aux;
}
return {
instruction: { id: "", uuid: -1, value: "" },
instruction: { id: "", uid: -1, value: "" },
destinyRegister: "",
value: "",
address: "",
Expand All @@ -316,10 +313,10 @@ export class ReorderBuffer {
return visualMap;
}

public getVisualInstructionMap(): { [uuid: number]: number } {
let visualMap: { [uuid: string]: number } = {};
public getVisualInstructionMap(): { [uid: number]: number } {
let visualMap: { [uid: string]: number } = {};
for (let i = 0; i < this._queue.length; i++) {
visualMap[this._queue[i].instruction.uuid] = i;
visualMap[this._queue[i].instruction.uid] = i;
}
return visualMap;
}
Expand Down
Loading

0 comments on commit 96ce7c9

Please sign in to comment.