Skip to content

Commit

Permalink
Add Netlify Status and Translations, add breakpoints default value.
Browse files Browse the repository at this point in the history
Fix menu, documentation and config, DLX Table, clear code and performance.
  • Loading branch information
nonodev96 committed Jan 6, 2022
1 parent c728d9a commit f2442a7
Show file tree
Hide file tree
Showing 19 changed files with 521 additions and 274 deletions.
60 changes: 30 additions & 30 deletions DLX-TABLE-Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@ DLX-TABLE Instruction

## Type I - J

| (bit0-2)(bit3-5) | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
|:----------------:|:--------:|:-------:|:----:|:-----:|:----:|:----:|:----:|:----:|
| 001 | (rr alu) | (float) | J | JAL | BEQZ | BNEZ | BFPT | BFPF |
| 001 | ADDI | ADDUI | SUBI | SUBUI | ANDI | ORI | XORI | LHI |
| 010 | RFE | TRAP | JR | JALR | SLLI | - | SRLI | SRAI |
| 011 | SEQI | SNEI | SLTI | SGTI | SLEI | SGEI | - | - |
| 100 | LB | LH | - | LW | LBU | LHU | LF | LD |
| 101 | SB | SH | - | SW | - | - | SF | SD |
| 110 | - | - | - | - | - | - | - | - |
| 111 | - | - | - | - | - | - | - | - |
| (bit0-2)(bit3-5) | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
|:----------------:|:----------|:--------|:------|:------|:------|:------|:------|:------|
| 000 | (rr alu) | (float) | J | JAL | BEQZ | BNEZ | BFPT | BFPF |
| 001 | ADDI | ADDUI | SUBI | SUBUI | ANDI | ORI | XORI | LHI |
| 010 | RFE/SRLI | TRAP | JR | JALR | SLLI | - | SRLI? | SRAI? |
| 011 | SEQI/SRAI | SNEI | SLTI | SGTI | SLEI | SGEI | - | - |
| 100 | LB | LH | - | LW | LBU | LHU | LF | LD |
| 101 | SB | SH | - | SW | - | - | SF | SD |
| 110 | - | - | - | - | - | - | - | - |
| 111 | - | - | - | - | - | - | - | - |

## Type R - OPCODE = 0

| (bit26-28)(bit29-31) | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
|:--------------------:|:------:|:------:|:----:|:----:|:-------:|:-------:|:---:|:---:|
| 001 | - | - | - | - | SLL | - | SRL | SRA |
| 001 | - | - | - | - | - | - | - | - |
| 010 | - | - | SLTU | SGTU | SLEU | SGEU | - | - |
| 011 | MULT | MULTU | DIV | DIVU | - | - | - | - |
| 100 | ADD | ADDU | SUB | SUBU | AND | OR | XOR | - |
| 101 | SEQ | SNE | SLT | SGT | SLE | SGE | - | - |
| 110 | MOVI2S | MOVS2I | MOVF | MOVD | MOVFP2I | MOVI2FP | - | - |
| 111 | - | - | - | - | - | - | - | - |
| (bit26-28)(bit29-31) | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
|:--------------------:|:-------|:--------|:--------|:-------|:--------|:--------|:------|:------|
| 000 | - | - | -/SRLI | -/SRAI | SLL | - | SRL | SRA |
| 001 | - | - | - | - | - | - | - | - |
| 010 | - | - | SLTU | SGTU | SLEU | SGEU | - | - |
| 011 | MULT | MULTU | DIV | DIVU | - | - | - | - |
| 100 | ADD | ADDU | SUB | SUBU | AND | OR | XOR | - |
| 101 | SEQ | SNE | SLT | SGT | SLE | SGE | - | - |
| 110 | MOVI2S | MOVS2I | MOVF | MOVD | MOVFP2I | MOVI2FP | - | - |
| 111 | - | - | - | - | - | - | - | - |

## Type R - OPCODE = 1

| (bit26-28)(bit29-31) | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
|:--------------------:|:------:|:------:|:------:|:------:|:------:|:------:|:-----:|:----:|
| 001 | ADDF | SUBF | MULTF | DIVF | ADDD | SUBD | MULTD | DIVD |
| 001 | CVTF2D | CVTF2I | CVTD2F | CVTD2I | CVTI2F | CVTI2D | - | - |
| 010 | EQF | NEF | LTF | GTF | LEF | GEF | - | - |
| 011 | EQD | NED | LTD | GTD | LED | GED | - | - |
| 100 | - | - | - | - | - | - | - | - |
| 101 | - | - | - | - | - | - | - | - |
| 110 | - | - | - | - | - | - | - | - |
| 111 | - | - | - | - | - | - | - | - |
| (bit26-28)(bit29-31) | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 |
|:--------------------:|:-------|:-------|:-------|:-------|:-------|:-------|:-------|:------|
| 000 | ADDF | SUBF | MULTF | DIVF | ADDD | SUBD | MULTD | DIVD |
| 001 | CVTF2D | CVTF2I | CVTD2F | CVTD2I | CVTI2F | CVTI2D | - | - |
| 010 | EQF | NEF | LTF | GTF | LEF | GEF | - | - |
| 011 | EQD | NED | LTD | GTD | LED | GED | - | - |
| 100 | - | - | - | - | - | - | - | - |
| 101 | - | - | - | - | - | - | - | - |
| 110 | - | - | - | - | - | - | - | - |
| 111 | - | - | - | - | - | - | - | - |
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
THUMDER
=======
[![Netlify Status](https://api.netlify.com/api/v1/badges/491cdbc6-34ea-4ef0-92c0-be4f2a2ec3cb/deploy-status)](https://app.netlify.com/sites/thumder/deploys)

# Introduction | THUMDER

Expand All @@ -11,7 +12,6 @@ THUMDER

[![Angular Logo](https://www.vectorlogo.zone/logos/angular/angular-icon.svg)](https://angular.io/)
[![Electron Logo](https://www.vectorlogo.zone/logos/electronjs/electronjs-icon.svg)](https://electronjs.org/)

## Currently, runs with:

- Angular v10.2.5
Expand Down
158 changes: 80 additions & 78 deletions src/app/CONSTAST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const REGEX_IS_ABSOLUTE_HREF = new RegExp("(?:^[a-z][a-z0-9+.-]*:|\/\/)",
export const REGEX_HEXADECIMAL_08 = new RegExp("^(0x|0X|)?([a-fA-F0-9]{08})$", "i");
export const REGEX_HEXADECIMAL_16 = new RegExp("^(0x|0X|)?([a-fA-F0-9]{16})$", "i");


export const DEFAULT_BREAKPOINTS: [] = [];
export const DEFAULT_TIME_SIMULATION_CONFIGURATION: number = 250;
export const DEFAULT_AUTO_SAVE_CONFIGURATION: boolean = true;
export const DEFAULT_LANG: TypeLang = "en";
Expand Down Expand Up @@ -186,6 +186,7 @@ export const DEFAULT_TABLE_CODE: TypeTableCode = {

export const DEFAULT_CONFIG_TOAST: Partial<IndividualConfig> = {
progressBar: true,
positionClass: "toast-bottom-left",
progressAnimation: "decreasing",
closeButton: true
};
Expand Down Expand Up @@ -397,7 +398,8 @@ export const ASCII_TABLE = [
];

export const CONFIG_WEBSOCKET: SocketIoConfig = {
url: AppConfig.socket_url,
url: AppConfig.socket_url,

options: {
transports: ["websocket"],
reconnection: true,
Expand All @@ -409,12 +411,36 @@ export const CONFIG_WEBSOCKET: SocketIoConfig = {

export const AUTH_ROUTES: PublicRoutesList = [
{
lang: "CALCULATOR",
path: "calculator",
routerLink: "/auth/calculator",
displayName: "Calculator",
data: {breadcrumb: "calculator"},
icon: "fas fa-calculator"
lang: "PIPELINE",
path: "pipeline",
routerLink: "/auth/pipeline",
displayName: "Pipeline",
data: {breadcrumb: "Pipeline"},
icon: "fas fa-desktop"
},
{
lang: "CYCLE_CLOCK_DIAGRAM",
path: "cycle-clock-diagram",
routerLink: "/auth/cycle-clock-diagram",
displayName: "Cycle clock diagram",
data: {breadcrumb: "Cycle-clock-diagram"},
icon: "fas fa-desktop"
},
{
lang: "REGISTERS",
path: "registers",
routerLink: "/auth/registers",
displayName: "Registers",
data: {breadcrumb: "Registers"},
icon: "fas fa-microchip"
},
{
lang: "MEMORY",
path: "memory",
routerLink: "/auth/memory",
displayName: "Memory",
data: {breadcrumb: "Memory"},
icon: "fas fa-memory"
},
{
lang: "CODE",
Expand All @@ -425,20 +451,12 @@ export const AUTH_ROUTES: PublicRoutesList = [
icon: "fas fa-calculator"
},
{
lang: "CONFIG",
path: "config",
routerLink: "/auth/config",
displayName: "Config",
data: {breadcrumb: "config"},
icon: "fas fa-wrench"
},
{
lang: "DOCUMENTATION",
path: "documentation",
routerLink: "/auth/documentation",
displayName: "Documentation",
data: {breadcrumb: "Documentation"},
icon: "fas fa-book"
lang: "STATISTICS",
path: "statistics",
routerLink: "/auth/statistics",
displayName: "Statistics",
data: {breadcrumb: "Statistics"},
icon: "fas fa-chart-bar"
},
{
lang: "FILE_MANAGER",
Expand All @@ -456,62 +474,6 @@ export const AUTH_ROUTES: PublicRoutesList = [
data: {breadcrumb: "Editor"},
icon: "far fa-file"
},
{
lang: "LOGGER",
path: "logger",
routerLink: "/auth/logger",
displayName: "Logger",
data: {breadcrumb: "Logger"},
icon: "fas fa-file-code"
},
{
lang: "MEMORY",
path: "memory",
routerLink: "/auth/memory",
displayName: "Memory",
data: {breadcrumb: "Memory"},
icon: "fas fa-memory"
},
{
lang: "CYCLE_CLOCK_DIAGRAM",
path: "cycle-clock-diagram",
routerLink: "/auth/cycle-clock-diagram",
displayName: "Cycle clock diagram",
data: {breadcrumb: "Cycle-clock-diagram"},
icon: "fas fa-desktop"
},
{
lang: "PIPELINE",
path: "pipeline",
routerLink: "/auth/pipeline",
displayName: "Pipeline",
data: {breadcrumb: "Pipeline"},
icon: "fas fa-desktop"
},
{
lang: "PROFILE",
path: "profile",
routerLink: "/auth/profile",
displayName: "Profile",
data: {breadcrumb: "Profile"},
icon: "fas fa-user"
},
{
lang: "REGISTERS",
path: "registers",
routerLink: "/auth/registers",
displayName: "Registers",
data: {breadcrumb: "Registers"},
icon: "fas fa-microchip"
},
{
lang: "STATISTICS",
path: "statistics",
routerLink: "/auth/statistics",
displayName: "Statistics",
data: {breadcrumb: "Statistics"},
icon: "fas fa-chart-bar"
},
{
lang: "MULTIVIEW",
path: "multiview",
Expand All @@ -520,13 +482,53 @@ export const AUTH_ROUTES: PublicRoutesList = [
data: {breadcrumb: "Multiview"},
icon: "fas fa-table"
},
{
lang: "CALCULATOR",
path: "calculator",
routerLink: "/auth/calculator",
displayName: "Calculator",
data: {breadcrumb: "calculator"},
icon: "fas fa-calculator"
},
{
lang: "DOCUMENTATION",
path: "documentation",
routerLink: "/auth/documentation",
displayName: "Documentation",
data: {breadcrumb: "Documentation"},
icon: "fas fa-book"
},
{
lang: "CONFIG",
path: "config",
routerLink: "/auth/config",
displayName: "Config",
data: {breadcrumb: "config"},
icon: "fas fa-wrench"
},
{
lang: "DEBUG",
path: "debug",
routerLink: "/auth/debug",
displayName: "Debug",
data: {breadcrumb: "Debug"},
icon: "fas fa-bug"
},
{
lang: "LOGGER",
path: "logger",
routerLink: "/auth/logger",
displayName: "Logger",
data: {breadcrumb: "Logger"},
icon: "fas fa-file-code"
},
{
lang: "PROFILE",
path: "profile",
routerLink: "/auth/profile",
displayName: "Profile",
data: {breadcrumb: "Profile"},
icon: "fas fa-user"
}
];

Expand Down
28 changes: 19 additions & 9 deletions src/app/__core/services/socket-provider-connect.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { Subject } from "rxjs";
// import { WrappedSocket } from "ngx-socket-io/src/socket-io.service";
// import { SocketIoConfig } from "ngx-socket-io/src/config/socket-io.config";
import { AppConfig } from "../../../environments/_environment";
import { StorageService } from "../storage/storage.service";
import { TypeWebSocketConfiguration } from "../../types";

@Injectable({
providedIn: "root"
Expand All @@ -30,15 +32,23 @@ export class SocketProviderConnectService {
return this.privateMessage$.asObservable();
}

/**
* TODO
* https://www.tutorialspoint.com/socket.io/socket.io_error_handling.htm
*/

constructor(public socketIO: Socket,
public socketIO: Socket;
constructor(
private translate: TranslateService,
private toast: ToastrService) {
console.log("constructor socket");
const configWebSocket = JSON.parse(localStorage.getItem("web_socket_configuration")) as TypeWebSocketConfiguration;
const config: SocketIoConfig = {
url: configWebSocket.socket_url,
options: {
transports: ["websocket"],
reconnection: true,
reconnectionDelay: 2000,
reconnectionDelayMax: 2500,
reconnectionAttempts: 5
}
};
this.socketIO = new Socket(config);

// When the client successfully connects.
this.socketIO.ioSocket.on("connect", () => {
Expand Down Expand Up @@ -80,7 +90,6 @@ export class SocketProviderConnectService {
// When the client is in the process of connecting.
this.socketIO.ioSocket.on("reconnecting", () => {
console.debug("WebSocket-reconnecting");

});
// When the reconnection attempt fails.
this.socketIO.ioSocket.on("reconnect_failed", (err) => {
Expand All @@ -103,10 +112,11 @@ export class SocketProviderConnectService {
});
}

public updateSocketURl(newUrl: string) {
public updateSocketURl() {
this.socketIO.disconnect();
const configWebSocket = JSON.parse(localStorage.getItem("web_socket_configuration")) as TypeWebSocketConfiguration;
const config: SocketIoConfig = {
url: newUrl,
url: configWebSocket.socket_url,
options: {
transports: ["websocket"],
reconnection: true,
Expand Down
5 changes: 4 additions & 1 deletion src/app/__core/storage/storage.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from "@angular/core";
import { Observable, Subject } from "rxjs";
import {
DEFAULT_AUTO_SAVE_CONFIGURATION,
DEFAULT_AUTO_SAVE_CONFIGURATION, DEFAULT_BREAKPOINTS,
DEFAULT_FLOATING_POINT_STAGE_CONFIGURATION,
DEFAULT_INTERFACE_FILE_ITEM,
DEFAULT_LANG,
Expand Down Expand Up @@ -46,6 +46,9 @@ export class StorageService {
if (!this.hasItem("interfaceFileItem")) {
this.setItem("interfaceFileItem", DEFAULT_INTERFACE_FILE_ITEM);
}
if (!this.hasItem("breakpoints")) {
this.setItem("breakpoints", DEFAULT_BREAKPOINTS);
}
if (!this.hasItem("floating_point_stage_configuration")) {
this.setItem("floating_point_stage_configuration", DEFAULT_FLOATING_POINT_STAGE_CONFIGURATION);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function markedOptionsFactory(): MarkedOptions {
}
}),
ToastrModule.forRoot(),
SocketIoModule.forRoot(CONFIG_WEBSOCKET),
// SocketIoModule.forRoot(CONFIG_WEBSOCKET),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
Expand Down
Loading

0 comments on commit f2442a7

Please sign in to comment.