Skip to content

[BUG] cve2_riscv_compliance simulator fails to load any ELF/vmem #319

@karabambus

Description

@karabambus

Bug Description

Running Vcve2_riscv_compliance with any ELF or vmem file immediately fails:

ERROR: No memory found at TOP.cve2_riscv_compliance.u_ram.u_ram.gen_generic.u_impl_generic' (the scope associated with region ram', used by a segment that starts at LMA 0x0).

The scope path hardcoded in dv/riscv_compliance/cve2_riscv_compliance.cc (line 17) is:

  MemArea ram(
      "TOP.cve2_riscv_compliance.u_ram.u_ram.gen_generic.u_impl_generic",
      64 * 1024 / 4, 4);

The path segment gen_generic.u_impl_generic does not exist in the current prim_ram_1p.sv.

The stale path originates from commit 8b42024 ("Use vendored-in primitives from OpenTitan"), which updated the scope to use the then-current primgen wrapper hierarchy (prim_ram_1p → gen_generic.u_impl_generic). A subsequent update to fusesoc_libraries changed prim_ram_1p.sv to a flat implementation, but the .cc file was not updated accordingly.

Fix

In dv/riscv_compliance/cve2_riscv_compliance.cc, change:

MemArea ram(
    "TOP.cve2_riscv_compliance.u_ram.u_ram.gen_generic.u_impl_generic",
    64 * 1024 / 4, 4);

to:

MemArea ram(
   "TOP.cve2_riscv_compliance.u_ram.u_ram",
    64 * 1024 / 4, 4);

Steps to reproduce

  1. Build Vcve2_riscv_compliance per dv/riscv_compliance/README.md
  2. Run with any ELF: ./Vcve2_riscv_compliance -E .elf
  3. Observe the error above

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions