-
Notifications
You must be signed in to change notification settings - Fork 16
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
Implement multithreading? #27
Comments
Hi @Columbus240 The problem of generating every successor allowed is that it computationally blow up very quickly. To go in that direction I think one would need to describe it relationally - in coq for example - and never actually compute with it. One idea at some point was to generate SAT formulas, that would represent the ISA constraints, then throw in the memory model constraints, and shake it up in a SAT solver to get the allowed behavior of a program. Usually people flatten the execution by unfolding the loop and the conditional of the program. This quickly create massive constraints system so I was not convinced into spending the time to write that. I also thought that this was problematic if one wanted to be completely honest an consider instructions loads and virtual memory loads as loads. The part about choosing a specific execution order is fairly easy to do implementing a new instance for the riscv machine. Earlier I had made some experiments on a dual core RV32I without much trouble. But then it really become only a simulator, and I am not sure I see the interest. One other idea, was to write a trace acceptance function: Machine Instance : - The machine progressively eat up the trace, consuming the answer of loads as they are giving in the trace, and verifying that there are the right memory operation emitted in the trace when it tries to emit them. I think this is still on some todo list. It is not as easy as what it may look like beause of ctrl/data/addr dependencies in the memory model and the gazillions cases of dependencies carried or not carried through CSRs (see the memory model, there is also a fair amount of work in the A subset, that is currently handwaved in ExecuteA). So the event would need to embody more than just the kind of memory operations and their returned value/addrs, but also if they have any form of ctrl/addr/data dependencies with other events (more a graph like I think?), and the machine would need to keep track of those and ensure that the dependencies label are proper. |
Currently, one
RiscvMachine
only runs one hart (RISC-V compatible hardware thread), but implementations of the RISC-V spec may support multiple harts. The interactions between harts and the restrictions on these interactions are currently not captured by this repository.Discussing multithreading is opening a can of worms, because using multithreading, a given program can leave the processor in many different end states, depending on the order in which the instructions were executed.
This topic is similar to issue #25, where the spec allows multiple behaviors.
The following ideas came to my mind to implement multithreading.
The text was updated successfully, but these errors were encountered: