added basic decoding
This commit is contained in:
parent
ef58d5b07e
commit
32932f4816
7 changed files with 289 additions and 61 deletions
|
@ -4,13 +4,13 @@
|
|||
module Fetch(fetchInstruction) where
|
||||
|
||||
import Clash.Prelude
|
||||
import Types(Mem, Addr, FullWord)
|
||||
import Types(Mem, Addr, Insn)
|
||||
import Util(endianSwapWord)
|
||||
|
||||
data Insn = Instruction FullWord
|
||||
| Misaligned Addr
|
||||
data FetchResult = Instruction Insn
|
||||
| Misaligned Addr
|
||||
|
||||
fetchInstruction :: KnownNat n => Mem n -> Addr -> Insn
|
||||
fetchInstruction :: KnownNat n => Mem n -> Addr -> FetchResult
|
||||
fetchInstruction mem addr =
|
||||
let
|
||||
isWordAligned = addr .&. 3 == 0
|
||||
|
|
Reference in a new issue