Expand description
Analysis for Calyx programs.
The analyses construct data-structures that make answering certain queries about Calyx programs easier.
Modules§
- Calculate the reaching definitions in a control program.
Structs§
- Struct to perform compaction on
seqs
. It will only work if you update_cont_read_writes for each component that you run it on. - Adding “NODE_ID”, “BEGIN_ID”, and “END_ID” attribute to control statement
- Extract the dependency order of a list of control programs. Dependencies are defined using read/write sets used in the control program. The read/write sets ignore ports on constants and ThisComponent.
- Contains a mapping from name of ir::CombGroup to the ports read by the control program as well as the mapping from invoke statements to the port mappings. The vector of ports is guaranteed to only contain unique ports.
- Given a set of assignment, generates an ordering that respects combinatinal dataflow.
- Builds a Domination Map for the control program. It maps nodes to sets of nodes. Here is what is included as a “node” in the domination map:
- Struct to store information about the go-done interfaces defined by a primitive. There is no default implementation because it will almost certainly be very unhelpful: you will want to use
from_ctx
. - Constructs a graph based representation of a component. Each node represents a
ir::Port
and each directed edge (X -> Y
) means thatX
’s value written toY
. - Defines a greedy graph coloring algorithm over a generic conflict graph.
- Default implemnetation is almost certainly not helpful. You should probably use
from_ctx
instead. - This analysis implements a parallel version of a classic liveness analysis. For each group or invoke, it returns a list of the state shareable cells that are “alive” during an execution of a group or invoke statement (we identify an invoke statement by the cell that is being invoked, and groups by the name of the group).
- Represents a group of
Nodes
that execute in parallel. - Helper methods to parse
@read_together
and@write_together
specifications - Calcuate the reads-from and writes-to set for a given set of assignments.
- A conflict graph that describes which nodes (i.e. groups/invokes) are being run in parallel to each other.
- Stores a Hashset that contains the type names of all components and primitives marked with either “share” or “state_share”,depending on what the user wants. Methods implemented by this struct can be used to determine whether a given cell is shareable or not Used by
live_range_analysis.rs
,cell_share.rs
, andinfer_share.rs
SingleNode
struct.- Represents a static FSM (i.e., the actual register in hardware that counts)
- Calculate live ranges across static par blocks. Assumes control ids have already been given; it does not add its own
- Detects if a group is solely being used to update a register.
Enums§
- Node can either be a SingleNode (i.e., a single node) or ParNodes (i.e., a group of nodes that are executing in parallel). Most methods in
Node
simply call the equivalent methods for each of the two possible variants. Perhaps could be more compactly implemented as a Trait. - Helpful for translating queries for the FSMTree structure. 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. Normal(i,j) means the FSM is outputing (i..j), incrementing each cycle (i.e., like normal) and not offloading. Note that even though the FSM is outputting i..j each cycle, that does not necesarily mean we are in cycles i..j (due to offloading performed in the past.)
Traits§
- Analyzes that can be performed on a set of assignments.
- Trait to propagate and extra “static” attributes through ir::Control. Calling the update function ensures that the current program, as well as all sub-programs have a “static” attribute on them. Usage: