Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
calebmkim committed Jul 16, 2024
1 parent f0fa096 commit 5b3b057
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions calyx-opt/src/analysis/static_schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ impl StaticFSM {
/// Because of the tree structure, %[i:j] is no longer is always equal to i <= fsm < j.
/// Offload(i) means the FSM is offloading when fsm == i: so if the fsm == i,
/// we need to look at the children to know what cycle we are in exactly.
/// Delay(i) means the FSM has offloaded for i cycles, meaning that if the fsm == x,
/// then we are actually in cycle i + x.
/// Normal(i,j) means the FSM is outputing (i..j), incrementing each cycle
/// and not offloading.
#[derive(Debug)]
pub enum StateType {
Normal((u64, u64)),
Expand Down Expand Up @@ -1285,6 +1285,17 @@ impl SingleNode {
let mut end_interval = ir::Guard::True.not();
let mut middle_interval = None;
let mut child_index = 0;
// Suppose fsm_schedule = Cycles FSM State (i.e., `fsm.out`)
// (0..10) -> Normal[0,10)
// (10..30) -> Offload(10) // Offloading to child
// (30..40) -> Normal[11, 21)
// (40,80) -> Offload(21)
// (80,100)-> Normal[22, 42)
// And query = (15,95).
// Then at the end of the following `for` loop we want:
// `beg_interval` should be fsm == 10 && <child.query_between(5,20)>
// `middle_interval` should be (11, 22)
// `end_interval` should be 22 <= fsm < 37
for ((beg, end), state_type) in self.fsm_schedule.iter() {
// Check if the query encompasses the entire interval.
// If so, we add it to the "middle" interval.
Expand Down

0 comments on commit 5b3b057

Please sign in to comment.