GithubHelp home page GithubHelp logo

luhsra / minimaxsimulator Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 5.0 3.24 MB

Platform independent GUI-based Minimax simulator

Home Page: https://luhsra.github.io/MinimaxSimulator/

License: MIT License

Java 99.57% CSS 0.39% HTML 0.04%
java minimax-simulator education system-architecture java11

minimaxsimulator's Introduction

Minimax Simulator

License: MIT   Latest release   Java CI with Maven

Minimax Simulator is a platform independent GUI-based Minimax simulator written in Java.

Content:

System Requirements

  • JRE 11 or higher
  • (optional for smoother GUI: libcanberra-gtk-module)

Compiling from Source

Prerequirements

  • JDK 11
  • Apache Maven 3.0.5

Compilation

The recommended way to compile the simulator from source code is:

mvn clean compile


In order to create a working and executable JAR file run the following command. This will automatically compile the source if no compiled sources are available.

mvn package


The best way to create a new JAR file is therefore:

mvn clean package

JUnitTests

To run the UnitTests enter:

mvn test

Starting the Simulator

To start the simulator enter:

java -jar target/minimax_simulator-2.0.0-jar-with-dependencies.jar

If you get an error like gdk_x11_display_set_window_scale: assertion 'GDK_IS_X11_DISPLAY (display)' failed , try:

java -Djdk.gtk.version=2 -jar target/minimax_simulator-2.0.0-jar-with-dependencies.jar

How the Simulator works

See https://luhsra.github.io/MinimaxSimulator/

Found an Issue or Bug?

If you found a bug or any kind of mistake, please let us know by opening up an issue.

You are welcome to submit a pull request with your fix afterwards.

Requesting a Feature?

If you are missing a feature within the simulator, feel free to ask us about it by adding a new request by opening up a new issue with the prefix [feature request].

Note that usually you can speed up the process by submitting a pull request providing the needed changes for your requested feature.

Change Log

See Change Log

License

Distributed under MIT license.

Copyright (c) 2013-2019 Leibniz Universität Hannover, Institut für Systems Engineering, Fachgebiet System- und Rechnerarchitektur

minimaxsimulator's People

Contributors

aiyionprime avatar dependabot[bot] avatar dkiechle avatar exopandora avatar nnamua avatar opusz avatar prohde avatar rshuka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

minimaxsimulator's Issues

Import Data from File to Memory

When importing data from a file to the machines memory, if one of the last three bytes of an integer begins with 1 in binary representation, the integer value will be wrong (0xFFFFB000 instead of 0x0000B000 for instance).
This does not happen in the benchmarks, as they don't have a single byte that starts with 1 in binary representation (as far as I'm aware), but it does render other files that I have constructed for the machine useless.

[Improvement] Commandline administration

I think it would be a huge improvement if one could control loading the project and memory chunks, running the project as well as exporting memory via commandline parameters.
This would greatly improve reliable testing as well as better documentation approaches and reproducibility.

Good starters would be:

  • one project file to load
  • several memory chunks to import and their target positions
  • several export memory chunks and their positions as well

Running the project would be an implicit step after loading and before exporting.

Signaltable/Debug interference bug

Changing the signaltable while having an active simulation will make the debug mode unusable unless you press the reset button. (Maybe cache the "old" simulation or terminate the "old" simulation when you update the signaltable?)

'maven-jar-plugin'-version not specified

Currently the version of the maven-jar-plugin is not set properly, due to the fact that it's only defined in order to not use it at all.
As the project currently relies on maven 3.0.5 it's safe to require version 3.2.0 of the plugin, as it's supported.
This should be future-proof for another few years.

Opening a safed project fails sometimes

We are unable to reopen a project we were recently working on.

An error message appears when we attempt to open such a project:
"Die angegebene Datei ist beschädigt oder kein gültiges Projekt".

wrong background color of schematics using JPG export

The background color of the exported schematics is supposed to be white. But exporting the machine schematics as JPG leads to a strange background color.

expected output (like PNG export) actual output of JPG export
schematics schematics

Goto OP not availiable

I would like to implement an iFetch instruction, but I cannot seem to find an option to execute the instruction stored in IR.
Is it possible to add / unlock that functionality?

Signaltable import error

If you save a project with an empty signaltable and then try to import it again you will be left with an error message.
The problem is that row is a JSONObject when the exporter writes it to a file. Thus saving row as row {} and not as row [].
The importer then assumes that row is a JSONArray throwing an error message when row is row {}.

gtk3 menu glitch

Running the application using gtk3 in Linux works, but has strange effects on the menubar.

Starting with OpenJDK 11 GTK3 is enabled by default; the gtk2-startparameter mentioned in the readme does help with this, though I did not receive warnings or errors on the commandline.

Finally found it. This is the upstream bug.

Running the application in gtk2 does apparently work, as no gtk3-exclusive features were used in this project:

java -Djdk.gtk.version=2 -jar minimax_simulator-2.0.0-jar-with-dependencies.jar

But as this project requires JDK11, a hint for (Open?)JDK11 users might be worthwhile.

I currently have no way of reproducing this on other setups.

Repository Maintenance

Is this repository still actively maintained? @dkiechle @opusz Who is in charge of the development of the Minimax Simulator? There are numerous open issues and pull requests.

Constants greater than 0x7FFFFFFF

Due to the implementation it is not possible to create a constant using the full 32 bits (0xFFFFFFFF or ‭4294967295).
The maximum is instead limited to 0x7FFFFFFF or 2147483647 (Integer.MAX_VALUE).

Debug memory table bug

When the simulation writres to the memory at the relative row (ROW mod 16) it will show the new value although its not the right address. For example: Writing a 0 to address 32 would show you a 0 at address 16 if your current view is 0 - 16. If you update the table by scrolling down and back up again it will be gone.
Is this intentional ?

requirements outdated

The requirements reference Java 8u40, which is not matching the actual requirement of Java 11 (Classfile v55 matching the most recent releases compiler).

Renaming registers causes incorrect simulation

After renaming a register the simulation instance is not working correctly. Even though the correct value seems to be written to the register loading a value from the register returns zero.

I propose the following workaround until this is fixed:

  1. save the project after renaming the register
  2. close the simulator
  3. re-start the simulator
  4. open the project again
  5. now the simulation works correctly

Debug-Simulation uses old memory

Steps to reproduce:

  1. Import a memory file
  2. Start a simulation
  3. Import another memory file
  4. Stop and refresh the simulation
  5. Start a new simulation
    Result: The new simulation will use the old memory

I guess pressing the stop button overwrites the new memory with the old one resulting into unwanted behavior

Question: minimum version of maven is not defined - 3.0.5 or 3.3.9

The Simulator does not define a minimum version of maven, which might break the build process for you in the future.

Either just set it to a fixed version for now, where I'd recommend 3.3.9 due to your use of the plugin org.jacoco:jacoco-maven-plugin, which could be updated to version 0.8.6.

Currently you state maven 3.0.5 as prerequisite in the readme.

If you'd decide on which version you'd want you'd help a lot in getting rid of those Error messages during the build phase diagnostic targets in recent maven versions.

JavaFX NullpointerException crashes GUI of Steuertabelle

What happens:
The Steuertabelle will gray-out and loses all of its contents. Adding new rows or trying to use any of the other
controls on the right is ineffective.

How it looks:
https://imgur.com/a/Z2GLbuj

How to reproduce:
I can not reproduce the Error easily. It usually happens when deleting rows from the Steuertabelle but not always.

I am on Linux cwm10 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux
Java version:

openjdk 17.0.4 2022-07-19
OpenJDK Runtime Environment (build 17.0.4+8-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.4+8-Debian-1deb11u1, mixed mode, sharing)

terminal output:

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "javafx.scene.control.TableCell.tableColumnProperty()" because the return value of "javafx.scene.control.skin.TableCellSkin.getSkinnable()" is null
	at javafx.scene.control.skin.TableCellSkin.tableColumnProperty(TableCellSkin.java:97)
	at javafx.scene.control.skin.TableCellSkinBase.getTableColumn(TableCellSkinBase.java:123)
	at javafx.scene.control.skin.TableCellSkinBase.dispose(TableCellSkinBase.java:136)
	at javafx.scene.control.skin.TableCellSkin.dispose(TableCellSkin.java:88)
	at javafx.scene.control.Control$2.invalidated(Control.java:267)
	at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
	at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
	at javafx.css.StyleableObjectProperty.set(StyleableObjectProperty.java:82)
	at javafx.scene.control.Control$2.set(Control.java:250)
	at javafx.scene.control.Control$2.set(Control.java:233)
	at javafx.scene.control.Control.setSkin(Control.java:230)
	at javafx.scene.control.skin.TableRowSkinBase.recreateCells(TableRowSkinBase.java:715)
	at javafx.scene.control.skin.TableRowSkinBase.updateCells(TableRowSkinBase.java:505)
	at javafx.scene.control.skin.TableRowSkinBase.checkState(TableRowSkinBase.java:649)
	at javafx.scene.control.skin.TableRowSkinBase.computePrefHeight(TableRowSkinBase.java:588)
	at javafx.scene.control.Control.computePrefHeight(Control.java:570)
	at javafx.scene.Parent.prefHeight(Parent.java:1037)
	at javafx.scene.layout.Region.prefHeight(Region.java:1559)
	at javafx.scene.control.skin.VirtualFlow.resizeCellSize(VirtualFlow.java:1863)
	at javafx.scene.control.skin.VirtualFlow.addLeadingCells(VirtualFlow.java:1948)
	at javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1250)
	at javafx.scene.Parent.layout(Parent.java:1204)
	at javafx.scene.Parent.layout(Parent.java:1211)
	at javafx.scene.Parent.layout(Parent.java:1211)
	at javafx.scene.Parent.layout(Parent.java:1211)
	at javafx.scene.Parent.layout(Parent.java:1211)
	at javafx.scene.Parent.layout(Parent.java:1211)
	at javafx.scene.Scene.doLayoutPass(Scene.java:576)
	at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2482)
	at com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:412)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:411)
	at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:438)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:519)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:499)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:492)
	at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:320)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:833)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "javafx.scene.control.TableCell.tableColumnProperty()" because the return value of "javafx.scene.control.skin.TableCellSkin.getSkinnable()" is null
	at javafx.scene.control.skin.TableCellSkin.tableColumnProperty(TableCellSkin.java:97)
	at javafx.scene.control.skin.TableCellSkinBase.getTableColumn(TableCellSkinBase.java:123)
	at javafx.scene.control.skin.TableCellSkinBase.dispose(TableCellSkinBase.java:136)
	at javafx.scene.control.skin.TableCellSkin.dispose(TableCellSkin.java:88)
	at javafx.scene.control.Control$2.invalidated(Control.java:267)
	at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
	at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
	at javafx.css.StyleableObjectProperty.set(StyleableObjectProperty.java:82)
	at javafx.scene.control.Control$2.set(Control.java:250)
	at javafx.scene.control.Control$2.set(Control.java:233)
	at javafx.scene.control.Control.setSkin(Control.java:230)
	at javafx.scene.control.skin.TableRowSkinBase.recreateCells(TableRowSkinBase.java:715)
	at javafx.scene.control.skin.TableRowSkinBase.updateCells(TableRowSkinBase.java:505)
	at javafx.scene.control.skin.TableRowSkinBase.checkState(TableRowSkinBase.java:649)
	at javafx.scene.control.skin.TableRowSkinBase.computePrefHeight(TableRowSkinBase.java:588)
	at javafx.scene.control.Control.computePrefHeight(Control.java:570)
	at javafx.scene.Parent.prefHeight(Parent.java:1037)
	at javafx.scene.layout.Region.prefHeight(Region.java:1559)
	at javafx.scene.control.skin.VirtualFlow.resizeCellSize(VirtualFlow.java:1863)
	at javafx.scene.control.skin.VirtualFlow.addLeadingCells(VirtualFlow.java:1948)
	at javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1250)
	at javafx.scene.control.skin.VirtualFlow$5.invalidated(VirtualFlow.java:837)
	at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:113)
	at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:148)
	at javafx.scene.control.skin.VirtualFlow.setCellCount(VirtualFlow.java:855)
	at javafx.scene.control.skin.TableViewSkinBase.updateItemCount(TableViewSkinBase.java:549)
	at javafx.scene.control.skin.VirtualContainerBase.checkState(VirtualContainerBase.java:170)
	at javafx.scene.control.skin.VirtualContainerBase.layoutChildren(VirtualContainerBase.java:145)
	at javafx.scene.control.skin.TableViewSkinBase.layoutChildren(TableViewSkinBase.java:407)
	at javafx.scene.control.Control.layoutChildren(Control.java:601)
	at javafx.scene.Parent.layout(Parent.java:1204)
	at javafx.scene.Parent.layout(Parent.java:1211)
	at javafx.scene.Parent.layout(Parent.java:1211)
	at javafx.scene.Parent.layout(Parent.java:1211)
	at javafx.scene.Parent.layout(Parent.java:1211)
	at javafx.scene.Scene.doLayoutPass(Scene.java:576)
	at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2482)
	at com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:412)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:411)
	at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:438)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:519)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:499)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:492)
	at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:320)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:833)

MAR overflow exception

When trying to write 4 bytes in MAR (which is limited to 3 bytes) instead of truncating the simulator extends MAR to 4 bytes (seen in debug mode). Using MAR in another operation afterward results in an overflow exception.
For example:
MAR <- 0xff000000;
MDR <- 8;
M[MAR] <- MDR;

1 Test Failing on MacOs Monterey

❯ MacBook Pro (15 Zoll, 2019)
❯ OS: MacOs Monterey
❯ java -version
java version "13.0.1" 2019-10-15
Java(TM) SE Runtime Environment (build 13.0.1+9)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

A single Test is failing, preventing the building of a jar file, here's the output

[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.023 s <<< FAILURE! - in de.uni_hannover.sra.minimax_simulator.model.machine.minimax.TextRenderShapeTest
[ERROR] testGetStringDimension(de.uni_hannover.sra.minimax_simulator.model.machine.minimax.TextRenderShapeTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.AssertionError: dimension of "Test" expected:<[36,13]> but was:<[31,13]>
        at de.uni_hannover.sra.minimax_simulator.model.machine.minimax.TextRenderShapeTest.testGetStringDimension(TextRenderShapeTest.java:62)

Dropping PRs

@gerion0 or @wrenger Could you tell me who'd review/merge the PRs @prohde and I opened a little over 2.5 years ago?

I'd like to get rid of them in my pending PRs.
If PRs are not welcome or this repo is no longer in use, I'd suggest archiving it, which would resolve my problem as well.

Back then I found it inspiring of the SRA to maintain the software they used in their exercises.
After watching this since 2020 though, I'm not convinced it does itself a favor in doing so anymore.

Anyway. In case there's no further notice, I'll drop my Pull-Requests on the three year mark, which would be the fourteenth of December this year and gives you a headstart of another four months.

Thanks and have a nice week
Aiyion

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.