wrench-0.0.6.3
Safe HaskellNone
LanguageHaskell2010

Wrench.Isa.RiscIv

Description

Documentation

data RiscIvIsa w l Source #

Constructors

Addi

Add immediate: rd = rs1 + k

Fields

Add

Add: rd = rs1 + rs2

Fields

Sub

Subtract: rd = rs1 - rs2

Fields

Mul

Multiply: rd = rs1 * rs2

Fields

Mulh

Multiply high: rd = (rs1 * rs2) >> (word size)

Fields

Div

Divide: rd = rs1 / rs2

Fields

Rem

Remainder: rd = rs1 % rs2

Fields

Sll

Logical shift left: rd = rs1 << rs2 (5 bit)

Fields

Srl

Logical shift right: rd = rs1 >> rs2 (5 bit)

Fields

Sra

Arithmetic shift right: rd = rs1 >> rs2 (5 bit)

Fields

And

Bitwise AND: rd = rs1 & rs2

Fields

Or

Bitwise OR: rd = rs1 | rs2

Fields

Xor

Bitwise XOR: rd = rs1 ^ rs2

Fields

Slti

Set less than immediate: rd = (rs1 < k) ? 1 : 0

Fields

Slli

Logical shift left immediate: rd = rs1 << k (5 bit)

Fields

Srli

Logical shift right immediate: rd = rs1 >>> k (5 bit)

Fields

Srai

Arithmetic shift right immediate: rd = rs1 >> k (5 bit)

Fields

Andi

Bitwise AND immediate: rd = rs1 & k

Fields

Ori

Bitwise OR immediate: rd = rs1 | k

Fields

Xori

Bitwise XOR immediate: rd = rs1 ^ k

Fields

Mv

Move: rd = rs

Fields

Sw

Store word: M[offsetRs1] = rs2

Fields

Sb

Store byte: M[offsetRs1] = rs2 (lower 8 bits)

Fields

Lui

Load upper immediate: rd = k << 12

Fields

Lw

Load word: rd = M[offsetRs1]

Fields

Lb

Load byte (sign-extended): rd = signext(M[offsetRs1][7:0])

Fields

J

Jump: PC = PC + k

Fields

  • k :: l
     
Jal

Jump and Link: rd = PC + 4, PC += k

Fields

Jalr

Jump and link register: rd = PC + 4, PC = rs1 + k

Fields

Beqz

Branch if equal to zero: if rs1 == 0 then PC += k

Fields

Bnez

Branch if not equal to zero: if rs1 /= 0 then PC += k

Fields

Blt

Branch if less than: if rs1 < rs2 then PC += k

Fields

Bge

Branch if greater than or equal: if rs1 >= rs2 then PC += k

Fields

Bltu

Branch if less than (unsigned): if rs1 < rs2 then PC += k

Fields

Bgeu

Branch if greater than or equal (unsigned): if rs1 >= rs2 then PC += k

Fields

Beq

Branch if equal: if rs1 == rs2 then PC += k

Fields

Bne

Branch if not equal: if rs1 /= rs2 then PC += k

Fields

Halt

Halt the machine

Instances

Instances details
IsWord w => DerefMnemonic (RiscIvIsa w) w Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Methods

derefMnemonic :: (Text -> Maybe w) -> w -> RiscIvIsa w (Ref w) -> RiscIvIsa w w Source #

IsWord w => Machine (RiscIvSt w) (RiscIvIsa w w) w Source # 
Instance details

Defined in Wrench.Isa.RiscIv

(Show w, Show l) => Show (RiscIvIsa w l) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Methods

showsPrec :: Int -> RiscIvIsa w l -> ShowS #

show :: RiscIvIsa w l -> String #

showList :: [RiscIvIsa w l] -> ShowS #

ByteSize (RiscIvIsa w l) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Methods

byteSize :: RiscIvIsa w l -> Int Source #

CommentStart (RiscIvIsa _a _b) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

IsWord w => MnemonicParser (RiscIvIsa w (Ref w)) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Methods

mnemonic :: Parser (RiscIvIsa w (Ref w)) Source #

data RiscIvSt w Source #

Constructors

RiscIvSt 

Fields

Instances

Instances details
Show w => Show (RiscIvSt w) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Methods

showsPrec :: Int -> RiscIvSt w -> ShowS #

show :: RiscIvSt w -> String #

showList :: [RiscIvSt w] -> ShowS #

IsWord w => InitState (RiscIvSt w) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Methods

initState :: Int -> MemOf (RiscIvSt w) -> StdGen -> RiscIvSt w Source #

IsWord w => Inspectable (RiscIvSt w) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Associated Types

type WordOf (RiscIvSt w) 
Instance details

Defined in Wrench.Isa.RiscIv

type WordOf (RiscIvSt w) = w
type IsaOf (RiscIvSt w) 
Instance details

Defined in Wrench.Isa.RiscIv

type IsaOf (RiscIvSt w) = RiscIvIsa w w
IsWord w => Machine (RiscIvSt w) (RiscIvIsa w w) w Source # 
Instance details

Defined in Wrench.Isa.RiscIv

type IsaOf (RiscIvSt w) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

type IsaOf (RiscIvSt w) = RiscIvIsa w w
type MemOf (RiscIvSt w) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

type MemOf (RiscIvSt w) = IoMem (RiscIvIsa w w) w
type WordOf (RiscIvSt w) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

type WordOf (RiscIvSt w) = w

data Register Source #

Constructors

Zero 
Ra 
Sp 
Gp 
Tp 
T0 
T1 
T2 
S0Fp 
S1 
A0 
A1 
A2 
A3 
A4 
A5 
A6 
A7 
S2 
S3 
S4 
S5 
S6 
S7 
S8 
S9 
S10 
S11 
T3 
T4 
T5 
T6 

Instances

Instances details
Enum Register Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Generic Register Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Associated Types

type Rep Register 
Instance details

Defined in Wrench.Isa.RiscIv

type Rep Register = D1 ('MetaData "Register" "Wrench.Isa.RiscIv" "wrench-0.0.6.3-GOHhJzRU80S94JGLGysv3F" 'False) (((((C1 ('MetaCons "Zero" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Ra" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Sp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Gp" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Tp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "T0" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "T1" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "T2" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "S0Fp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S1" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "A0" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "A1" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "A2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "A3" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "A4" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "A5" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: ((((C1 ('MetaCons "A6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "A7" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "S2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S3" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "S4" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S5" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "S6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S7" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "S8" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S9" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "S10" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S11" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "T3" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "T4" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "T5" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "T6" 'PrefixI 'False) (U1 :: Type -> Type))))))

Methods

from :: Register -> Rep Register x #

to :: Rep Register x -> Register #

Read Register Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Show Register Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Eq Register Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Hashable Register Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Default w => Default (HashMap Register w) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Methods

def :: HashMap Register w

type Rep Register Source # 
Instance details

Defined in Wrench.Isa.RiscIv

type Rep Register = D1 ('MetaData "Register" "Wrench.Isa.RiscIv" "wrench-0.0.6.3-GOHhJzRU80S94JGLGysv3F" 'False) (((((C1 ('MetaCons "Zero" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Ra" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Sp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Gp" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Tp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "T0" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "T1" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "T2" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "S0Fp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S1" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "A0" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "A1" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "A2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "A3" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "A4" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "A5" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: ((((C1 ('MetaCons "A6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "A7" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "S2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S3" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "S4" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S5" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "S6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S7" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "S8" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S9" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "S10" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "S11" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "T3" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "T4" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "T5" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "T6" 'PrefixI 'False) (U1 :: Type -> Type))))))

data MemRef w Source #

Constructors

MemRef 

Fields

Instances

Instances details
Show w => Show (MemRef w) Source # 
Instance details

Defined in Wrench.Isa.RiscIv

Methods

showsPrec :: Int -> MemRef w -> ShowS #

show :: MemRef w -> String #

showList :: [MemRef w] -> ShowS #