lava.magma.compiler

lava.magma.compiler.channel_map

digraph inheritance85ea490b24 { bgcolor=transparent; rankdir=TB; size=""; "ChannelMap" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.channel_map.ChannelMap",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The ChannelMap is used by the SubCompilers during compilation to"]; "Payload" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.channel_map.Payload",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Payload(multiplicity: int, tiling: Optional[Tuple[int, ...]] = None, src_port_initializer: lava.magma.compiler.utils.PortInitializer = None, dst_port_initializer: lava.magma.compiler.utils.PortInitializer = None)"]; "PortPair" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.channel_map.PortPair",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="PortPair(src: lava.magma.core.process.ports.ports.AbstractSrcPort, dst: lava.magma.core.process.ports.ports.AbstractDstPort)"]; }
class lava.magma.compiler.channel_map.ChannelMap(*args, **kwargs)

Bases: dict

The ChannelMap is used by the SubCompilers during compilation to communicate how they are planning to partition Processes onto their available resources.

classmethod from_proc_groups(proc_groups)

Initializes a ChannelMap from a list of process ProcGroups extracting the ports from every process group.

For every port pair in the process groups a PortPair will be created and set as a key on the ChannelMap object which inherits from standard dict, the values are initialized with default Payload having multiplicity of 1.

Every subcompiler will then update the multiplicity according to its partitioning process. Payload also include fields for parameterization of convolutional processes.

Parameters:

proc_groups (a list of ProcessGroups each multiple processes.) –

Return type:

ChannelMap

Returns:

  • channel_map (A ChannelMap object initialized with the PortPairs found in)

  • the list of process groups given as input.

get_port_initializer(port)
has_port_initializer(port)
Return type:

bool

property lmt_allocation_dict: Dict[int, int]
set_port_initializer(port, port_initializer)
class lava.magma.compiler.channel_map.Payload(multiplicity, tiling=None, src_port_initializer=None, dst_port_initializer=None)

Bases: object

dst_port_initializer: PortInitializer = None
multiplicity: int
src_port_initializer: PortInitializer = None
tiling: Optional[Tuple[int, ...]] = None
class lava.magma.compiler.channel_map.PortPair(src, dst)

Bases: object

dst: AbstractDstPort
src: AbstractSrcPort

lava.magma.compiler.compiler

digraph inheritance1568e37b60 { bgcolor=transparent; rankdir=TB; size=""; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "AbstractBuilder" [URL="../lava.magma.compiler.builders.html#lava.magma.compiler.builders.interfaces.AbstractBuilder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Builders interface for building processes in a given backend."]; "ABC" -> "AbstractBuilder" [arrowsize=0.5,style="setlinewidth(0.5)"]; "AbstractCProcessModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler.AbstractCProcessModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "AbstractNcProcessModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler.AbstractNcProcessModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "AbstractProcessBuilder" [URL="../lava.magma.compiler.builders.html#lava.magma.compiler.builders.interfaces.AbstractProcessBuilder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An AbstractProcessBuilder is the base type for process builders."]; "AbstractBuilder" -> "AbstractProcessBuilder" [arrowsize=0.5,style="setlinewidth(0.5)"]; "CProcCompiler" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler.CProcCompiler",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "CProcessBuilder" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler.CProcessBuilder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "AbstractProcessBuilder" -> "CProcessBuilder" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Compiler" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler.Compiler",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Lava processes Compiler, called from any process in a process network."]; "NcProcCompiler" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler.NcProcCompiler",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "NcProcessBuilder" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler.NcProcessBuilder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "AbstractProcessBuilder" -> "NcProcessBuilder" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class lava.magma.compiler.compiler.AbstractCProcessModel

Bases: object

class lava.magma.compiler.compiler.AbstractNcProcessModel

Bases: object

class lava.magma.compiler.compiler.CProcCompiler(*args, **kwargs)

Bases: object

class lava.magma.compiler.compiler.CProcessBuilder(proc_model, model_id)

Bases: AbstractProcessBuilder

class lava.magma.compiler.compiler.Compiler(compile_config=None, loglevel=30)

Bases: object

Lava processes Compiler, called from any process in a process network.

Creates an Executable for the network of processes connected to the process passed to the compile method.

compile(process, run_cfg)

Compiles all Processes connected to the given Process and the channels defined by their connectivity.

Returns an Executable that contains all Builder instances required to execute the Lava Process network on heterogeneous hardware.

Parameters:
  • process (AbstractProcess) – Process from which all connected Processes in the Lava Process network are searched.

  • run_cfg (RunConfig) – RunConfig that determines which ProcessModels will be selected for Processes.

Returns:

executable – An instance of an Executable that contains all required Builders.

Return type:

Executable

class lava.magma.compiler.compiler.NcProcCompiler(*args, **kwargs)

Bases: object

class lava.magma.compiler.compiler.NcProcessBuilder(proc_model, model_id)

Bases: AbstractProcessBuilder

lava.magma.compiler.compiler_graphs

digraph inheritance1ee0b85370 { bgcolor=transparent; rankdir=TB; size=""; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "AbstractCProcessModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_graphs.AbstractCProcessModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "AbstractNcProcessModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_graphs.AbstractNcProcessModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "AbstractProcGroupDiGraphs" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_graphs.AbstractProcGroupDiGraphs",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Abstract class for generating and holding directed graphs needed to"]; "ABC" -> "AbstractProcGroupDiGraphs" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DiGraph" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Base class for directed graphs."]; "Graph" -> "DiGraph" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DiGraphBase" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_graphs.DiGraphBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for directed graphs in the compiler."]; "DiGraph" -> "DiGraphBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Enum" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Generic enumeration."]; "Graph" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Base class for undirected graphs."]; "NodeAnnotation" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_graphs.NodeAnnotation",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Annotations for the nodes of directed graphs created for compilation."]; "Enum" -> "NodeAnnotation" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ProcDiGraph" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_graphs.ProcDiGraph",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Directed graph data structure for the compiler which has some nodes"]; "DiGraphBase" -> "ProcDiGraph" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ProcGroupDiGraphs" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_graphs.ProcGroupDiGraphs",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Concrete subclass of `AbstractProcGroupDiGraphs` that generates"]; "AbstractProcGroupDiGraphs" -> "ProcGroupDiGraphs" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ProcessModelTypes" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_graphs.ProcessModelTypes",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Enumeration of different types of ProcessModels: Py, C, Nc, etc."]; "Enum" -> "ProcessModelTypes" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class lava.magma.compiler.compiler_graphs.AbstractCProcessModel

Bases: object

class lava.magma.compiler.compiler_graphs.AbstractNcProcessModel

Bases: object

class lava.magma.compiler.compiler_graphs.AbstractProcGroupDiGraphs

Bases: ABC

Abstract class for generating and holding directed graphs needed to create ProcGroups for compilation.

Concrete subclass must implement get_proc_groups() method that outputs a list of ProcGroups, where type(ProcGroup) = List[AbstractProcess].

Downstream compiler iterates over the list of ProcGroups and invokes appropriate sub-compilers depending on the ProcessModel type.

abstract get_proc_groups()
Return type:

List[List[AbstractProcess]]

class lava.magma.compiler.compiler_graphs.DiGraphBase(*args, **kwargs)

Bases: DiGraph

Base class for directed graphs in the compiler.

The nodes of instances of this class can be any hashable objects, they need not be of type AbstractProcess. Inherits from NetworkX.DiGraph class.

annotate_digraph_by_degree()

Annotate the graph’s nodes according to their degree.

More specifically, the annotations are based on the degree deficit of a node, defined as (out degree - in degree).

See also

NodeAnnotation

collapse_cycles_to_nodes()

Find simple cycles and collapse them on a single node iteratively, until no simple cycles can be found or the entire graph reduces to a single simple cycle.

Returns:

out_graph – A copy of self with node-replacement surgery complete.

Return type:

DiGraphBase

collapse_subgraph_to_node(subgraph)

Replace any connected subgraph of the DiGraphBase object with a single node, while preserving connectivity.

The new node is a DiGraphBase object, which preserves the internal connectivity of the subgraph.

Parameters:

subgraph (DiGraphBase) – Subgraph which needs to be collapsed into a single node. It needs to be connected..

Returns:

out_graph – A copy of self with node-replacement surgery complete.

Return type:

DiGraphBase

is_dag(graph=None)

Check if the input DiGraphBase is a DAG by recursive leaf pruning.

Parameters:

graph (DiGraphBase) – This parameter is only needed for recursion. It holds the residual graph after pruning leaf nodes of the graph from previous recursive step. At the first iterations, graph = None.

Return type:

Tuple[bool, DiGraphBase]

Returns:

  • DAGness of the graph (Bool) – True if the graph is a DAG, else False

  • graph (DiGraphBase) – The residual subgraph that remains after the input graph runs out of leaf nodes after all recursions are over.

class lava.magma.compiler.compiler_graphs.NodeAnnotation(value)

Bases: Enum

Annotations for the nodes of directed graphs created for compilation. The node attribute called “degdef” (short for “degree deficit”) of a node takes one of the following seven values:

  1. PUREIN, a pure input Process: in degree of the node = 0

  2. PUREOUT a pure output Process: out degree of the node = 0

  3. ISOLATED a Process node with in degree = out degree = 0

  4. INLIKE an in-like Process: (out degree) - (in degree) < 0

  5. OUTLIKE an out-like Process: (out degree) - (in degree) > 0

  6. NEUTRAL a Process node with in degree = out degree

  7. INVALID a Process node that does not fit any of the above (unlikely)

INLIKE = 4
INVALID = 7
ISOLATED = 3
NEUTRAL = 6
OUTLIKE = 5
PUREIN = 1
PUREOUT = 2
class lava.magma.compiler.compiler_graphs.ProcDiGraph(*args, **kwargs)

Bases: DiGraphBase

Directed graph data structure for the compiler which has some nodes that are Lava Processes.

If a list of Lava Processes is passed to the constructor, using proc_graph keyword argument, a DiGraph will be created with the Processes as nodes and their interconnectivity as edges.

Inherits from DiGraphBase, which in turn inherits from NetworkX.DiGraph. If the constructor is passed *args and **kwargs that create parts of a NetworkX.DiGraph, then the graph with Process nodes is created in addition to (and disjoint from) the existing graph elements.

convert_to_procid_graph()

Convert ProcDiGraph to a DiGraph whose nodes are just the process ids of Processes from the original ProcDiGraph.

This utility method is useful to compare two ProcDiGraphs without actually using entire AbstractProcess objects as nodes.

Returns:

procid_graph – A graph with nodes = process ids of Processes forming nodes of ProcDiGraph. Each node retains the attributes of the original nodes.

Return type:

DiGraphBase

class lava.magma.compiler.compiler_graphs.ProcGroupDiGraphs(proc, run_cfg, compile_config=None)

Bases: AbstractProcGroupDiGraphs

Concrete subclass of AbstractProcGroupDiGraphs that generates and holds various directed graphs needed to generate ProcGroups needed for compilation.

All sub-compilers need the following tasks to be complete before they are instantiated:

  1. Find Processes:

    Using the “base” Process, on which proc.run(…) was called, a list of all processes connected to the base process is generated by traversing all InPort and OutPort connectivity.

  2. Generate RawProcDiGraph:

    Using the list in step 1, a directed graph is generated with Processes as nodes. As the exact behaviour of Processes is not known (i.e., ProcessModels), the directed graph is ‘raw’, without resolving any hierarchical Processes.

  3. Find and select ProcessModels:

    Using a RunConfig along with the list of Processes in step 1, a dictionary mapping Process to ProcessModel is created. Then ProcessModels are assigned as attributes to the Process instances.

  4. Generate ResolvedProcDiGraph:

    Using the dict mapping Processes to ProcessModels, create a directed graph with Processes as nodes. By this point, hierarchical Processes are known and resolved using their SubProcessModels (therefore the name). As these Processes do not feature in the dict mapping, they do not constitute a node in the graph.

  5. Generate IsoModelCondensedDiGraph:

    Using the ResolvedProcDiGraph generated in step 4, find all Process nodes with the same ProcessModel type, which are neighbours of each other (in the sense of Graph Theory), and collapse/condense them into a single node, while preserving the connectivity.

  6. Generate ProcGroupDiGraph:

    Using the IsoModelCondensedDiGraph from step 5, find all node that are not connected via feed-forward topology (i.e., all nodes that are a part of some cyclic structure) and collapse/condense them into a single node, while preserving connectivity. Each node of ProcGroupDiGraph thus generated is a ProcGroup.

The ProcGroupDiGraph, by construction, is a single simple cycle or a DAG. In the first case, the simple cycle is broken at an arbitrary edge and List[ProcGroup] is generated from the list of its nodes. In the case that ProcGroupDiGraph is a DAG, it is ordered using topological sorting and List[ProcGroup] is produced by reversing the sorted order of nodes.

property base_proc

The Process on which Process.run(…) is called.

get_proc_groups()

Create a list of process groups sorted in compilation order.

The compilation order is obtained by reversing the topologically sorted order on compile_group_graph. Nodes of compile_group_graph can be graphs themselves. These are flattened into list of processes comprising a ProcGroup.

This is the interface to the downstream parts of the compiler.

Returns:

proc_groups – A list of ProcGroup. The object ProcGroup is itself a short-hand for List[AbstractProcess]. Each ProcGroup is processed as a single entity by the downstream parts of the compiler.

Return type:

List[ProcGroup]

property isomodel_condensed_digraph

Directed graph derived from ProcGroupDiGraphs.resolved_proc_graph, such that all connected Processes with same type of ProcessModel are collapsed/condensed onto a single node in the graph.

property num_procs_post_subproc_expansion

Number of leaf Processes, after ProcessModel discovery and SubProcessModel resolution/expansion.

This is the number of nodes in resolved_proc_digraph

property num_procs_pre_pm_discovery

Number of Processes before ProcessModel discovery.

This is the number of nodes in raw_proc_digraph.

See also

raw_proc_digraph

property proc_group_digraph

Directed graph derived from ProcGroupDiGraphs.isomodel_condensed_graph, such that all nodes involved in any kind of non-linear/feedback/cyclical topology are collapsed/condensed onto a single node.

A proc_group_digraph - by construction - is a single simple cycle or a DAG.

property raw_proc_digraph

Directed graph of all connected Processes _before_ ProcessModel discovery.

This graph is generated using Process-level connectivity before any ProcessModels are discovered. Any sub-Processes inside a SubProcessModel of a hierarchical Process will not show up in this graph.

property resolved_proc_digraph

Directed graph of all connected Processes _after_ ProcessModel discovery.

This graph is generated after discovering all ProcessModels and resolving/building SubProcessModels. Therefore, no hierarchical Processes show up in this graph. They are substituted by the sub-Processes inside their SubProcessModels.

class lava.magma.compiler.compiler_graphs.ProcessModelTypes(value)

Bases: Enum

Enumeration of different types of ProcessModels: Py, C, Nc, etc.

C = <class 'lava.magma.compiler.compiler_graphs.AbstractCProcessModel'>
NC = <class 'lava.magma.compiler.compiler_graphs.AbstractNcProcessModel'>
PY(proc_params, loglevel=30) = <class 'lava.magma.core.model.py.model.AbstractPyProcessModel'>
lava.magma.compiler.compiler_graphs.annotate_folded_view(proc_list, folded_procs=None)

Annotate folded views and propagate them recursively

lava.magma.compiler.compiler_graphs.find_processes(proc, seen_procs=None)

Find all processes that are connected to proc.

Processes are connected via different kinds of Ports to other processes. This method starts at the given proc and traverses the graph along connections to find all connected processes.

During compilation, this method is called before discovering ProcessModels implementing Processes.

Parameters:
  • proc (AbstractProcess) – Base process starting which the discovery of all connected Processes begins.

  • seen_procs (List[AbstractProcess]) – A list of Processes visited during traversal of connected Processes. Used for making the method recursive. This parameter is set to None at the time of the first call.

Returns:

seen_procs – A list of all discovered Processes.

Return type:

List[AbstractProcess]

lava.magma.compiler.compiler_graphs.flatten_list_itertools(ll)

Simpler way to flatten nested lists.

Return type:

List

lava.magma.compiler.compiler_graphs.flatten_list_recursive(ll)

Recursively flatten a list of lists.

Parameters:

ll (list) – Any list of lists (of any depth)

Returns:

ll – Flattened list

Return type:

list

Notes

Taken from: https://stackabuse.com/python-how-to-flatten-list-of-lists/

lava.magma.compiler.compiler_utils

digraph inheritance1edf84e0d6 { bgcolor=transparent; rankdir=TB; size=""; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "AbstractBuilder" [URL="../lava.magma.compiler.builders.html#lava.magma.compiler.builders.interfaces.AbstractBuilder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Builders interface for building processes in a given backend."]; "ABC" -> "AbstractBuilder" [arrowsize=0.5,style="setlinewidth(0.5)"]; "AbstractProcessBuilder" [URL="../lava.magma.compiler.builders.html#lava.magma.compiler.builders.interfaces.AbstractProcessBuilder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An AbstractProcessBuilder is the base type for process builders."]; "AbstractBuilder" -> "AbstractProcessBuilder" [arrowsize=0.5,style="setlinewidth(0.5)"]; "CProcessBuilder" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_utils.CProcessBuilder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "AbstractProcessBuilder" -> "CProcessBuilder" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NcProcessBuilder" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.compiler_utils.NcProcessBuilder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "AbstractProcessBuilder" -> "NcProcessBuilder" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class lava.magma.compiler.compiler_utils.CProcessBuilder(proc_model, model_id)

Bases: AbstractProcessBuilder

class lava.magma.compiler.compiler_utils.NcProcessBuilder(proc_model, model_id)

Bases: AbstractProcessBuilder

lava.magma.compiler.compiler_utils.split_proc_builders_by_type(proc_builders)

Given a dictionary of process to builders, returns a tuple of process to builder dictionaries for Py, C and Nc processes.

lava.magma.compiler.exceptions

digraph inheritance2f668f76a1 { bgcolor=transparent; rankdir=TB; size=""; "NoProcessModelFound" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.exceptions.NoProcessModelFound",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ProcessAlreadyCompiled" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.exceptions.ProcessAlreadyCompiled",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; }
exception lava.magma.compiler.exceptions.NoProcessModelFound(proc)

Bases: Exception

exception lava.magma.compiler.exceptions.ProcessAlreadyCompiled(proc)

Bases: Exception

lava.magma.compiler.executable

digraph inheritance8c6a0b2504 { bgcolor=transparent; rankdir=TB; size=""; "Executable" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.executable.Executable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Produced by compiler and contains everything the Runtime needs to run"]; }
class lava.magma.compiler.executable.Executable(process_list, proc_builders, channel_builders, node_configs, sync_domains, runtime_service_builders=None, sync_channel_builders=None, watchdog_manager_builder=None)

Bases: object

Produced by compiler and contains everything the Runtime needs to run process.

This includes all ProcessModels of sub processes, RuntimeService processes for the various nodes in the system and channel configurations. An Executable should be serializable so it can be saved and loaded at a later point.

assign_runtime_to_all_processes(runtime)
channel_builders: ty.List[ChannelBuilderMp]
node_configs: ty.List[NodeConfig]
proc_builders: ty.Dict[AbstractProcess, 'AbstractProcessBuilder']
process_list: ty.List[AbstractProcess]
runtime_service_builders: ty.Optional[ty.Dict[SyncDomain, RuntimeServiceBuilder]] = None
sync_channel_builders: ty.Optional[ty.Iterable[AbstractChannelBuilder]] = None
sync_domains: ty.List[SyncDomain]
watchdog_manager_builder: WatchdogManagerBuilder = None

lava.magma.compiler.mappable_interface

digraph inheritance451e413db4 { bgcolor=transparent; rankdir=TB; size=""; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Mappable" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.mappable_interface.Mappable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Interface to make entity mappable."]; "ABC" -> "Mappable" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class lava.magma.compiler.mappable_interface.Mappable

Bases: ABC

Interface to make entity mappable.

get_logical()
Return type:

List of LogicalAddresses.

set_physical(addr)
Parameters:

addr (List of PhysicalAddresses to be assigned to the mappable.) –

lava.magma.compiler.mapper

digraph inheritancee3ae9b7aeb { bgcolor=transparent; rankdir=TB; size=""; "CRefPort" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.mapper.CRefPort",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Mapper" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.mapper.Mapper",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Assigns virtual addresses to different processes, mappable by mapping"]; "N3LogicalNeuroCore" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.mapper.N3LogicalNeuroCore",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; }
class lava.magma.compiler.mapper.CRefPort

Bases: object

class lava.magma.compiler.mapper.Mapper

Bases: object

Assigns virtual addresses to different processes, mappable by mapping logical addresses to virtual addresses.

map_cores(executable, channel_map)

This function gets called from the Compiler class once the partition is done. It maps logical addresses to virtual addresses.

Parameters:

executable (Compiled Executable) –

Return type:

None

class lava.magma.compiler.mapper.N3LogicalNeuroCore

Bases: object

lava.magma.compiler.node

digraph inheritancef4d06e3fdf { bgcolor=transparent; rankdir=TB; size=""; "Collection" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Sized" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Iterable" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Container" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Container" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Iterable" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "MutableSequence" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="All the operations on a read-write sequence."]; "Sequence" -> "MutableSequence" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Node" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.node.Node",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A Node represents a physical compute node on which one or more"]; "NodeConfig" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.node.NodeConfig",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A NodeConfig is a collection of Nodes. Nodes represent a physical"]; "UserList" -> "NodeConfig" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Reversible" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Iterable" -> "Reversible" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Sequence" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="All the operations on a read-only sequence."]; "Reversible" -> "Sequence" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Collection" -> "Sequence" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Sized" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "UserList" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A more or less complete user-defined wrapper around list objects."]; "MutableSequence" -> "UserList" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class lava.magma.compiler.node.Node(node_type, processes)

Bases: object

A Node represents a physical compute node on which one or more processes execute.

Nodes are of a specific type and hold references to all processes mapped to a node.

add_process(process)
class lava.magma.compiler.node.NodeConfig(init_list=None)

Bases: UserList

A NodeConfig is a collection of Nodes. Nodes represent a physical compute node on which one or more processes execute.

A NodeCfg has a list of all ‘nodes’ and a ‘node_map’ that maps each process to its respective node.

append(node)

Appends a new node to the NodeConfig.

property nodes: List[Node]

Returns list of all nodes of the NodeConfig.

set_var_models(var_models)

lava.magma.compiler.utils

digraph inheritanceea6b420877 { bgcolor=transparent; rankdir=TB; size=""; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Enum" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Generic enumeration."]; "IntEnum" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Enum where members are also (and must be) ints"]; "Enum" -> "IntEnum" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiCInPortInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiCInPortInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiCInPortInitializer(name: str, shape: Tuple[int, ...], d_type: type, port_type: str, size: int, transform_funcs: Dict[str, List[functools.partial]] = None, var_model: Optional[lava.magma.compiler.var_model.LoihiVarModel] = None, connected_port_type: Optional[lava.magma.compiler.utils.LoihiConnectedPortType] = None, connected_port_encoding_type: Optional[lava.magma.compiler.utils.LoihiConnectedPortEncodingType] = None, spike_type: Optional[lava.magma.core.model.spike_type.SpikeType] = None)"]; "LoihiIOPortInitializer" -> "LoihiCInPortInitializer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiConnectedPortEncodingType" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiConnectedPortEncodingType",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Encoding type of the connected port - Required in case of C_PY"]; "IntEnum" -> "LoihiConnectedPortEncodingType" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiConnectedPortType" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiConnectedPortType",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Types of port connectivity; direction does not matter"]; "IntEnum" -> "LoihiConnectedPortType" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiIOPortInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiIOPortInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Port Initializer for a I/O Port for C/NC Models"]; "LoihiPortInitializer" -> "LoihiIOPortInitializer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiInPortInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiInPortInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Port Initializer for a InPort for C/NC Models"]; "LoihiIOPortInitializer" -> "LoihiInPortInitializer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiOutPortInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiOutPortInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Port Initializer for a OutPort for C/NC Models"]; "LoihiIOPortInitializer" -> "LoihiOutPortInitializer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiPortInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiPortInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="This address needs to be defined based on var model"]; "PortInitializer" -> "LoihiPortInitializer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Mappable" -> "LoihiPortInitializer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiPyInPortInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiPyInPortInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiPyInPortInitializer(name: str, shape: Tuple[int, ...], d_type: type, port_type: str, size: int, transform_funcs: Dict[str, List[functools.partial]] = None, var_model: Optional[lava.magma.compiler.var_model.LoihiVarModel] = None, connected_port_type: Optional[lava.magma.compiler.utils.LoihiConnectedPortType] = None, connected_port_encoding_type: Optional[lava.magma.compiler.utils.LoihiConnectedPortEncodingType] = None, spike_type: Optional[lava.magma.core.model.spike_type.SpikeType] = None, connection_config: Optional[lava.magma.core.process.ports.connection_config.ConnectionConfig] = None)"]; "LoihiCInPortInitializer" -> "LoihiPyInPortInitializer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiVarInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiVarInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiVarInitializer(name: str, shape: Tuple[int, ...], value: Any, var_id: int, d_type: type)"]; "VarInitializer" -> "LoihiVarInitializer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiVarPortInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.LoihiVarPortInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiVarPortInitializer(name: str, shape: Tuple[int, ...], d_type: type, port_type: str, size: int, transform_funcs: Dict[str, List[functools.partial]] = None, var_model: Optional[lava.magma.compiler.var_model.LoihiVarModel] = None)"]; "LoihiPortInitializer" -> "LoihiVarPortInitializer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Mappable" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.mappable_interface.Mappable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Interface to make entity mappable."]; "ABC" -> "Mappable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PortInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.PortInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="PortInitializer(name: str, shape: Tuple[int, ...], d_type: type, port_type: str, size: int, transform_funcs: Dict[str, List[functools.partial]] = None)"]; "VarInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.VarInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="VarInitializer(name: str, shape: Tuple[int, ...], value: Any, var_id: int)"]; "VarPortInitializer" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.utils.VarPortInitializer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="VarPortInitializer(name: str, shape: Tuple[int, ...], var_name: str, d_type: type, port_type: str, size: int, port_cls: type, transform_funcs: Dict[str, List[functools.partial]] = None)"]; }
class lava.magma.compiler.utils.LoihiCInPortInitializer(name, shape, d_type, port_type, size, transform_funcs=None, var_model=None, connected_port_type=None, connected_port_encoding_type=None, spike_type=None)

Bases: LoihiIOPortInitializer

embedded_core = 0
embedded_counters = None
class lava.magma.compiler.utils.LoihiConnectedPortEncodingType(value)

Bases: IntEnum

Encoding type of the connected port - Required in case of C_PY

SEQ_DENSE = 2
SEQ_SPARSE = 4
VEC_DENSE = 1
VEC_SPARSE = 3
class lava.magma.compiler.utils.LoihiConnectedPortType(value)

Bases: IntEnum

Types of port connectivity; direction does not matter

C_C = 2
C_NC = 1
C_PY = 3
PY_NC = 4
class lava.magma.compiler.utils.LoihiIOPortInitializer(name, shape, d_type, port_type, size, transform_funcs=None, var_model=None, connected_port_type=None, connected_port_encoding_type=None, spike_type=None)

Bases: LoihiPortInitializer

Port Initializer for a I/O Port for C/NC Models

connected_port_encoding_type: Optional[LoihiConnectedPortEncodingType] = None
connected_port_type: Optional[LoihiConnectedPortType] = None
spike_type: Optional[SpikeType] = None
class lava.magma.compiler.utils.LoihiInPortInitializer(name, shape, d_type, port_type, size, transform_funcs=None, var_model=None, connected_port_type=None, connected_port_encoding_type=None, spike_type=None)

Bases: LoihiIOPortInitializer

Port Initializer for a InPort for C/NC Models

class lava.magma.compiler.utils.LoihiOutPortInitializer(name, shape, d_type, port_type, size, transform_funcs=None, var_model=None, connected_port_type=None, connected_port_encoding_type=None, spike_type=None)

Bases: LoihiIOPortInitializer

Port Initializer for a OutPort for C/NC Models

class lava.magma.compiler.utils.LoihiPortInitializer(name, shape, d_type, port_type, size, transform_funcs=None, var_model=None)

Bases: PortInitializer, Mappable

This address needs to be defined based on var model

get_logical()
Return type:

Returns logical address of the port initializer.

set_virtual(addrs)

Sets physical address of the port initializer :type addrs: List[NcVirtualAddress] :param addrs: :type addrs: List of address

var_model: Optional[LoihiVarModel] = None
class lava.magma.compiler.utils.LoihiPyInPortInitializer(name, shape, d_type, port_type, size, transform_funcs=None, var_model=None, connected_port_type=None, connected_port_encoding_type=None, spike_type=None, connection_config=None)

Bases: LoihiCInPortInitializer

connection_config: Optional[ConnectionConfig] = None
class lava.magma.compiler.utils.LoihiVarInitializer(name, shape, value, var_id, d_type)

Bases: VarInitializer

d_type: type
class lava.magma.compiler.utils.LoihiVarPortInitializer(name, shape, d_type, port_type, size, transform_funcs=None, var_model=None)

Bases: LoihiPortInitializer

class lava.magma.compiler.utils.PortInitializer(name, shape, d_type, port_type, size, transform_funcs=None)

Bases: object

d_type: type
name: str
port_type: str
shape: Tuple[int, ...]
size: int
transform_funcs: Dict[str, List[partial]] = None
class lava.magma.compiler.utils.VarInitializer(name, shape, value, var_id)

Bases: object

name: str
shape: Tuple[int, ...]
value: Any
var_id: int
class lava.magma.compiler.utils.VarPortInitializer(name, shape, var_name, d_type, port_type, size, port_cls, transform_funcs=None)

Bases: object

d_type: type
name: str
port_cls: type
port_type: str
shape: Tuple[int, ...]
size: int
transform_funcs: Dict[str, List[partial]] = None
var_name: str

lava.magma.compiler.var_model

digraph inheritanceb465548afd { bgcolor=transparent; rankdir=TB; size=""; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "AbstractVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.AbstractVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="AbstractVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1)"]; "ABC" -> "AbstractVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "AxonEncoder" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.AxonEncoder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Encoding for axon field"]; "ByteEncoder" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.ByteEncoder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Encodes ptr, len, base"]; "CVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.CVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="CVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1, address: 'ty.List[LoihiAddress]' = None, field_name: 'ty.Optional[str]' = None, register_name: 'ty.Optional[str]' = None, register_length: 'ty.Optional[int]' = None, variable_offset: 'ty.Optional[int]' = None, variable_length: 'ty.Optional[int]' = None, union_type: 'ty.Optional[bool]' = False, sub_type: 'ty.Optional[str]' = None)"]; "LoihiVarModel" -> "CVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ChipEncoder" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.ChipEncoder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Encoding for chip field"]; "ConvInVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.ConvInVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="ConvInVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1, x_dim: 'int' = 0, y_dim: 'int' = 0, f_dim: 'int' = 0, x_split: 'int' = 0, f_split: 'int' = 0, regions: 'ty.List[Region]' = None)"]; "AbstractVarModel" -> "ConvInVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Mappable" -> "ConvInVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ConvNeuronVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.ConvNeuronVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="ConvNeuronVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1, address: 'ty.List[LoihiAddress]' = None, field_name: 'ty.Optional[str]' = None, register_name: 'ty.Optional[str]' = None, register_length: 'ty.Optional[int]' = None, variable_offset: 'ty.Optional[int]' = None, variable_length: 'ty.Optional[int]' = None, union_type: 'ty.Optional[bool]' = False, sub_type: 'ty.Optional[str]' = None, alloc_dims: 'ty.List[ty.Tuple[int, int, int]]' = None, valid_dims: 'ty.List[ty.Tuple[int, int, int]]' = None, var_shape: 'ty.Tuple[int, int, int]' = None)"]; "LoihiNeuronVarModel" -> "ConvNeuronVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "CoreEncoder" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.CoreEncoder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Encodes a core xyp"]; "DecodeConfig" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.DecodeConfig",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="DecodeConfig(receive_mode: 'int', decode_mode: 'int')"]; "LoihiAddress" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.LoihiAddress",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiAddress(physical_chip_id: 'ChipIdx', physical_core_id: 'CoreIdx', logical_chip_id: 'ChipIdx', logical_core_id: 'CoreIdx', logical_idx_addr: 'int', length: 'int', stride: 'int')"]; "LoihiInAxonAddress" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.LoihiInAxonAddress",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiInAxonAddress(physical_chip_id: 'ChipIdx', physical_core_id: 'CoreIdx', logical_chip_id: 'ChipIdx', logical_core_id: 'CoreIdx', logical_idx_addr: 'int', length: 'int', stride: 'int', profile_id: 'int')"]; "LoihiAddress" -> "LoihiInAxonAddress" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiNeuronAddress" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.LoihiNeuronAddress",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiNeuronAddress(physical_chip_id: 'ChipIdx', physical_core_id: 'CoreIdx', logical_chip_id: 'ChipIdx', logical_core_id: 'CoreIdx', logical_idx_addr: 'int', length: 'int', stride: 'int', neuron_group_id: 'int')"]; "LoihiAddress" -> "LoihiNeuronAddress" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiNeuronVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.LoihiNeuronVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiNeuronVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1, address: 'ty.List[LoihiAddress]' = None, field_name: 'ty.Optional[str]' = None, register_name: 'ty.Optional[str]' = None, register_length: 'ty.Optional[int]' = None, variable_offset: 'ty.Optional[int]' = None, variable_length: 'ty.Optional[int]' = None, union_type: 'ty.Optional[bool]' = False, sub_type: 'ty.Optional[str]' = None)"]; "LoihiVarModel" -> "LoihiNeuronVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiSynapseAddress" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.LoihiSynapseAddress",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiSynapseAddress(physical_chip_id: 'ChipIdx', physical_core_id: 'CoreIdx', logical_chip_id: 'ChipIdx', logical_core_id: 'CoreIdx', logical_idx_addr: 'int', length: 'int', stride: 'int', syn_entry_id: 'int')"]; "LoihiAddress" -> "LoihiSynapseAddress" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiSynapseVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.LoihiSynapseVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiSynapseVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1, address: 'ty.List[LoihiAddress]' = None, field_name: 'ty.Optional[str]' = None, register_name: 'ty.Optional[str]' = None, register_length: 'ty.Optional[int]' = None, variable_offset: 'ty.Optional[int]' = None, variable_length: 'ty.Optional[int]' = None, union_type: 'ty.Optional[bool]' = False, sub_type: 'ty.Optional[str]' = None)"]; "LoihiVarModel" -> "LoihiSynapseVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LoihiVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.LoihiVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="LoihiVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1, address: 'ty.List[LoihiAddress]' = None, field_name: 'ty.Optional[str]' = None, register_name: 'ty.Optional[str]' = None, register_length: 'ty.Optional[int]' = None, variable_offset: 'ty.Optional[int]' = None, variable_length: 'ty.Optional[int]' = None, union_type: 'ty.Optional[bool]' = False, sub_type: 'ty.Optional[str]' = None)"]; "AbstractVarModel" -> "LoihiVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Mappable" -> "LoihiVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Mappable" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.mappable_interface.Mappable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Interface to make entity mappable."]; "ABC" -> "Mappable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NcSpikeIOVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.NcSpikeIOVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="NcSpikeIOVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1, address: 'ty.List[LoihiAddress]' = None, field_name: 'ty.Optional[str]' = None, register_name: 'ty.Optional[str]' = None, register_length: 'ty.Optional[int]' = None, variable_offset: 'ty.Optional[int]' = None, variable_length: 'ty.Optional[int]' = None, union_type: 'ty.Optional[bool]' = False, sub_type: 'ty.Optional[str]' = None, msg_queue_id: 'int' = 0, num_message_bits: 'int' = 8, interface: 'SpikeIOInterface' = <SpikeIOInterface.ETHERNET: 0>, spike_io_port: 'SpikeIOPort' = <SpikeIOPort.ETHERNET: 'p'>, spike_io_mode: 'SpikeIOMode' = <SpikeIOMode.TIME_COMPARE: 1>, decode_config: 'ty.Optional[DecodeConfig]' = None, time_compare: 'ty.Optional[TimeCompare]' = None, spike_encoder: 'ty.Optional[SpikeEncoder]' = None)"]; "NcVarModel" -> "NcSpikeIOVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NcVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.NcVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="NcVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1, address: 'ty.List[LoihiAddress]' = None, field_name: 'ty.Optional[str]' = None, register_name: 'ty.Optional[str]' = None, register_length: 'ty.Optional[int]' = None, variable_offset: 'ty.Optional[int]' = None, variable_length: 'ty.Optional[int]' = None, union_type: 'ty.Optional[bool]' = False, sub_type: 'ty.Optional[str]' = None)"]; "LoihiVarModel" -> "NcVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PyVarModel" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.PyVarModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="PyVarModel(var: 'InitVar[Var]' = None, node_id: 'int' = -1, runtime_srv_id: 'int' = -1)"]; "AbstractVarModel" -> "PyVarModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Region" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.Region",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Region(x_min: 'int', x_max: 'int', y_min: 'int', y_max: 'int', logical_chip_idx: 'ChipIdx', logical_core_idx: 'CoreIdx', physical_chip_idx: 'ChipIdx' = None, physical_core_idx: 'CoreIdx' = None)"]; "SpikeEncoder" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.SpikeEncoder",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="SpikeEncoder(islong: 'int', core: 'CoreEncoder', axon: 'AxonEncoder', chip: 'ChipEncoder', payload: 'ty.List[ByteEncoder]')"]; "TimeCompare" [URL="../lava/lava.magma.compiler.html#lava.magma.compiler.var_model.TimeCompare",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Used by SpikeBlock to determine when to inject spikes"]; }
class lava.magma.compiler.var_model.AbstractVarModel(var=None, node_id=-1, runtime_srv_id=-1)

Bases: ABC

node_id: int = -1
runtime_srv_id: int = -1
var: InitVar[Var] = None
class lava.magma.compiler.var_model.AxonEncoder(hi=ByteEncoder(base=0, len=0, ptr=0), lo=ByteEncoder(base=0, len=0, ptr=0))

Bases: object

Encoding for axon field

hi: ByteEncoder = ByteEncoder(base=0, len=0, ptr=0)
lo: ByteEncoder = ByteEncoder(base=0, len=0, ptr=0)
class lava.magma.compiler.var_model.ByteEncoder(base=0, len=0, ptr=0)

Bases: object

Encodes ptr, len, base

base: int = 0
len: int = 0
ptr: int = 0
class lava.magma.compiler.var_model.CVarModel(var=None, node_id=-1, runtime_srv_id=-1, address=None, field_name=None, register_name=None, register_length=None, variable_offset=None, variable_length=None, union_type=False, sub_type=None)

Bases: LoihiVarModel

class lava.magma.compiler.var_model.ChipEncoder(x=ByteEncoder(base=0, len=0, ptr=0), y=ByteEncoder(base=0, len=0, ptr=0), z=ByteEncoder(base=0, len=0, ptr=0))

Bases: object

Encoding for chip field

x: ByteEncoder = ByteEncoder(base=0, len=0, ptr=0)
y: ByteEncoder = ByteEncoder(base=0, len=0, ptr=0)
z: ByteEncoder = ByteEncoder(base=0, len=0, ptr=0)
lava.magma.compiler.var_model.ChipIdx: int
class lava.magma.compiler.var_model.ConvInVarModel(var=None, node_id=-1, runtime_srv_id=-1, x_dim=0, y_dim=0, f_dim=0, x_split=0, f_split=0, regions=None)

Bases: AbstractVarModel, Mappable

f_dim: int = 0
f_split: int = 0
get_logical()
Return type:

Returns logical address of the port initializer.

regions: ty.List[Region] = None
set_virtual(addrs)

Sets physical address of the port initializer :type addrs: List[NcVirtualAddress] :param addrs: :type addrs: List of address

x_dim: int = 0
x_split: int = 0
y_dim: int = 0
class lava.magma.compiler.var_model.ConvNeuronVarModel(var=None, node_id=-1, runtime_srv_id=-1, address=None, field_name=None, register_name=None, register_length=None, variable_offset=None, variable_length=None, union_type=False, sub_type=None, alloc_dims=None, valid_dims=None, var_shape=None)

Bases: LoihiNeuronVarModel

alloc_dims: ty.List[ty.Tuple[int, int, int]] = None
valid_dims: ty.List[ty.Tuple[int, int, int]] = None
var_shape: ty.Tuple[int, int, int] = None
class lava.magma.compiler.var_model.CoreEncoder(x=ByteEncoder(base=0, len=0, ptr=0), y=ByteEncoder(base=0, len=0, ptr=0), p=ByteEncoder(base=0, len=0, ptr=0))

Bases: object

Encodes a core xyp

p: ByteEncoder = ByteEncoder(base=0, len=0, ptr=0)
x: ByteEncoder = ByteEncoder(base=0, len=0, ptr=0)
y: ByteEncoder = ByteEncoder(base=0, len=0, ptr=0)
lava.magma.compiler.var_model.CoreIdx: int
class lava.magma.compiler.var_model.DecodeConfig(receive_mode, decode_mode)

Bases: object

decode_mode: int
receive_mode: int
class lava.magma.compiler.var_model.LoihiAddress(physical_chip_id, physical_core_id, logical_chip_id, logical_core_id, logical_idx_addr, length, stride)

Bases: object

length: int
logical_chip_id: ChipIdx
logical_core_id: CoreIdx
logical_idx_addr: int
physical_chip_id: ChipIdx
physical_core_id: CoreIdx
stride: int
class lava.magma.compiler.var_model.LoihiInAxonAddress(physical_chip_id, physical_core_id, logical_chip_id, logical_core_id, logical_idx_addr, length, stride, profile_id)

Bases: LoihiAddress

profile_id: int
class lava.magma.compiler.var_model.LoihiNeuronAddress(physical_chip_id, physical_core_id, logical_chip_id, logical_core_id, logical_idx_addr, length, stride, neuron_group_id)

Bases: LoihiAddress

neuron_group_id: int
class lava.magma.compiler.var_model.LoihiNeuronVarModel(var=None, node_id=-1, runtime_srv_id=-1, address=None, field_name=None, register_name=None, register_length=None, variable_offset=None, variable_length=None, union_type=False, sub_type=None)

Bases: LoihiVarModel

class lava.magma.compiler.var_model.LoihiSynapseAddress(physical_chip_id, physical_core_id, logical_chip_id, logical_core_id, logical_idx_addr, length, stride, syn_entry_id)

Bases: LoihiAddress

syn_entry_id: int
class lava.magma.compiler.var_model.LoihiSynapseVarModel(var=None, node_id=-1, runtime_srv_id=-1, address=None, field_name=None, register_name=None, register_length=None, variable_offset=None, variable_length=None, union_type=False, sub_type=None)

Bases: LoihiVarModel

class lava.magma.compiler.var_model.LoihiVarModel(var=None, node_id=-1, runtime_srv_id=-1, address=None, field_name=None, register_name=None, register_length=None, variable_offset=None, variable_length=None, union_type=False, sub_type=None)

Bases: AbstractVarModel, Mappable

address: ty.List[LoihiAddress] = None
field_name: ty.Optional[str] = None
get_logical()
Return type:

Returns logical address of the port initializer.

register_length: ty.Optional[int] = None
register_name: ty.Optional[str] = None
set_virtual(addrs)

Sets physical address of the port initializer :type addrs: List[NcVirtualAddress] :param addrs: :type addrs: List of address

sub_type: ty.Optional[str] = None
union_type: ty.Optional[bool] = False
variable_length: ty.Optional[int] = None
variable_offset: ty.Optional[int] = None
class lava.magma.compiler.var_model.NcSpikeIOVarModel(var=None, node_id=-1, runtime_srv_id=-1, address=None, field_name=None, register_name=None, register_length=None, variable_offset=None, variable_length=None, union_type=False, sub_type=None, msg_queue_id=0, num_message_bits=8, interface=SpikeIOInterface.ETHERNET, spike_io_port=SpikeIOPort.ETHERNET, spike_io_mode=SpikeIOMode.TIME_COMPARE, decode_config=None, time_compare=None, spike_encoder=None)

Bases: NcVarModel

decode_config: ty.Optional[DecodeConfig] = None
interface: SpikeIOInterface = 0
msg_queue_id: int = 0
num_message_bits: int = 8
spike_encoder: ty.Optional[SpikeEncoder] = None
spike_io_mode: SpikeIOMode = 1
spike_io_port: SpikeIOPort = 'p'
time_compare: ty.Optional[TimeCompare] = None
class lava.magma.compiler.var_model.NcVarModel(var=None, node_id=-1, runtime_srv_id=-1, address=None, field_name=None, register_name=None, register_length=None, variable_offset=None, variable_length=None, union_type=False, sub_type=None)

Bases: LoihiVarModel

class lava.magma.compiler.var_model.PyVarModel(var=None, node_id=-1, runtime_srv_id=-1)

Bases: AbstractVarModel

class lava.magma.compiler.var_model.Region(x_min, x_max, y_min, y_max, logical_chip_idx, logical_core_idx, physical_chip_idx=None, physical_core_idx=None)

Bases: object

logical_chip_idx: ChipIdx
logical_core_idx: CoreIdx
physical_chip_idx: ChipIdx = None
physical_core_idx: CoreIdx = None
x_max: int
x_min: int
y_max: int
y_min: int
class lava.magma.compiler.var_model.SpikeEncoder(islong, core, axon, chip, payload)

Bases: object

axon: AxonEncoder
chip: ChipEncoder
core: CoreEncoder
islong: int
payload: List[ByteEncoder]
class lava.magma.compiler.var_model.TimeCompare(time_mode, num_time_bits, time_len, time_ptr)

Bases: object

Used by SpikeBlock to determine when to inject spikes

num_time_bits: int
time_len: int
time_mode: int
time_ptr: int