Closed viktoryou closed 1 week ago
Should the fetch of new commands stop since cqen is changed from 1 to 0, or the fetch would be always active until the command queue becomes empty(seems like the behavior of the model)?
When cqen
is set to 0, the cqon
goes to 0. The command queue is no longer active and will stop fetching any more commands. An implementation may observe the cqen
write in between two commands i.e. complete the commands that have been already fetched and then mark itself as off by setting cqon
to 0. When cqon
is 0, the model does not fetch commands anymore. In the reference model, this turning off of cqon
occurs instantaneously since the model cannot observe a cqen
write while a command is in progress. However for making this concept more explicit we could add cqen
into this. Added this in #369 to illustrate the concept.
if ( (g_reg_file.cqcsr.cqon == 0) ||
+ (g_reg_file.cqcsr.cqen == 0) ||
(g_reg_file.cqcsr.cqmf != 0) ||
Waiting till its empty is also an acceptable behavior but not a desirable behavior.
The model was however missing the case where there might be a IOFENCE
pending and the cqon
clearing should be delayed. This is updated in #370 .
In the code of the model, cqcsr.cqen is not used in checking the state of command queue. Is that correct?
From the spec,
Should the fetch of new commands stop since cqen is changed from 1 to 0, or the fetch would be always active until the command queue becomes empty(seems like the behavior of the model)?