mesh

package
v3.0.0-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

Package mesh provides a connector implementation for the mesh.

Example
Output:

passed!

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

A Connector can help establishing a mesh or torus network.

func NewConnector

func NewConnector() *Connector

NewConnector creates a new mesh Connector.

func (*Connector) AddTile

func (c *Connector) AddTile(loc [3]int, ports []sim.Port)

AddTile adds some ports to a give coordinate in the mesh or torus. The connector supports 3 dimensional meshes. If a 2D mesh is designed, simply set the third coordinate to 0. We assume first first tile always has a coordinate of [0,0,0]. Negative coordinate is not supported.

func (*Connector) CreateNetwork

func (c *Connector) CreateNetwork(name string)

CreateNetwork starts the process of creating a network. It also resets the connector if the connector has been used to create another network.

func (*Connector) EstablishNetwork

func (c *Connector) EstablishNetwork()

EstablishNetwork creates the switches, links, and the routing tables for the network to built.

func (*Connector) WithBandwidth

func (c *Connector) WithBandwidth(transferPerCycle float64) *Connector

WithBandwidth sets the bandwidth on each link in the unit of how many transfers per cycle.

func (*Connector) WithBufferAnalyzer

func (c *Connector) WithBufferAnalyzer(
	analyzer *bottleneckanalysis.BufferAnalyzer,
) *Connector

WithBufferAnalyzer sets that buffer analyzer that can be used to record the buffer level in the mesh.

func (*Connector) WithEngine

func (c *Connector) WithEngine(e sim.Engine) *Connector

WithEngine sets the engine to be used.

func (*Connector) WithFlitSize

func (c *Connector) WithFlitSize(size int) *Connector

WithFlitSize sets the flit size of the network.

func (*Connector) WithFreq

func (c *Connector) WithFreq(freq sim.Freq) *Connector

WithFreq sets the frequency that the network works at.

func (*Connector) WithMonitor

func (c *Connector) WithMonitor(monitor *monitoring.Monitor) *Connector

WithMonitor sets a monitor that can inspect the internal states of the components in the network.

func (*Connector) WithSwitchLatency

func (c *Connector) WithSwitchLatency(numCycles int) *Connector

WithSwitchLatency sets the latency on each switch.

func (*Connector) WithVisTracer

func (c *Connector) WithVisTracer(t tracing.Tracer) *Connector

WithVisTracer sets the tracer used to trace tasks in the network.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL