harvard-acc / gem5-aladdin

End-to-end SoC simulation: integrating the gem5 system simulator with the Aladdin accelerator simulator.
BSD 3-Clause "New" or "Revised" License
221 stars 59 forks source link

Fix busy waiting on finish_flag #38

Open Sacusa opened 3 years ago

Sacusa commented 3 years ago

If the program that invokes the accelerator loops on the finish_flag instead of waiting for an interrupt, it will likely panic and die. This is caused by the accelerator writing to an uncacheable memory region and the CPU MSHR being unaware of it. Because the finish_flag is uncacheable, the accelerator's write request sets the needsWriteable flag of the memory packet but not the isInvalidate flag. The CPU MSHR, which is not aware of the presence of uncacheable memory, assumes both must be set or neither, triggering the panic.