Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulation halted by internal error when generating timing diagram #2005

Open
krisjdev opened this issue May 15, 2024 · 4 comments
Open

Simulation halted by internal error when generating timing diagram #2005

krisjdev opened this issue May 15, 2024 · 4 comments
Labels
bug Yep, that's an insect. help wanted investigating Let's check, maybe there's something about it... pri std Standard importance

Comments

@krisjdev
Copy link

krisjdev commented May 15, 2024

I'm trying to create a timing diagram of a CPU whilst its executing a program, however it fails with the following error:

java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
        at com.cburch.logisim.gui.log.Signal.extend(Signal.java:95)
        at com.cburch.logisim.gui.log.Model.extendWithNewValues(Model.java:570)
        at com.cburch.logisim.gui.log.Model.updateSignalsClockMode(Model.java:671)
        at com.cburch.logisim.gui.log.Model.propagationCompleted(Model.java:598)
        at com.cburch.logisim.gui.log.LogFrame$MyListener.propagationCompleted(LogFrame.java:86)
        at com.cburch.logisim.circuit.Simulator.firePropagationCompleted(Simulator.java:482)
        at com.cburch.logisim.circuit.Simulator$SimThread.loop(Simulator.java:373)
        at com.cburch.logisim.circuit.Simulator$SimThread.run(Simulator.java:383)

And it also produces a pop-up window that tells me to save my work and reload Logisim. I'm not able to restart the simulation using CTRL+E
image

I am using v3.8.0 installed using the .deb package.

To reproduce:

  1. Download BABY.circ and TuringLongDivision.logisimRAMImage from https://gitlab.com/charles.fox/comparch/-/tree/main/chapter07
  2. Open BABY.circ and load the TuringLongDivision.logisimRAMImage into the RAM block
  3. Change the frequency: Simulate -> Auto-Tick Frequency -> 16.0 Hz
  4. Open the timing diagram utility: Simulate -> Timing diagram
    1. Enable Store unlimited history
    2. Set timescale to 5.0us
    3. Do not add/remove any signals
  5. Click into the Timing diagram tab in the utility
  6. Start the simulation: Simulate -> Auto-Tick Enabled
  7. Wait for it to crash, happens when the chronogram hits 2ms

image

I suspect that turning on Store unlimited history might be the cause of the issue, as the simulation runs as intended with it disabled, but I was hoping to export the waveforms generated during the entire duration of the program execution.

@maehne
Copy link
Member

maehne commented May 16, 2024

Thanks for the report! Could you please first test with the latest nightly build whether the issue persists? There have been quite some bug fixes since the last official release.

@maehne maehne added bug Yep, that's an insect. pri std Standard importance investigating Let's check, maybe there's something about it... labels May 16, 2024
@krisjdev
Copy link
Author

Hey, thanks for getting back to me. Just tried it with logisim-evolution_main_20240516_amd64.deb and ran into the same crash with the same error message:

java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
        at com.cburch.logisim.gui.log.Signal.extend(Signal.java:95)
        at com.cburch.logisim.gui.log.Model.extendWithNewValues(Model.java:569)
        at com.cburch.logisim.gui.log.Model.updateSignalsClockMode(Model.java:670)
        at com.cburch.logisim.gui.log.Model.propagationCompleted(Model.java:597)
        at com.cburch.logisim.gui.log.LogFrame$MyListener.propagationCompleted(LogFrame.java:86)
        at com.cburch.logisim.circuit.Simulator.firePropagationCompleted(Simulator.java:700)
        at com.cburch.logisim.circuit.Simulator$SimThread.loop(Simulator.java:526)
        at com.cburch.logisim.circuit.Simulator$SimThread.run(Simulator.java:538)

@maehne
Copy link
Member

maehne commented May 16, 2024

@arkis-s: Thanks for your testing with the latest nightly! I am not sure how fast we'll be able to fix the root cause, as the chronogram code was not developed by the current main developers. Maybe, @kevinawalsh already bumped on this bug in his Holy Cross fork of Logisim-evolution, as issue kevinawalsh#7 sounds similar.

@krisjdev
Copy link
Author

Fair enough, thanks for letting me know :) In the meantime I'll just export the HDL and use it in some other simulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Yep, that's an insect. help wanted investigating Let's check, maybe there's something about it... pri std Standard importance
Projects
None yet
Development

No branches or pull requests

2 participants