Skip to content

Type error when use mapping and when #1512

@KotorinMinami

Description

@KotorinMinami

When I tried to modify the code in sail-riscv, I encountered the following problem:

When I try to modify encdec_compressed as follows:

mapping clause encdec_compressed = C_ADDI4SPN(rd, nzimm)
  <-> 0b000 @ nzimm[3 .. 2] @ nzimm[7 .. 4] @ nzimm[0] @ nzimm[1] @ encdec_creg(rd) @ 0b00
  when nzimm != 0b00000000 & currentlyEnabled(Ext_Zca)

The following error occurred during compilation:

Type error:
./extensions/C/zca_insts.sail:37.7-12:
37 |  when nzimm != 0b00000000 & currentlyEnabled(Ext_Zca)
   |       ^---^
   | Identifier nzimm is unbound
make[2]: *** [model/CMakeFiles/generated_sail_riscv_model.dir/build.make:218: sail_riscv_model.c] Error 1
make[1]: *** [CMakeFiles/Makefile2:622: model/CMakeFiles/generated_sail_riscv_model.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

The Sail version I am using is:

$ sail --version
Sail 0.19.1 (sail @ opam-v2.3.0 0.19.1)

Has this issue been resolved in Sail 0.20.0?

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