Comments (7)
Seems to work fine with the simulator update before may.
from rars.
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.
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.
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.
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.
@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.
@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)
- Immediate value in hexadecimal when MSB is 1 gives error for Immediate instructions HOT 5
- Bug with `fgt.s` command HOT 2
- Bug with `fmv.w.x` command HOT 2
- Help for "digital lab sim" could be improved HOT 1
- Adding support for "<tag>:" type label & offset dumped from elf file HOT 1
- Add any missing psudeo-ops
- Closing confirm dialog (ecall 50) returns in a0 the same as pressing No button
- 4k monitor font too small HOT 3
- Help. Cannot assemble and Exception occurs HOT 4
- Warning while building from sources
- NullPointerException performing input from /dev/null
- Add assembler directive .global as synonym for .globl HOT 3
- Add a Environment Call like ReadChar but that does not echo (KEY in Forth) HOT 2
- Loading 32-bit Values HOT 2
- Assemble from command line in 64 bit mode HOT 2
- ld doesn't support the same operands as lw HOT 2
- fmadd / fmsub error when adding with zero HOT 1
- Incorrect file name in errors when using .import
- Issues on MAC regarding saving/reading files through rars HOT 5
- Hang on M1 Macs using MMIO display HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rars.