Lib.RiscV module

MIF08, CAP, CodeGeneration, RiscV API Functions to define instructions.

Lib.RiscV.call(function: Function) Instru3A[source]

Function call.

Lib.RiscV.jump(label: Label) AbsoluteJump[source]

Unconditional jump to label.

Lib.RiscV.conditional_jump(label: Label, op1: Operand, cond: Condition, op2: Operand)[source]

Add a conditional jump to the code. This is a wrapper around bge, bgt, beq, … c is a Condition, like Condition(‘bgt’), Condition(MiniCParser.EQ), …

Lib.RiscV.add(dr: Operand, sr1: Operand, sr2orimm7: Operand) Instru3A[source]
Lib.RiscV.mul(dr: Operand, sr1: Operand, sr2orimm7: Operand) Instru3A[source]
Lib.RiscV.div(dr: Operand, sr1: Operand, sr2orimm7: Operand) Instru3A[source]
Lib.RiscV.rem(dr: Operand, sr1: Operand, sr2orimm7: Operand) Instru3A[source]
Lib.RiscV.sub(dr: Operand, sr1: Operand, sr2orimm7: Operand) Instru3A[source]
Lib.RiscV.land(dr: Operand, sr1: Operand, sr2orimm7: Operand) Instru3A[source]

And instruction (cannot be called and due to Python and).

Lib.RiscV.lor(dr: Operand, sr1: Operand, sr2orimm7: Operand) Instru3A[source]

Or instruction (cannot be called or due to Python or).

Lib.RiscV.xor(dr: Operand, sr1: Operand, sr2orimm7: Operand) Instru3A[source]
Lib.RiscV.li(dr: Operand, imm7: Immediate) Instru3A[source]
Lib.RiscV.mv(dr: Operand, sr: Operand) Instru3A[source]
Lib.RiscV.ld(dr: Operand, mem: Operand) Instru3A[source]
Lib.RiscV.sd(sr: Operand, mem: Operand) Instru3A[source]