Documentation
¶
Index ¶
Constants ¶
const ( AllDeps = iota // Follow all AST edges DataDeps // Follow only consumer-producer edges )
Options for computing dependencies
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bundle ¶
type Bundle struct {
From []Node
}
A Bundle is an unordered collection of expressions
func (*Bundle) NodeString ¶
NodeString implements graph pretty printing
type Command ¶
type Command struct { From []Node // Inputs Request Request // Requirements for device selection Inst interface{} // Command-specific data Output []Inst // Output from compilation }
A Command is high-level instruction. Both UseComp and Bundles are currently issued only by the ast, maker, and codegen areas of code. Command is different: the instruction trace is populated by commandInst objects, each of which contain a Command object. However, at that stage some of the fields of Command are not correctly populated, and so these are modified by the maker at the same point at which UseComp objects are issued.
func FindReachingCommands ¶
FindReachingCommands returns the set of commands that have a path to the given nodes without any intervening commands.
func (*Command) NodeString ¶
NodeString implements graph pretty printing
type Device ¶
type Device interface { CanCompile(Request) bool // Can this device compile this request // Compile produces a single-entry, single-exit DAG of instructions where // insts[0] is the entry point and insts[len(insts)-1] is the exit point Compile(ctx context.Context, cmds []Node) (insts []Inst, err error) }
A Device is a scheduling plugin
type Graph ¶
type Graph struct { Nodes []Node // contains filtered or unexported fields }
A Graph is a view of the AST as a graph
func ToGraph ¶
func ToGraph(opt ToGraphOpt) *Graph
ToGraph creates a graph from a list of roots. Include any referenced ast nodes in the resulting graph.
type IncubateInst ¶
type IncubateInst struct { // Time for which to incubate component Time wunit.Time // Temperature at which to incubate component Temp wunit.Temperature // Rate at which to shake incubator (force is device dependent) ShakeRate wunit.Rate // Radius at which ShakeRate is defined ShakeRadius wunit.Length // Time for which to pre-heat incubator PreTemp wunit.Temperature // Temperature at which to pre-heat incubator PreTime wunit.Time // Rate at which to pre-heat incubator PreShakeRate wunit.Rate // Radius at which PreShakeRate is defined PreShakeRadius wunit.Length }
An IncubateInst is a high-level command to incubate a component
type Inst ¶
type Inst interface { // Device that this instruction was generated for Device() Device // DependsOn returns instructions that this instruction depends on DependsOn() []Inst // SetDependsOn sets to the list of dependencies to only the args SetDependsOn(...Inst) // AppendDependsOn adds to the args to the existing list of dependencies AppendDependsOn(...Inst) }
An Inst is a instruction
type Insts ¶
type Insts []Inst
func (Insts) SequentialOrder ¶
func (insts Insts) SequentialOrder()
SequentialOrder takes a slice of instructions and modifies them in-place, resetting to sequential dependencies.
type Node ¶
A Node is the input to code generation. An abstract syntax tree generated via execution of an Antha protocol.
The basic design philosophy is to capture the semantics of the Antha language while reducing the cases for code generation. A secondary goal is to ease the creation of the AST at runtime (e.g., online, incremental generation of nodes).
Conveniently, a tree naturally expresses the single-use (i.e., destructive update) aspect of physical things, so the code generation keeps this representation longer than a traditional compiler flow would.
type PromptInst ¶
type PromptInst struct {
Message string
}
A PromptInst is a high-level command to prompt a human
type QPCRInstruction ¶
type QPCRInstruction struct { ID string ComponentIn []*wtype.Liquid ComponentOut []*wtype.Liquid Definition string Barcode string Command string TagAs string }
QPCRInstruction is a high-level instruction to perform a QPCR analysis.
func NewQPCRInstruction ¶
func NewQPCRInstruction() *QPCRInstruction
NewQPCRInstruction creates a new QPCRInstruction
func (QPCRInstruction) String ¶
func (ins QPCRInstruction) String() string
type Request ¶
type Request struct {
Selector []NameValue
}
A Request is set of required device capabilities
type ToGraphOpt ¶
type ToGraphOpt struct { Roots []Node // Roots of program WhichDeps int // Edges to follow when building graph }
A ToGraphOpt are options for ToGraph