Skip to content

Run Validator & ExpreInterpreter also on Initializers in Architectural State #108

Description

@PhilippvK

Branch: develop2 (Ref: 700e16a)

Input (1):

    architectural_state {
        register unsigned<XLEN> RES_ADDR = -1;
    }

Expected Error(s) (1):

  • Implicit signed -> unsigned conversion?
  • Implicit extend/truncate (depending on XLEN)?

Output Diff (1):

-cp.code() += "((RV64IMACFD*)cpu)->RES_ADDR = -1ULL;\n";  // correct, expected
+cp.code() += "((RV64IMACFD*)cpu)->RES_ADDR = -1LL;\n";   // technically correct, but assuming that RES_ADDR is unsigned

Input (2):

    architectural_state {
        register unsigned<XLEN> RES_ADDR = (unsigned<XLEN>)(signed<XLEN>)(-1);
    }

Error (2):

  • NotImplementedError: No visit method implemented for type list in ExprInterpreterVisitor
    => Should the Expression Interpreter also work on the initialization statement inside the architectural state? I guess yes?

Output Diff (2): /

Metadata

Metadata

Assignees

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