Skip to content

Commit

Permalink
Update FIFO implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
minseongg committed Oct 8, 2024
1 parent 24a13af commit ec4ecdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions doc/docs/lang/combinator.md
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ impl<P: Copy> Vr<P> {
let ep = if s.len == 0.into_u() { None } else { Some(s.inner[s.raddr]) };
let ir = Ready::new(!full, ());
let inner_next = if enq { inner.set(waddr.resize::<{ clog2(N) }>(), ip.unwrap()) } else { inner };
let len_next = (len + U::from(enq).resize() - if deq { 1.into_u() } else { 0.into_u() }).resize();
let inner_next = if enq { inner.set(waddr, ip.unwrap()) } else { inner };
let len_next = (len + U::from(enq).resize() - U::from(deq).resize()).resize();
let raddr_next = if deq { wrapping_inc::<{ clog2(N) }>(raddr, N.into_u()) } else { raddr };
let waddr_next = if enq { wrapping_inc::<{ clog2(N) }>(waddr, N.into_u()) } else { waddr };
Expand Down Expand Up @@ -832,8 +832,8 @@ The example cycle-level behavior of `fifo` is as follows:
}
-->

- The ingress ready signal is true as long as the queue is not full.
- Pipeline is disabled for the FIFO queue.
- The ingress ready signal is `true` as long as the queue is not full.
- It does not give maximum throughput because both ingress transfer and egress transfer cannot happen simultaneously when the FIFO is full.
- Cycle 0, 1, 2, 3, 6: Ingress transfer happens.
- Cycle 1, 5, 6, 7: Egress transfer happens.

Expand Down
2 changes: 1 addition & 1 deletion hazardflow-designs/src/std/combinators/fifo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ where
let ep = Some(s);
let ir = Ready::new(!full, (er.inner.0, s));

let inner_next = if enq { inner.set(waddr.resize::<{ clog2(N) }>(), ip.unwrap()) } else { inner };
let inner_next = if enq { inner.set(waddr, ip.unwrap()) } else { inner };
let len_next = (len + U::from(enq).resize() - if deq { pop.resize() } else { 0.into_u() }).resize();
let raddr_next =
if deq { wrapping_add::<{ clog2(N) }>(raddr, pop.resize(), N.into_u()) } else { raddr };
Expand Down

0 comments on commit ec4ecdd

Please sign in to comment.