Skip to content

icache_checker: default WAY_WIDHT is inconsistent with the LINES_256 code path #2

Description

@Shivam-Shukla0

Description

  • Summary:
    sargantana_icache_checker declares parameter int unsigned WAY_WIDHT = 32*8 (256), but the LINES_256 == 1'b1 branch of chunk_sel indexes data[511:256], which needs 512. With the module's own defaults that selection is out of range.

    In practice sargantana_top_icache.sv:393 passes WAY_WIDHT from the package (512 in the default configuration), and LINES_256 defaults to 1'b0, so the branch is unreachable as integrated today. But instantiating the checker with LINES_256 = 1'b1 without also overriding WAY_WIDHT would read out of range rather than failing at elaboration.

Environment

  • Details:
    main branch, Verilator 5.048. Linting sargantana_icache_checker.sv standalone (module defaults) reports:
  %Warning-SELRANGE: sargantana_icache_checker.sv:79: Selection index out of range: 511:256 outside 255:0
  %Warning-SELRANGE: sargantana_icache_checker.sv:95: Selection index out of range: 383:256 outside 255:0
  %Warning-SELRANGE: sargantana_icache_checker.sv:96: Selection index out of range: 511:384 outside 255:0

Hypothesis / Comments

  • Additional Information:
    Would you prefer the default raised to 64*8 so it matches the widest path the module supports, or is the intent that LINES_256 is only ever set together with an explicit WAY_WIDHT? In the latter case an elaboration-time assertion might be clearer than leaving it implicit. Happy to send a PR either way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions