AbstractComponent

AbstractComponent

Architecture blocks are modelled as a subtype of AbstractComponent. There are two main subtypes: Component, which represents all blocks that are not at the top level of an architecture model, and TopLevel. There is only TopLevel per architecture model.

getaddress(item)

Single argument version: Return an address encapsulated in item.

getaddress(item, index)

Get an address from item referenced by index.

Method List

getaddress(toplevel, path)

defined at /home/travis/build/hildebrandmw/Mapper2.jl/src/Architecture/Architecture.jl:324.

getaddress(toplevel, str)

defined at /home/travis/build/hildebrandmw/Mapper2.jl/src/Architecture/Architecture.jl:325.

getaddress(map, nodename)

defined at /home/travis/build/hildebrandmw/Mapper2.jl/src/Map/Map.jl:87.

source
check(c::AbstractComponent)

Check a component for ports that are not connected to any link. Only applies to ports visible to the level of hierarchy of c. That is, children of c will not be checked.

Returns a Vector{PortPath} of unused ports.

source

Return an iterator for the children within a component.

source
Base.getindexFunction.
getindex(component, path::Path{T})::T where T <: Union{Port,Link,Component}

Return the architecture type referenced by path. Error horribly if path does not exist.

getindex(toplevel, address)::Component

Return the top level component of toplevel at address.

source

Return an iterator for links within the component.

source
walk_children(component::AbstractComponent, [address]) :: Vector{Path{Component}}

Return relative paths to all the children of component. If address is given return relative paths to all components at address.

source
search_metadata(c::AbstractComponent, key, value, f::Function = ==)

Search the metadata of field of c for key. If c.metadata[key] does not exist, return false. Otherwise, return f(value, c.metadata[key]).

source
search_metadata!(c::AbstractComponent, key, value, f::Function = ==)

Call search_metadata on each subcomponent of c. Return true if function call return true for any subcomponent.

source
visible_ports(component::AbstractComponent)

Return Vector{PortPath} of the ports of component and the ports of the children of component.

source

Component

struct Component <: AbstractComponent

Fields

  • name

  • primitive

  • children

    Sub-components of this component. Indexed by instance name.

  • ports

    Ports instantiated directly by this component. Indexed by instance name.

  • links

    Links instantiated directly by this component. Indexed by instance name.

  • portlink

    Record of the Link (by name) attached to a Port, keyed by Path{Port}. Length of each Path{Port} must be 1 or 2, to reference ports either instantiated by this component directly, or by one of this component's immediate children.j

  • metadata

    Dict{String,Any} for holding any extra data needed by the user.

Documentation

Basic building block of architecture models. Can be used to construct hierarchical models.

Method List

Component(name, primitive, children, ports, links, portlink, metadata)
Component(name, primitive, children, ports, links, portlink, metadata)

defined at /home/travis/build/hildebrandmw/Mapper2.jl/src/Architecture/Architecture.jl:126.

Component(name; primitive, metadata)

defined at /home/travis/build/hildebrandmw/Mapper2.jl/src/Architecture/Architecture.jl:154.

source

The following methods apply only to concrete [Component] types:

ports(component, [classes])

Return an iterator for all the ports of the given component. Ports of children are not given. If classes are provided, only ports matching the specified classes will be returned.

source
portpaths(component, [classes])::Vector{Path{Port}}

Return Paths to all ports immediately instantiated in component.

source

TopLevel

struct TopLevel{D} <: AbstractComponent

Fields

  • name

  • children

    Direct children of the TopLevel, indexed by instance name.

  • child_to_address

    Translation from child instance name to the Address that child occupies.

  • address_to_child

    Translation from Address to the Component at that address.

  • links

    Links instantiated directly by the TopLevel.

  • portlink

    Record of which Links are attached to which Ports. Indexed by `Path{Port}.

  • metadata

Documentation

Top level component for an architecture mode. Main difference is between a TopLevel and a Component is that children of a TopLevel are accessed via address instead of instance name. A TopLevel also does not have any ports of its own.

Parameter D is the dimensionality of the TopLevel.

Method List

source

The following methods apply only TopLevel types:

addresses(toplevel)

Return an iterator of all addresses with subcomponents in toplevel.

source
hasaddress(toplevel, path)

Return true if the item referenced by path has an Address.

source
isaddress(toplevel, address)

Return true if address exists in toplevel.

source
connected_components(toplevel::TopLevel{A,D})::Dict{Address{D}, Set{Address{D}}

Return d where key k is a valid address of tl and where d[k] is the set of valid addresses of tl whose components are the destinations of links originating at address k.

source
mappables(a::TopLevel{D}, address::Address{D})

Return a Vector{Path{Component}} of paths to mappable components at address.

source
isconnected(toplevel, a::AbstractPath, b::AbstractPath)

Return true if architectural component referenced by path a is architecturally connected to that referenced by path b.

The order of the arguments is important for directed components. For example, if a references a port that is a source for link b in toplevel, then

julia> isconnected(toplevel, a, b)
true

julia> isconnected(toplevel, b, a)
false

If one of a or b is of type ComponentPath, then only ports are considered connected.

source