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

why not set `g_reg_file.ipsr.cip = 1;` after generate_interrupt? #328

Closed baimengwei closed 6 months ago

baimengwei commented 6 months ago

If the conditions to set that bit are still present (See <>) or if they occur after the bit is cleared then that bit transitions again from 0->1.

https://github.com/riscv-non-isa/riscv-iommu/blob/main/iommu_ref_model/libiommu/src/iommu_reg.c#L505C1-L515C14

            if ( ipsr_temp.cip == 1 )
                g_reg_file.ipsr.cip = 0;
            if ( ipsr_temp.cip == 1 ) {
                if ( (g_reg_file.cqcsr.cmd_to ||
                      g_reg_file.cqcsr.cmd_ill ||
                      g_reg_file.cqcsr.cqmf ||
                      g_reg_file.cqcsr.fence_w_ip) && 
                     (g_reg_file.cqcsr.cie == 1) ) {
                    generate_interrupt(COMMAND_QUEUE);
                }
            }

it seems that generate_interrupt(COMMAND_QUEUE); lack a g_reg_file.ipsr.cip = 1 ?

ved-rivos commented 6 months ago

it seems that generate_interrupt(COMMAND_QUEUE); lack a g_reg_file.ipsr.cip = 1 ?

See here.