riscv-non-isa / riscv-iommu

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

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

Closed baimengwei closed 1 month ago

baimengwei commented 1 month 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 1 month ago

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

See here.