Open
Conversation
Nydauron
requested changes
Apr 4, 2023
Contributor
Nydauron
left a comment
There was a problem hiding this comment.
Nice work! Works rather well
Bugs I encountered:
- Viewing a context that is not actively loaded followed by clicking play causes the simulator to run indefinitely. (cannot switch contexts, cannot reset, cannot pause. All options keep CPU% at 100)
- Disabling a context, loading a new file then playing does not work as intended (i.e. does not run the other enabled context)
- Note: Loading a new file and then disabling that particular context followed by playing does work
Nydauron
requested changes
Apr 16, 2023
Contributor
Nydauron
left a comment
There was a problem hiding this comment.
- Labels in the dropdown menu change to
"Program1"and"Program2"(expected to be"Program 1"and"Program 2") - If you uncheck context 2, then play, the program freezes. (if you change the speed prior to playing, it is fine)
Something else I've noticed that's beside this new feature:
- When reset is clicked, stdout and stderr terminals get cleared, but the underlying buffer is not cleared. (switching contexts will show the previous state of stdout and stderr)
spim/spim.cpp
Outdated
Comment on lines
262
to
285
| // void reset_sim() { // unsigned int max_contexts, val active_contexts) { | ||
| // /* std::vector<unsigned int> arr = emscripten::vecFromJSArray<unsigned int>(active_contexts); */ | ||
| // /* std::set<unsigned int> s(arr.begin(), arr.end()); */ | ||
| // /* std::set<unsigned int> s({0, 1}); */ | ||
|
|
||
| // /* reset(2, s); */ | ||
| // start_simulator(2, std::set<unsigned int>{0, 1}); | ||
| // } | ||
|
|
||
|
|
||
| void reset_sim(unsigned int max_contexts, const emscripten::val& arr) { // unsigned int max_contexts, val active_contexts) { | ||
| /* std::vector<unsigned int> arr = emscripten::vecFromJSArray<unsigned int>(active_contexts); */ | ||
| /* std::set<unsigned int> s(arr.begin(), arr.end()); */ | ||
| /* std::set<unsigned int> s({0, 1}); */ | ||
| std::set<unsigned int> ctx_set; | ||
|
|
||
| for (size_t i = 0; i < arr["length"].as<size_t>(); i++) { | ||
| ctx_set.insert(arr[i].as<unsigned int>()); | ||
| } | ||
|
|
||
| /* reset(2, s); */ | ||
| start_simulator(2, std::set<unsigned int>{0, 1}); | ||
| // start_simulator(max_contexts, std::set<unsigned int>{0, 1}); | ||
| start_simulator(max_contexts, ctx_set); | ||
|
|
Nydauron
requested changes
Apr 24, 2023
Contributor
Nydauron
left a comment
There was a problem hiding this comment.
Some more bugs:
- The page freezes and CPU % goes to 100% when you either:
- Switch contexts immediately after the page loads
- Turning off all contexts then hitting reset
| // Module.reset(); // 2, [0, 1]); | ||
| // Module.reset(2, [0, 1]); | ||
| // Module.reset(2, [0]); | ||
| // Module.reset(2, [1]); |
Contributor
There was a problem hiding this comment.
Remove commented code (not limited to this one instance)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.