cva6 icon indicating copy to clipboard operation
cva6 copied to clipboard

Possible issue with ASID on CV32A6

Open atrogerTHALES opened this issue 3 years ago • 5 comments

There is probably an issue with the ASID signal in the SV32's MMU for the CV32A6.

  1. ASID's width is hard coded in cva6_tlb_sv32.sv and does not use the ASID_WIDTH parameter (which is used by the input ASID signal though). It should probably be modified to use that parameter.
    input  logic [ASID_WIDTH-1:0]   lu_asid_i,
 // Sv32 defines two levels of page tables
    struct packed {
      logic [8:0]            asid; //9 bits wide
      logic [9:0]            vpn1; //10 bits wide
      logic [9:0]            vpn0; //10 bits wide
      logic                  is_4M;
      logic                  valid;
    } [TLB_ENTRIES-1:0] tags_q, tags_n;
  1. The ASID_WIDTH parameter in ariane_pkg.sv is set to 1 instead of 9 as per the RISC-V specs. It should be changed to 9 for XLEN = 32.
    localparam ASID_WIDTH    = (riscv::XLEN == 64) ? 16 : 1;

RISC-V specs : image

atrogerTHALES avatar Oct 06 '21 12:10 atrogerTHALES

@ASintzoff, @sjthales, this Issue is very old, but looks like an RTL bug. Please assign someone to investigate.

MikeOpenHWGroup avatar Feb 17 '23 03:02 MikeOpenHWGroup

As @sjthales (developer of Sv32 MMU) is far more competent than me on this topic, I let him tackling the issue. Thanks.

ASintzoff avatar Feb 21 '23 07:02 ASintzoff

@fatimasaleem, can 10xEngineers help with this possible MMU bug?

jquevremont avatar Nov 14 '23 17:11 jquevremont

Spec says "The number of ASID bits is unspecified and may be zero." so setting ASID_WIDTH to 1 is not a bug IMHO. But yes the tag struct should use ASID_WIDTH.

fatimasaleem avatar Nov 20 '23 13:11 fatimasaleem

Fixed in mmu unified https://github.com/openhwgroup/cva6/pull/1851

AngelaGonzalezMarino avatar Feb 20 '24 06:02 AngelaGonzalezMarino