riscv-non-isa / riscv-iommu

RISC-V IOMMU Specification
https://jira.riscv.org/browse/RVG-55
Creative Commons Attribution 4.0 International
98 stars 17 forks source link

About the behavior of clearing cqcsr.cqen. #401

Closed zhuotianshu closed 3 months ago

zhuotianshu commented 3 months ago

In 5.15. Command-queue CSR (cqcsr):

When cqen is changed from 1 to 0, the command queue may stay active (with busy asserted) until the commands already fetched from the command-queue are being processed and/or there are outstanding implicit loads from the command-queue.

I'm confused about the "and/or" here. And I also confused that why the condition is "there are outstanding implicit loads" rather than "there are no outstanding implicit loads". Because as I understand it, a queue could be disabled only when entries already been fetched have been complete (or timeout), and no outstanding implicit loads is in-flight.

ved-rivos commented 3 months ago

The command queue may stay active - with busy asserted - when there are outstanding implicit loads.

zhuotianshu commented 3 months ago

The command queue may stay active - with busy asserted - when there are outstanding implicit loads.

I understand that. But it seems that the sentence should be:

When cqen is changed from 1 to 0, the command queue may stay active (with busy asserted) until the commands already fetched from the command-queue are being processed and there are no outstanding implicit loads from the command-queue.

ved-rivos commented 3 months ago

It stays active until there are outstanding implicit loads. When there are no outstanding implicit loads it becomes inactive.

zhuotianshu commented 3 months ago

Got that. There may be some grammatical ambiguity for me, because I thought this sentence means "cq may stay active until situation A & situation B are both true", where the condition after until is the condition to leave "active" state. But I can understand that.