Hi vi,
It is very nice to hear from you! I would like to give you more information and test cases regarding our project to answer your questions better.
Background
Our security sub-system executes with the following steps:
(Step i) run-time monitors the committed instructions of the Boom core
(Step ii) filters the ``interesting instructions'' committed by the Boom core
(Step iii) sends the filtered ``interesting instructions'' to our security analysers
(Step iv) the security analysers perform security analysis to check if an attack occurs
Example and problem descriptions:
In our test cases, we configured the ``interesting instructions'' as ld and st instructions, which means that all the committed ld and st should be filtered and sent to our security analyser.
Therefore, there are two scenarios that should stall the Boom core:
(Scenario i) an attack is detected
(Scenario ii) the message queue (hardware FIFO) of the security analyser is nearly full <- the problem occurs here
We proceeded with three test cases:
(Test case i) setting: depth_message_queue := 64; and executes 1077 ld instructions on the Boom core
observation: 1077 ld instructions are filtered and sent to our analyser (no overflow)
(Test case ii) setting: depth_message_queue := 16; and executes 1077 ld instructions on the Boom core
observation: 1052 ld instructions are filtered and sent to our analyser (overflow)
(Test case iii) setting: depth_message_queue := 16, also set security_stall := true. B if message_queue_nearlyfull === true.B; and executes 1077 ld instructions on the Boom core
observation: 1055 ld instructions are filtered and sent to our analyser (overflow)
Based on this observation, I thought that (in Test case iii) still commits ld instructions, even though it commits less ld instructions than the original design (Test case ii).
Question Answering:
Q: How is the security_stall signal assigned? Is it a Reg? Or does it depend on a Reg?
A: security_stall := message_queue_nearlyfull, and the message_queue_nearlyfull is stored in a Reg.
Q: Did you make sure there isn't any delay between the cycle you need to have commit stalled, and the actual cycle where security_stall in the ROB gets asserted?
A: Yes, there is no Reg inserted between the security_stall and Rob.
Q: You say the core still commits the instructions, although it commits fewer than in the original design.
Could you tell us in more details what instructions are committed when security_stall is asserted? What's the exact behavior you observe?
A: Hopefully the above example answers the question. I am happy to provide more information if it is required.
Q: Does it commit a few consecutive instructions once the signal gets asserted, before blocking commit of all the subsequent instructions?
Or does it keep committing instructions (although not all) again and again for many cycles while security_stall is asserted?
Or something else?
A: The Boom only executes the ld instruction.
From Test case iii, I can see that the rob_head[4:0] is not updated when security_stall is asserted.
I suspect with my original thinking now; maybe there are no instructions are committed? However, why do we still miss 22 instructions?
Q: Also, did you dump VCD traces?
If yes, would you mind sharing the VCD file? It would be a great help for troubleshooting.
A: I am more than happy to do so. What is the best way to share the VCD file? Shall we use e-mails?
Again, lots for thanks for your kind help!
Best regards,
Hugo