-- =======================================
-- = System size configuration variables =
-- =======================================
-- =======================================
-- = System size configuration variables =
-- =======================================
, buf1 :: MemState AdderDepthPL DataInt
, buf2 :: MemState AdderDepthPL DataInt
}
, buf1 :: MemState AdderDepthPL DataInt
, buf2 :: MemState AdderDepthPL DataInt
}
-- ======================================================
-- = Input Buffer: Buffers incomming inputs when needed =
-- ======================================================
-- = Input Buffer: Buffers incomming inputs when needed =
rippleBuffer (State buf) (inp, shift) = (State buf', out1, out2)
where
-- Write value
rippleBuffer (State buf) (inp, shift) = (State buf', out1, out2)
where
-- Write value
buf'' = zipWith selects buf next_valids
selects cell next_valid = if (not (fst cell)) && next_valid then
(True, inp)
buf'' = zipWith selects buf next_valids
selects cell next_valid = if (not (fst cell)) && next_valid then
(True, inp)
(rd_ptr1, rd_ptr2, wr_ptr) = ptrs
ptrs' = (rd_ptr1', rd_ptr2', wr_ptr')
-- Update pointers
(rd_ptr1, rd_ptr2, wr_ptr) = ptrs
ptrs' = (rd_ptr1', rd_ptr2', wr_ptr')
-- Update pointers
(rd_ptr1', rd_ptr2') = (rd_ptr1 + count, rd_ptr2 + count)
wr_ptr' = wr_ptr + 1
-- Write & Read from RAMs
(rd_ptr1', rd_ptr2') = (rd_ptr1 + count, rd_ptr2 + count)
wr_ptr' = wr_ptr + 1
-- Write & Read from RAMs
- (buf1', out1) = blockRAM buf1 inp (fromSizedWord rd_ptr1) (fromSizedWord wr_ptr) True
- (buf2', out2) = blockRAM buf2 inp (fromSizedWord rd_ptr2) (fromSizedWord wr_ptr) True
+ (buf1', out1) = blockRAM buf1 inp (fromUnsigned rd_ptr1) (fromUnsigned wr_ptr) True
+ (buf2', out2) = blockRAM buf2 inp (fromUnsigned rd_ptr2) (fromUnsigned wr_ptr) True
initRippleState :: Vector (AdderDepthPL :+: D1) (CellType, Discr)
initRippleState = copy (False, 0)
initRippleState :: Vector (AdderDepthPL :+: D1) (CellType, Discr)
initRippleState = copy (False, 0)