Skip to content

Commit

Permalink
Added msdf font and restructured folders. Removed redundant assets im…
Browse files Browse the repository at this point in the history
…port and stored every static asset in static. All other assets will be bundled by webpack.
  • Loading branch information
gafert committed Apr 18, 2021
1 parent 11c9d47 commit 23240de
Show file tree
Hide file tree
Showing 209 changed files with 3,443 additions and 2,193 deletions.
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/node_modules
/release
/risc_test_executable
/build_resources
/github_resources
/.github
/dist
/binaries
angular.webpack.js
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

File renamed without changes.
10 changes: 5 additions & 5 deletions Readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ CPU. __[Watch the introduction video!](https://onedrive.live.com/embed?cid=7DB40
</tr>
</table>

![Screenshot](https://github.com/gafert/Apate/blob/master/res/apate.png?raw=true)
![Screenshot](https://github.com/gafert/Apate/blob/master/github_resources/apate.png?raw=true)

# Features

* Step by step guid trough the CPU
* See the current instruction and what that instruciton does
* Step by step guid through the CPU
* See the current instruction and what that instruction does
* Information about each element and signal of the CPU
* See all registers, memory
* Run examples
Expand All @@ -58,8 +58,8 @@ CPU. __[Watch the introduction video!](https://onedrive.live.com/embed?cid=7DB40
* Visualisation with [three.js](https://github.com/mrdoob/three.js) and SVGLoader
* Interface with Angular
* Custom JavaScript ELF parser
* Custom JavaScript instruciton decoder
* Custom JavaSript CPU based RV32I ISA
* Custom JavaScript instruction decoder
* Custom JavaScript CPU based RV32I ISA

Thank you to [@jameslzhu](https://github.com/jameslzhu)
for [RISC V Reference Sheet](https://github.com/jameslzhu/riscv-card), and [@anvaka](https://github.com/anvaka)
Expand Down
8 changes: 1 addition & 7 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,14 @@
"tsConfig": "main_renderer/tsconfig.app.json",
"polyfills": "main_renderer/polyfills.ts",
"assets": [
"main_renderer/assets",
"main_renderer/favicon.ico",
"main_renderer/favicon.png",
"main_renderer/favicon.icns",
"main_renderer/favicon.256x256.png",
"main_renderer/favicon.512x512.png",
"main_renderer/static",
{ "glob": "**/*", "input": "node_modules/monaco-editor", "output": "assets/monaco-editor/" }
],
"styles": [
"main_renderer/styles.scss"
],
"scripts": [
"main_renderer/assets/dynamicHTMLRouter.js"
"main_renderer/bundle/dynamicHTMLRouter.js"
],
"customWebpackConfig": {
"path": "./angular.webpack.js"
Expand Down
11 changes: 9 additions & 2 deletions angular.webpack.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const arch = process.env.ARCH || process.arch;
const platform = process.env.PLATFORM || process.platform;
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const TerserPlugin = require('terser-webpack-plugin');
const webpack = require('webpack');

module.exports = (config, options) => {
config.target = 'electron-renderer';
Expand Down Expand Up @@ -77,8 +77,15 @@ module.exports = (config, options) => {
}
];

config.resolveLoader = {
alias: {
// Register loader so it can be used inline with import
'ttf-msdf-loader': require('path').resolve('./webpack_plugin/ttf-msdf-loader.js'),
},
};

config.plugins = [
...config.plugins /*,
...config.plugins,/*,
new BundleAnalyzerPlugin({
generateStatsFile: true
})*/
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion electron-builder.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"productName": "Apate",
"directories": {
"output": "release/"
"output": "release/",
"buildResources": "build_resources/"
},
"files": [
"./dist/**/*",
Expand Down
File renamed without changes
2 changes: 2 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const args = process.argv.slice(1);
const serve = args.some((val) => val === '--serve');
let wizardSettings;



function createWindow(): BrowserWindow {
const size = screen.getPrimaryDisplay().workAreaSize;

Expand Down
7 changes: 3 additions & 4 deletions main_renderer/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'reflect-metadata';
import '../polyfills';

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
Expand All @@ -26,9 +25,9 @@ const routes: Routes = [
redirectTo: 'wizard',
pathMatch: 'full',
},
{path: 'home', loadChildren: () => import('./home/home.module').then((m) => m.HomeModule)},
{path: 'settings', loadChildren: () => import('./settings/settings.module').then((m) => m.SettingsModule)},
{path: 'wizard', loadChildren: () => import('./wizard/wizard.module').then((m) => m.WizardModule)},
{path: 'home', loadChildren: () => import('./module_home/home.module').then((m) => m.HomeModule)},
{path: 'settings', loadChildren: () => import('./module_settings/settings.module').then((m) => m.SettingsModule)},
{path: 'wizard', loadChildren: () => import('./module_wizard/wizard.module').then((m) => m.WizardModule)},
];

@NgModule({
Expand Down
10 changes: 5 additions & 5 deletions main_renderer/app/components/window/window.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<header id="titlebar" [class.mac]="isMac">
<div id="drag-region">
<div class="window-title">
<img src="assets/128x128.png">
<img src="static/images/favicon.png">
<div class="title">{{name}}</div>
<div class="actions">
<ng-content select="[window-actions]"></ng-content>
Expand All @@ -13,19 +13,19 @@

<div id="window-controls" *ngIf="!isMac">
<div class="button" id="min-button" (click)="win.minimize()" *ngIf="showMinimize">
<img class="icon" srcset="assets/icons/min-w-10.png 1x, assets/icons/min-w-12.png 1.25x, assets/icons/min-w-15.png 1.5x, assets/icons/min-w-15.png 1.75x, assets/icons/min-w-20.png 2x, assets/icons/min-w-20.png 2.25x, assets/icons/min-w-24.png 2.5x, assets/icons/min-w-30.png 3x, assets/icons/min-w-30.png 3.5x" draggable="false" />
<img class="icon" srcset="static/icons/min-w-10.png 1x, static/icons/min-w-12.png 1.25x, static/icons/min-w-15.png 1.5x, static/icons/min-w-15.png 1.75x, static/icons/min-w-20.png 2x, static/icons/min-w-20.png 2.25x, static/icons/min-w-24.png 2.5x, static/icons/min-w-30.png 3x, static/icons/min-w-30.png 3.5x" draggable="false" />
</div>

<div class="button" id="max-button" (click)="win.maximize()" *ngIf="showMaximize">
<img class="icon" srcset="assets/icons/max-w-10.png 1x, assets/icons/max-w-12.png 1.25x, assets/icons/max-w-15.png 1.5x, assets/icons/max-w-15.png 1.75x, assets/icons/max-w-20.png 2x, assets/icons/max-w-20.png 2.25x, assets/icons/max-w-24.png 2.5x, assets/icons/max-w-30.png 3x, assets/icons/max-w-30.png 3.5x" draggable="false" />
<img class="icon" srcset="static/icons/max-w-10.png 1x, static/icons/max-w-12.png 1.25x, static/icons/max-w-15.png 1.5x, static/icons/max-w-15.png 1.75x, static/icons/max-w-20.png 2x, static/icons/max-w-20.png 2.25x, static/icons/max-w-24.png 2.5x, static/icons/max-w-30.png 3x, static/icons/max-w-30.png 3.5x" draggable="false" />
</div>

<div class="button" id="restore-button" (click)="win.unmaximize()" *ngIf="showMaximize">
<img class="icon" srcset="assets/icons/restore-w-10.png 1x, assets/icons/restore-w-12.png 1.25x, assets/icons/restore-w-15.png 1.5x, assets/icons/restore-w-15.png 1.75x, assets/icons/restore-w-20.png 2x, assets/icons/restore-w-20.png 2.25x, assets/icons/restore-w-24.png 2.5x, assets/icons/restore-w-30.png 3x, assets/icons/restore-w-30.png 3.5x" draggable="false" />
<img class="icon" srcset="static/icons/restore-w-10.png 1x, static/icons/restore-w-12.png 1.25x, static/icons/restore-w-15.png 1.5x, static/icons/restore-w-15.png 1.75x, static/icons/restore-w-20.png 2x, static/icons/restore-w-20.png 2.25x, static/icons/restore-w-24.png 2.5x, static/icons/restore-w-30.png 3x, static/icons/restore-w-30.png 3.5x" draggable="false" />
</div>

<div class="button" id="close-button" (click)="win.close()">
<img class="icon" srcset="assets/icons/close-w-10.png 1x, assets/icons/close-w-12.png 1.25x, assets/icons/close-w-15.png 1.5x, assets/icons/close-w-15.png 1.75x, assets/icons/close-w-20.png 2x, assets/icons/close-w-20.png 2.25x, assets/icons/close-w-24.png 2.5x, assets/icons/close-w-30.png 3x, assets/icons/close-w-30.png 3.5x" draggable="false" />
<img class="icon" srcset="static/icons/close-w-10.png 1x, static/icons/close-w-12.png 1.25x, static/icons/close-w-15.png 1.5x, static/icons/close-w-15.png 1.75x, static/icons/close-w-20.png 2x, static/icons/close-w-20.png 2.25x, static/icons/close-w-24.png 2.5x, static/icons/close-w-30.png 3x, static/icons/close-w-30.png 3.5x" draggable="false" />
</div>

</div>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Router } from '@angular/router';
import { DataKeys, DataService } from '../services/data.service';
import { ProjectService } from '../services/project.service';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { SimulationComponent } from './simulation/simulation.component';
import { SimulationComponent } from './module_simulation/simulation.component';
import { skip } from 'rxjs/operators';
import { MatDialog } from '@angular/material/dialog';
import { DemoProjectDescriptionComponent } from './components/demo-project-description/demo-project-description.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const routes: Routes = [
component: HomeComponent,
children: [
{ path: 'simulation',
loadChildren: () => import('./simulation/simulation.module').then((m) => m.SimulationModule),
loadChildren: () => import('./module_simulation/simulation.module').then((m) => m.SimulationModule),
},
{ path: 'compile',
loadChildren: () => import('./compile/compile.module').then((m) => m.CompileModule) },
loadChildren: () => import('./module_compile/compile.module').then((m) => m.CompileModule) },
{
path: '**',
redirectTo: 'simulation',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {AfterViewInit, Component, ElementRef, OnDestroy} from '@angular/core';
import {GraphService} from '../../services/graph.service';
import {GraphService} from '../../../../services/graph.service';
import {setZeroTimeout} from "../../../../utils/helper";

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import {
ViewChild
} from '@angular/core';
import { byteToBinary, byteToHex } from '../../../../utils/helper';
import { ELF, ELFSectionHeader, ElfSymbol, SHF_CONSTANTS } from '../../../../utils/elfParser';
import { Instruction, INSTRUCTIONS_DESCRIPTIONS } from '../../../../utils/instructionParser';
import { ELF, ELFSectionHeader, ElfSymbol, SHF_CONSTANTS } from '../../../../services/cpuServiceHelpers/elfParser';
import { Instruction, INSTRUCTIONS_DESCRIPTIONS } from '../../../../services/cpuServiceHelpers/instructionParser';
import { VirtualScrollerComponent } from 'ngx-virtual-scroller';
import { animate, style, transition, trigger } from '@angular/animations';
import { DataKeys, DataService } from '../../../../services/data.service';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { skipWhile, take } from 'rxjs/operators';
import { BehaviorSubject } from 'rxjs';
import CPU_REGISTER_NAMES from '../../../../yamls/register.yml';
import CPU_REGISTER_NAMES from '../../../../../bundled/yamls/register.yml';

interface OptimizedList {
instruction?: Instruction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
The Stack Pointer (sp, Register 2) is set at the beginning of the program to the highest memory address.
All memory locations will be relative to this first location. Entering a function the stack pointer will
change.<br><br>
<img src="./assets/memory_map.svg" style="width: 100%">
<img src="static/images/memory_map.svg" style="width: 100%">
</ng-template>

<div class="grid-container">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AfterViewInit, Component, Optional, ViewChild } from '@angular/core';
import { byteToHex, range } from '../../../../utils/helper';
import { CPUService } from '../../services/cpu.service';
import { CPUService } from '../../../../services/cpu.service';
import { VirtualScrollerComponent } from 'ngx-virtual-scroller';
import { INSTRUCTIONS_DESCRIPTIONS, OPCODES } from '../../../../utils/instructionParser';
import { CPU_STATES } from '../../services/bindingSubjects';
import { INSTRUCTIONS_DESCRIPTIONS, OPCODES } from '../../../../services/cpuServiceHelpers/instructionParser';
import { CPU_STATES } from '../../../../services/cpuServiceHelpers/bindingSubjects';
import { SimulationComponent } from '../../simulation.component';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core';
import { CPUService } from '../../services/cpu.service';
import { CPUService } from '../../../../services/cpu.service';

@Component({
selector: 'app-program-output',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { byteToHex } from '../../../../utils/helper';
import { CPUService } from '../../services/cpu.service';
import CPU_REGISTER_NAMES from '../../../../yamls/register.yml';
import { CPUService } from '../../../../services/cpu.service';
import CPU_REGISTER_NAMES from '../../../../../bundled/yamls/register.yml';

@Component({
selector: 'app-registers',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, OnInit} from '@angular/core';
import {CPUService} from '../../services/cpu.service';
import {CPUService} from '../../../../services/cpu.service';

@Component({
selector: 'app-signals',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../../import";
@import "../../../../../import";

$borderWidth: 1.7em;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { byteToHex, range, readStyleProperty } from '../../utils/helper';
import { CPUService } from './services/cpu.service';
import { CPUService } from '../../services/cpu.service';
import { InstructionsComponent } from './components/instructions/instructions.component';
import { BehaviorSubject } from 'rxjs';
import { DataKeys, DataService } from '../../services/data.service';
import { GraphService } from './services/graph.service';
import RISCV_STAGES from '../../yamls/stages.yml';
import { Bindings, CPU_STATE_NAMES, CPU_STATES } from './services/bindingSubjects';
import { Areas } from './services/graphServiceHelpers/helpers';
import { GraphService } from '../../services/graph.service';
import RISCV_STAGES from '../../../bundled/yamls/stages.yml';
import { Bindings, CPU_STATE_NAMES, CPU_STATES } from '../../services/cpuServiceHelpers/bindingSubjects';
import { Areas } from '../../services/graphServiceHelpers/helpers';
import { ProjectService } from '../../services/project.service';
import { animate, animation, sequence, state, style, transition, trigger, useAnimation } from '@angular/animations';
import { MatDialog } from '@angular/material/dialog';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { SignalsComponent } from './components/signals/signals.component';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { CommonModule } from '@angular/common';
import { TippyModule } from '@ngneat/helipopper';
import { VerticalTabsComponent } from '../../components/vertical-tabs/vertical-tabs.component';
import { VerticalTabsItemComponent } from '../../components/vertical-tabs-item/vertical-tabs-item.component';
import { VerticalTabsComponent } from './components/vertical-tabs/vertical-tabs.component';
import { VerticalTabsItemComponent } from './components/vertical-tabs-item/vertical-tabs-item.component';
import { VarDirective } from '../../components/ngVar.directive';
import { FormsModule } from '@angular/forms';
import { VirtualScrollerModule } from 'ngx-virtual-scroller';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import * as https from 'https';
import { DataKeys, DataService } from '../../services/data.service';
import { authorize } from '../../utils/google-drive-auth';
import { authorize } from '../../utils/googleDriveAuth';
import * as fs from 'fs';
import * as zlib from 'zlib';
import * as path from 'path';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Injectable } from '@angular/core';
import { Bindings, CPU_STATES } from './bindingSubjects';
import { Bindings, CPU_STATES } from './cpuServiceHelpers/bindingSubjects';
import { readFileSync } from 'fs';
import { Instruction, INSTRUCTIONS, OPCODES, parseInstruction } from '../../../utils/instructionParser';
import { ELF, parseElf, parseElfRISCVInstructions } from '../../../utils/elfParser';
import { setZeroTimeout } from '../../../utils/helper';
import { Instruction, INSTRUCTIONS, OPCODES, parseInstruction } from './cpuServiceHelpers/instructionParser';
import { ELF, parseElf, parseElfRISCVInstructions } from './cpuServiceHelpers/elfParser';
import { setZeroTimeout } from '../utils/helper';


@Injectable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/
import {BehaviorSubject} from 'rxjs';
import {Instruction} from '../../../utils/instructionParser';
import {Instruction} from './instructionParser';

export const MEMORY_SIZE = 1024 * 5;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { byteToHex } from './helper';
import CPU_REGISTER_NAMES from '../yamls/register.yml';
import { byteToHex } from '../../utils/helper';
import CPU_REGISTER_NAMES from '../../../bundled/yamls/register.yml';

export enum IMM_FUNC {
ADDI = 0,
Expand Down
Loading

0 comments on commit 23240de

Please sign in to comment.