Skip to content

Support ranged memory access #72

@PhilippvK

Description

@PhilippvK

Currently ETISS Writer used old and incorrect syntax for implementing store instructions by infering the width of the mem write from the RHS of the assignment.

        SW {
            encoding: imm[11:5] :: rs2[4:0] :: rs1[4:0] :: 3'b010 :: imm[4:0] :: 7'b0100011;
            assembly:"{name(rs2)}, {imm}({name(rs1)})";
            behavior: {
                unsigned<XLEN> store_address = X[rs1 % RFS] + (signed)imm;
                MEM[store_address] = (signed<32>)X[rs2 % RFS];
            }
        }

As proposed in Minres/CoreDSL#52 and documented in https://github.com/Minres/CoreDSL/wiki/Expressions#range-operator the recommented syntax is as follows:

        SW {
            encoding: imm[11:5] :: rs2[4:0] :: rs1[4:0] :: 3'b010 :: imm[4:0] :: 7'b0100011;
            assembly: "{name(rs2)}, {imm}({name(rs1)})";
            behavior: if(rs2 >= RFS || rs1 >= RFS) raise(0, RV_CAUSE_ILLEGAL_INSTRUCTION); else {
                unsigned<XLEN> store_address = (unsigned<XLEN>)(X[rs1] + (signed)imm);
                MEM[store_address+3:store_address] = (unsigned<32>)X[rs2];
            }
        }

The ETISS backend currently ignores this and needs to be fixed before moving to the latest upstream CoreDSL files.

Metadata

Metadata

Assignees

Labels

etiss writerIssues concerning the ETISS writer backend modulehelp wantedExtra attention is needed

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