Closed wbouillo closed 4 years ago
Excellent catch! Are you running v0.14 of llhd-sim
? Your suspicion of the halt
being executed sounds very plausible.
I am currently using v0.15-dev.
Cool, thanks for checking. The culprit seems to be this line: https://github.com/fabianschuiki/llhd/blob/f64affed256df08c9a4e6ab12138562b55cd36a2/src/bin/llhd-sim/engine.rs#L661
Since the most recent IR refactoring in LLHD, entities now have a dummy halt
terminator instruction at the end, to make them more uniform with functions and processes. If you're up for it, my suggestion would be to insert a line just before the above one:
Opcode::Halt if unit.is_entity() => Action::None,
Fixed as part of #144.
When attempting to use the llhd-sim binary to simulate an entity with a proc manipulating inputs to the entity, I am getting a
thread '<unnamed> panicked at 'cannot suspend entity', src/bin/llhd-sim/engine.rs:377:40
error. It appears to me that a halt is being interpreted at the end of entities. However, simulating a proc by itself works fine.Inverter_TB.txt