Expand description
Analysis for Calyx programs.
The analyses construct data-structures that make answering certain queries about Calyx programs easier.
Modules§
- reaching_
defns - Calculate the reaching definitions in a control program.
Structs§
- Compaction
Analysis - Struct to perform compaction on
seqs
. It will only work if you update_cont_read_writes for each component that you run it on. - Control
Id - Adding “NODE_ID”, “BEGIN_ID”, and “END_ID” attribute to control statement
- Control
Order - 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.
- Control
Ports - 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.
- Dataflow
Order - Given a set of assignment, generates an ordering that respects combinatinal dataflow.
- Dominator
Map - 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:
- GoDone
- 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
. - Graph
Analysis - 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
. - Graph
Coloring - Defines a greedy graph coloring algorithm over a generic conflict graph.
- Incomplete
Transition - Represents an FSM transition that doesn’t yet have a destination state.
- Inference
Analysis - Default implemnetation is almost certainly not helpful.
You should probably use
from_ctx
instead. - Live
Range Analysis - 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).
- ParNodes
- Represents a group of
Nodes
that execute in parallel. - Port
Interface - Helper methods to parse
@read_together
and@write_together
specifications - Promotion
Analysis - Read
Write Set - Calcuate the reads-from and writes-to set for a given set of assignments.
- Schedule
Conflicts - A conflict graph that describes which nodes (i.e. groups/invokes) are being run in parallel to each other.
- Share
Set - 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
- Single
Node SingleNode
struct.- StaticFSM
- Represents a static FSM (i.e., the actual register in hardware that counts)
- Static
ParTiming - Calculate live ranges across static par blocks. Assumes control ids have already been given; it does not add its own
- Static
Schedule - An instance of
StaticSchedule
is constrainted to live at least as long as the component in which the static island that it represents lives. - Variable
Detection - Detects if a group is solely being used to update a register.
Enums§
- FSMEncoding
- Node
- 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. - State
Type - 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§
- Assignment
Analysis - Analyzes that can be performed on a set of assignments.
- Into
Static - With
Static - 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: