Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lmbollen committed Apr 21, 2022
1 parent 2872bf9 commit 87ab3d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bittide/src/Bittide/DoubleBufferedRAM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ doubleBufferedRAMByteAddressable initialContent switch readAddr writeFrame byteS

output = mux outputSelect buffer1 buffer0

-- | Blockram similar to 'blockram' with the addition that it takes a byte select signal
-- that controls which bytes at the write address are updated.
blockRamByteAddressable ::
forall dom bytes depth a .
(HiddenClockResetEnable dom, KnownNat bytes, 1 <= bytes, bytes ~ Regs a 8, KnownNat depth, Paddable a) =>
Expand All @@ -95,6 +97,8 @@ blockRamByteAddressable initRAM readAddr newEntry byteSelect =
writeBytes = unbundle $ splitWriteInBytes <$> newEntry <*> byteSelect
readBytes = bundle $ (`blockRam` readAddr) <$> initBytes <*> writeBytes

-- | Registor similar to 'register' with the addition that it takes a byte select signal
-- that controls which bytes are updated.
registerByteAddressable ::
forall dom a .
(HiddenClockResetEnable dom, Paddable a) =>
Expand All @@ -112,6 +116,10 @@ registerByteAddressable initVal newVal byteEnables =
case paddedToRegisters @8 $ Padded x of
RegisterBank vec -> vec


-- | Takes singular write operation (Maybe (Index maxIndex, writeData)) and splits it up
-- according to a supplied byteselect bitvector into a vector of byte sized write operations
-- (Maybe (Index maxIndex, Byte)).
splitWriteInBytes ::
forall maxIndex writeData .
(Paddable writeData) =>
Expand Down

0 comments on commit 87ab3d9

Please sign in to comment.