Giter Site home page Giter Site logo

Comments (7)

mehrabmehdi avatar mehrabmehdi commented on May 22, 2024

Seems to work fine with the simulator update before may.

from rars.

zacharyselk avatar zacharyselk commented on May 22, 2024

    There was a bug introduced in 4b2d4b6 that has caused the display portion of the "Keyboard and Display MMIO Simulator" tool to break.

Here is the stack trace after using the display tool in that commit:

Exception in thread "RISCV" java.lang.NullPointerException
        at rars.tools.KeyboardAndDisplaySimulator$2.caretUpdate(KeyboardAndDisplaySimulator.java:596)
        at java.desktop/javax.swing.text.JTextComponent.fireCaretUpdate(JTextComponent.java:412)
        at java.desktop/javax.swing.text.JTextComponent$MutableCaretEvent.fire(JTextComponent.java:4489)
        at java.desktop/javax.swing.text.JTextComponent$MutableCaretEvent.stateChanged(JTextComponent.java:4511)
        at java.desktop/javax.swing.text.DefaultCaret.fireStateChanged(DefaultCaret.java:812)
        at java.desktop/javax.swing.text.DefaultCaret.changeCaretPosition(DefaultCaret.java:1283)
        at java.desktop/javax.swing.text.DefaultCaret.handleSetDot(DefaultCaret.java:1182)
        at java.desktop/javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:1163)
        at java.desktop/javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1757)
        at java.desktop/javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:203)
        at java.desktop/javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:757)
        at java.desktop/javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:716)
        at java.desktop/javax.swing.text.PlainDocument.insertString(PlainDocument.java:131)
        at java.desktop/javax.swing.JTextArea.append(JTextArea.java:468)
        at rars.tools.KeyboardAndDisplaySimulator.displayCharacter(KeyboardAndDisplaySimulator.java:336)
        at rars.tools.KeyboardAndDisplaySimulator.processRISCVUpdate(KeyboardAndDisplaySimulator.java:267)
        at rars.tools.AbstractToolAndApplication.update(AbstractToolAndApplication.java:480)
        at java.base/java.util.Observable.notifyObservers(Observable.java:173)
        at rars.riscv.hardware.Memory$MemoryObservable.notifyObserver(Memory.java:1026)
        at rars.riscv.hardware.Memory.notifyAnyObservers(Memory.java:1056)
        at rars.riscv.hardware.Memory.readProgramStatement(Memory.java:1247)
        at rars.riscv.hardware.Memory.getStatement(Memory.java:808)
        at rars.riscv.hardware.Memory.getStatement(Memory.java:779)
        at rars.simulator.Simulator$SimThread.run(Simulator.java:451)
        at java.base/java.lang.Thread.run(Thread.java:834)

Steps to reproduce:

  • Run rars with java -jar rars.jar
  • Load display_test.txt
  • Assemble the program
  • Open the "Keyboard and Display MMIO Simulator" tool
  • Set delay length on tool to 1 instruction execution
  • Set run speed to 1 inst/sec
  • Connect tool to program
  • Run the program

Expected Behaviour:
    To display "Hello World" in the display section on the "Keyboard and Display MMIO Simulator" tool then terminate.

Observed Behaviour:
    Displays the first character of "Hello World" after performing a sw instruction to the address 0xFFFF000C (the MMIO for the display) then a thread crashes while attempting to run the instruction immediately following the sw instruction, resulting in the entire simulator freezing.

from rars.

TheThirdOne avatar TheThirdOne commented on May 22, 2024

Thanks for the report. Pretty sure its fix now, if its still wrong or something else is wrong with the tool don't hesitate to add to this issue.

@zacharyselk, thanks for the extra information. It helped make this a quicker fix.

from rars.

mehrabmehdi avatar mehrabmehdi commented on May 22, 2024

Is it possible to apply backspacing to the Display? Currently is reading the ascii code of the backspace as an unknown character and printing it out, would it possible to make it so that it reads the backspace, and moves the cursor back one position and deletes the character there?

from rars.

TheThirdOne avatar TheThirdOne commented on May 22, 2024

AFAIK, the only way of overwriting a character is to move the cursor there and then write a different character. The relevant documentation for how to move the cursor is:

When ASCII 7 (bell) is stored in the Transmitter Data register, the cursor in the tool's Display window will be positioned at the (X,Y) coordinate specified by its high-order 3 bytes, following the specified transmission delay. Place the X position (column) in bit positions 20-31 of the Transmitter Data register and place the Y position (row) in bit positions 8-19. The cursor is not displayed but subsequent transmitted characters will be displayed starting at that position. Position (0,0) is at upper left. Why did I select the ASCII Bell character? Just for fun!

It would certainly be possible to modify the tool to support backspace changing the cursor, but I would think in most cases the manual cursor positioning would still be the preferred way of moving the cursor.

from rars.

TaylorZowtuk avatar TaylorZowtuk commented on May 22, 2024

@TheThirdOne I just wanted to let you know that you credited me on the 1.3 release notes with providing detailed information regarding fixing this issue but it was actually @zacharyselk . Just thought id bring that to your attention.

from rars.

TheThirdOne avatar TheThirdOne commented on May 22, 2024

@TaylorZowtuk, thanks for telling me. Its updated now.

I had to rewrite that description after it got deleted once. My attention to detail was probably hindered by my frustration.

from rars.

Related Issues (20)

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.