Class Builder

Convenience class used to enable easy creation of systems.

This wraps the more detailed and complex genie API.

Usage:

     require 'builder'
     local g = genie.Builder.new()

Methods

Builder:component (name, modl) Defines a new Component.
Builder:interface (name, type, dir) Defines a new Interface.
Builder:clock_src (name, binding) Define a Clock Source Interface.
Builder:clock_sink (name, binding) Define a Clock Sink Interface.
Builder:conduit_src (name) Define a Conduit Source Interface.
Builder:conduit_sink (name) Define a Conduit Sink Interface.
Builder:rs_src (name, clockif) Define a Routed Streaming Source Interface.
Builder:rs_sink (name, clockif) Define a Routed Streaming Sink Interface.
Builder:linkpoint (name, lpid) Creates a Linkpoint.
Builder:system (name, topofunc) Creates a System.
Builder:instance (name, comp) Instantiates a Component.
Builder:export (iface, name) Exports an Interface of a Component instance.
Builder:link (src, dest[, label]) Defines a Link between two Interfaces.
Builder:assoc_clk (clkif) Associates a Clock Interface with the current RS Interface.
Builder:make_exclusive (s) Marks a set of RS Links as temporally exclusive.
Builder:parameter (name, val) Creates or defines a parameter.
Builder:signal (role[, tag], vname[, width=1]) Registers a Verilog signal with an Interface.
Builder:latency_query (link, param) Creates a latency query.


Methods

Builder:component (name, modl)
Defines a new Component.

Parameters:

  • name string Component name
  • modl string name of Verilog module

Returns:

    genie.Node raw representation for advanced use
Builder:interface (name, type, dir)
Defines a new Interface. Applies to the current Component or System, which is defined by the most recent call to Builder:component or Builder:system.

Parameters:

  • name string name of Interface
  • type string one of clock, reset, conduit, or rs
  • dir string one of in or out

Returns:

    genie.Port raw representation for advanced use
Builder:clock_src (name, binding)
Define a Clock Source Interface. Also creates the clock signal binding within the Interface. Calls Builder:interface with type='clock' and dir='out' followed by a call to Builder:signal.

Parameters:

  • name string name of Interface
  • binding string name of Verilog clock signal in module

Returns:

    genie.Port
Builder:clock_sink (name, binding)
Define a Clock Sink Interface. Also creates the clock signal binding within the Interface. Calls Builder:interface with type='clock' and dir='in' followed by a call to Builder:signal.

Parameters:

  • name string name of Interface
  • binding string name of Verilog clock signal in module

Returns:

    genie.Port
Builder:conduit_src (name)
Define a Conduit Source Interface. Must connect to a Conduit Sink, but the direction of individual contained signals can still vary. Calls Builder:interface with type='conduit' and dir='out'.

Parameters:

  • name string name of Interface

Returns:

    genie.Port
Builder:conduit_sink (name)
Define a Conduit Sink Interface. Must connect to a Conduit Source, but the direction of individual contained signals can still vary. Calls Builder:interface with type='conduit' and dir='in'.

Parameters:

  • name string name of Interface

Returns:

    genie.Port
Builder:rs_src (name, clockif)
Define a Routed Streaming Source Interface. Also associates a Clock Interface with it. Calls Builder:interface with type='rs' and dir='out', followed by a call to Builder:assoc_clk to associate a clock interface.

Parameters:

  • name string name of Interface
  • clockif string name of associated Clock Interface

Returns:

    genie.Port
Builder:rs_sink (name, clockif)
Define a Routed Streaming Sink Interface. Also associates a Clock Interface with it. Calls Builder:interface with type='rs' and dir='in', followed by a call to Builder:assoc_clk to associate a clock interface.

Parameters:

  • name string name of Interface
  • clockif string name of associated Clock Interface

Returns:

    genie.Port
Builder:linkpoint (name, lpid)
Creates a Linkpoint. Applies to the current Interface, defined by the most recent call to Builder:interface or its specialized convenience functions.

Parameters:

  • name string name of Linkpoint
  • lpid string Verilog encoding of Linkpoint ID, eg 2'b00

Returns:

    genie.RSLinkpoint raw representation for advanced use
Builder:system (name, topofunc)
Creates a System. Can provide a GENIE-supplied topology function, or a custom one.

Parameters:

  • name string name of System
  • topofunc function topology function

Returns:

    genie.Node raw representation for advanced use
Builder:instance (name, comp)
Instantiates a Component. Instantiates within the current System, created by the most recent call to Builder:system.

Parameters:

  • name string name of instance
  • comp string name of previously-defined Component

Returns:

    genie.Node raw representation for advanced use
Builder:export (iface, name)
Exports an Interface of a Component instance. Within the current System, this creates a new top-level Interface with the same type and complementary direction, and automatically creates a Link between them.

Parameters:

  • iface string or Port hierarchical path, or reference to, Interface to export
  • name string name of new exported Interface that will be generated

Returns:

    genie.Port raw representation for advanced use
Builder:link (src, dest[, label])
Defines a Link between two Interfaces. The source and sink need to be of the same network type. For Routed Streaming Interfaces, the source/sink can be a Linkpoint.

Parameters:

  • src string or Port hierarchical path, or object reference, to source Interface/Linkpoint
  • dest string or Port hierarchical path, or object reference, to sink Interface/Linkpoint
  • label string unique label for Link (optional)

Returns:

    genie.Link raw representation for advanced use
Builder:assoc_clk (clkif)
Associates a Clock Interface with the current RS Interface. Applies to most recently-defined RS Interface.

Parameters:

  • clkif string name of Clock Interface
Builder:make_exclusive (s)
Marks a set of RS Links as temporally exclusive. This is a guarantee by the designer that none of the RS Links in this set will ever be used simultaneously.

Parameters:

  • s array(string) or array(Link) an array of RS Links (genie.Link) or RS Link labels
Builder:parameter (name, val)
Creates or defines a parameter. Applies to the most recently defined Component or System. Parameters of Components can reference parameters of their parent System. Creating a parameter without a value allows it to be set later. Creating a parameter with a value on a System generates it as a Verilog localparam and it can not be overridden later.

Parameters:

Builder:signal (role[, tag], vname[, width=1])
Registers a Verilog signal with an Interface. Applies to the Interface created by the most recent call to Builder:interface or its specialized convenience functions. The role and vname arguments are mandatory. Some types of signals also require a tag. If width is not specified, it defaults to 1.

It is also possible to refer to _part_ of a Verilog signal. This is done by supplying a three-element array for the width argument, in the form {totalwidth, width, lsb}. totalwidth is the size of the entire Verilog signal. Bits [lsb+width-1 : lsb] will be selected.

Parameters:

  • role string Signal role. Allowable values depend on the type of Interface.
  • tag string Used-defined tag to differentiate similar signal roles. (optional)
  • vname string Verilog name of signal in module to bind to.
  • width string, number or array width of signal, can be an expression, or a partial binding as described above (default 1)
Builder:latency_query (link, param)
Creates a latency query. Creates a new system-level parameter of the given name, whose value is set to the latency of the given RS link. The link can be specified by string label or by a reference to a Link object.

Parameters:

  • link string or Link the Routed Streaming link to query, specified by string link label or directly by object
  • param string name of the system-level parameter to create and populate
generated by LDoc 1.4.3 Last updated 2016-02-26 13:23:52