Giter VIP home page Giter VIP logo

marie-js / marie.js Goto Github PK

View Code? Open in Web Editor NEW
140.0 10.0 44.0 31.82 MB

MARIE.js is a simple, yet intuitive MARIE simulator built in JavaScript :pencil: and is used for teaching computing architecture and assembly language

Home Page: https://marie.js.org

License: MIT License

CSS 5.41% JavaScript 88.13% Shell 0.03% EJS 6.43%
marie architecture javascript essential simulator monash-university

marie.js's People

Contributors

auroranil avatar cyderize avatar dependabot[bot] avatar ericjiang97 avatar guidotack avatar jhannemann avatar jiaminglimjm avatar jnelssonsmith avatar kishorliv avatar lsmacedo avatar nicholastay avatar powerkaddev avatar therealmintd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marie.js's Issues

GitReports Public Issue Submission

Submitter: John McDonough

Hey,

I've already written a MarieJS interpreter, and a very basic compiler that turns a javascript like language into MarieJS assembly. If you guys want to check it out, I've git a demo here. https://master5227.github.io/MarieJS-demo/

Also, interestingly enough, y'all chose the exact same name as my project xD

Sorry I didn't publish this openly. I only spent about a week to write both the compiler and interpreter, and the UI code is pretty gross.

John McDonough

Implement datapath visualisation simulator in MARIE.js

MARIE has another Jar file, which visualises the current state of the machine to the user. It shows the current RTL microinstruction being performed, the registers, what read and write address bus bits are active, and when data is being accessed or stored to the memory.

As for the placement for the visualisation, it can be placed inside a new tab layout, along with the memory table as separate tabs.

We'll use SVG to render the visualisation (and perhaps d3.js to make it easier to create and modify the SVG shapes).

Link between instructions and RTL

It should be noted that an important point is to show the link between instructions and register transfers - e.g. hovering over instructions could show the underlying RTL.

GitReports Public Issue Submission

Submitter: Felix Salim
Add option when simulator automatically runs test cases,

  • Automatically runs amount of inputs chosen by user
  • Input list, that is popped every time the 'Input' instruction is executed (rather than entering values one at a time)

Enhance debugging capabilities

Allowing users to step backwards would be very useful.

  • Keep track of the changes to registers/memory, so that they can be reversed
  • Alternatively just save the state of the entire machine every step

CodeMirror for mobile/tablet devices doesn't work properly

Weird line number glitches and text duplication makes MARIE.js practically unusable for mobile/tablet devices. We may either need to patch CodeMirror to fix this bug, or resort to a different web text editor library that handles input perfectly for mobile/tablet users.

Address Overflow causes JavaScript Error

This following MARIE code causes JavaScript to throw an error.

Load x
Add one
Store x
LoadI x
x, HEX FFF
one, DEC 1

This error arises when you run this code.

Uncaught TypeError: Cannot read property 'classList' of null

Make the site more responsive

The user interface for the site should display without any hiccups for a variety of screen sizes.

Specifically, we should:

  • scale CodeMirror and tabs upwards for high resolution displays (especially 4k monitors)
  • collapse the nav and action bar for small screens somehow, showing only critical features (but still allowing users to perform intermediary clicks to reach all features of MARIE.js)
  • hide "View on GitHub" button on small screens (may also want to add a link to this GitHub repository in the nav bar under "Help")
  • implement this for the dropdown menus in the nav bar: http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown
  • As the page is being loaded, it should keep layout changes to a minimum

Calculation Overflow Bug

This bug occurs when calculation has overflowed resulting in a value beyond the range (-32678,32678)

This is because of signed integers between FFFF (negative and positive)

Redesign architecture for simulator

A new architecture would be useful:

  • Enable an extensible method of using more instructions
    • Enable users to input RTL to add their own instructions
  • Enable the use of more registers
  • Ensure that the hexadecimal representations are still easily read - i.e. try to keep to 4-bit groups
  • E.g. use 6-bits for instructions, 2-bits for registers, 8-bits for operands?

Saving files

MARIE.js already saves drafts to local storage, but only when the page is about to unload. It would be better to save drafts after changes have been made to the program and a certain time period of inactivity has elapsed (and perhaps also auto-assemble for quick feedback if there are any errors to the user's program).

Also how do we handle multiple instances of running MARIE.js? And do we want users to be able to save files locally on the web browser using local storage?

Introduction of Hotkeys to Certain Shortcuts

Using this https://github.com/jeresig/jquery.hotkeys or jQuery we can implement shortcut hotkeys to certain commands.

Such as

  • Ctrl+O to Open
  • Ctrl+S to Save
  • Ctrl+T for Tour

etc.

Downloading files in FireFox

Affected OS: Unknown
Affected Browsers: Mozilla Firefox

When download (exporting) file in FireFox it downloads it as a *.txt, need to fix this.

v1.0.0 Update Release Notes

v1.0.0 - The Community Update - Release Notes

This update is ready for full deployment, please wait for an announcement over our Facebook Page

Estimated Release: 26th September 2016 - 10:00 AM Australian Eastern Standard Time (AEST)


Recommended Browsers

OS Recommended Browser
Windows 7 or Newer Google Chrome v40 or Newer
Windows XP or Newer Google Chrome
OSX Google Chrome v40 or Newer
Mobile Devices No recommended browsers at the moment

Features

Community Provided Ideas

  • Interchangable Themes brought by JavaScript and CSS
  • Users can save code in their own favourite names and extensions
  • Comprehensive Errors, explained. This will be updated in the future where a link (to the wiki with the corresponding error) will appear to explain the error
  • FAQs Section on the Wiki
  • Input list, that is popped every time the 'Input' instruction is executed (rather than entering values one at a time)

UI and UX Updates

  • New Landing Page
  • Updated Preferences Modal to include tabs, for easier to access/manage settings when it is categorised
  • A more beautiful and responsive navigation bar
    • navbar icons have been trimmed to save space, giving it a modern look
  • Google Drive API Integration, opening and saving files to Google Drive
    • Google Picker
  • New and easy to remember domain name https://mariejs.xyz with DDOS protection by CloudFlare

Bugs Fixes

  • Fixed #163 - where Simulator can break
  • Fixed Security Fixes (which is present in v1.0.0-preview)

Planned Roadmap for MARIE.js

  • Plans to migrate to ES6, electron, AngularJS, ReactJS, etc.
  • End of support for Older Browsers
  • More documentation over December 2016 - February 2017 Period

GitReports Public Issue Submission

Submitter: Felix Salim
Code is breaking at

11:06:29.990 TypeError: document.getElementById(...) is null
<anonymous>marie.min.js:12
MarieSim.prototype.regSet()marie.min.js:13
p/<()marie.min.js:13
c()marie.min.js:1
j/<()marie.min.js:1
g/</a[b]()marie.min.js:1
c()marie.min.js:1
j/<()marie.min.js:1
g/</a[b]()marie.min.js:1
c()marie.min.js:1
j/<()marie.min.js:1
g/</a[b]()marie.min.js:1
MarieSim.prototype.microStep()marie.min.js:13
MarieSim.prototype.step()marie.min.js:13
y()marie.min.js:12
<anonymous>marie.min.js:12
1marie.min.js:12:29200

Tutorials Page (wiki?)

we can also work on tutorials (but please don't go overboard on this - keep it minimal)

This can be done by:

  • adding new html page
  • using Wiki page on MARIE.js

Planned Migration (after v1.0.0 release)

As per discussed we are moving to a new structure.

Future Language Structure

TBD (at this stage most likely ES6)

Future Commit and Deployment Method

Commits (to individual forks)→ Pull Requests (to origin:master)→ master

When milestone is set to be released, we will do a batch pull
origin:masterorigin:gh-pages
during this stage, we will insert the API key to preserve security

Future Packages

(not sure, but inclined towards AngularJS2, electron and/or ReactJS)

Future Features

TBD

Lengthy TODO List

Please contact @jos0003 or @lorderikir for any queries regarding any of these problems.

Improving MARIE.js Codebase

  • further integration of stepping simulator one step backwards
  • Add explanation of instruction when using Autocomplete
  • Remove unnecessary CSS

Documentation

  • Document other files using jsdoc
  • Comment the code whenever it is needed
  • Extend Usability of Wiki and eBook

Testing

  • Add unit testing

UI

  • move output mode back to inside output log element
  • fix the position of output mode to the top, so that users can scroll down and still see output mode in the same position
  • rename "Register log" to "RTL log"
  • add legend to memory view (yellow=MAR, green=PC)
  • change between cells by using arrow keys (once the user is focusing in one memory cell)
  • change fading behaviour when swapping tabs (instead of fading out of one tab pane then fade into another, perform fading from one tab pane to another under one go just like showing and hiding datapath view)
  • fix overflow ellipsis in instruction display within datapath view
  • fix overflow scrolling in datapath view
  • add time from now message in save file status (e.g. "saved file now","saved file a few minutes ago")`
  • add option for setting autosave timer after file modification
  • add warning message for importing files
  • add placeholder in logs if it is empty
  • responsive dropdown menu
  • fix dropdown menu bug with iOS devices
  • clearly indicate to the user that the status bar is what it is
  • show default placeholder values in preference settings in input textboxes
  • selecting code should not block the highlighted lines
  • add an assembled code tab to the left pane to show how the line numbers are converted into memory
    addresses
  • add option in menu to clear all breakpoints
  • set lighter grey background to disabled action buttons
  • Use Slickgrid or work out how to use less DOM changes for logs truncate to the last k instructions in RTL log, where k is a huge number (e.g. k = 1000)
  • Add time sequence numbers to RTL instructions (e.g. T0)
  • Force cursor to be default when hovering over links in navigation menu

Proposal for ALU Opcodes

This is a proposal for ALU opcodes which illustrates the purpose of ALUs. In addition to AC and ALU registers, the PC register is also used in the ALU, which is crucial in the fetch part of the fetch-decode-execute cycle.

Here are the opcodes and what they should do:

  • 001 - AC <- AC + MBR
  • 010 - AC <- AC - MBR
  • 011 - AC <- 0
  • 100 - AC < 0? If so then PC <- PC + 1
  • 101 - AC = 0? If so then PC <- PC + 1
  • 110 - AC > 0? If so then PC <- PC + 1
  • 111 - PC <- PC + 1

MARIE.js update design

Need to update to:

style.css: (line:89)

#memory-headers th, #memory th {
    border: 0.1em solid #ccc;
    text-align: center;
    font-family: sans-serif;
}

style.css (line: 168)

#registers th {
    padding-top: 1em;
    font-family: sans-serif;
}
  • Also need to update material design.

Add an icon toolbar

Having an icon toolbar reduces the number of clicks by one for each action, and immediately shows to the user what actions are available to the user.

The disadvantage to this approach is that the icon buttons don't explain what they do. There are a few workarounds to this disadvantage; add tooltips for each icon button, ensure that the icons represent what they do, and follow the conventions (e.g. counter-clockwise arrow for undo action).

Also it would be good if we add icons for the action buttons as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.