Skip to content

PMP grain used as immediate when it can be more than 12 bits #1539

@henrikg-qc

Description

@henrikg-qc

PMP tests do not compile when PMP grain is greater than 9

For PMP tests the PMP grain is used with:
#define g (1 << (RVMODEL_PMP_GRAIN + 2))

The macro g is used in several places as argument to addi instruction. When Grain is greater than 9 the instruction cannot be encoded.

To Reproduce
Set RVMODEL_PMP_GRAIN greater than 9
Ex. in rvtest_config.h
#define RVMODEL_PMP_GRAIN 12

run make for the test config

error: PMPSm/pmpsm_misaligned_tor.S:182: Error: illegal operands `addi x5,x4,(1<<(12+2))

This is widespread throughout PMP tests and should be reviewed for correctness both in loading the corrected grain and use for tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Test FrameworkIssue or pull request related to the test selection/runtime frameworkbug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions