mesh

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package mesh provides a connector implementation for the mesh.

Example
meshWidth := 5
meshHeight := 5
numMessages := 2000

// monitor := monitoring.NewMonitor()
// monitor.StartServer()

test := acceptance.NewTest()
engine := sim.NewSerialEngine()
// monitor.RegisterEngine(engine)
freq := 1 * sim.GHz
connector := NewConnector().
	// WithMonitor(monitor).
	WithEngine(engine).
	WithFreq(freq)

connector.CreateNetwork("Mesh")

for x := 0; x < meshWidth; x++ {
	for y := 0; y < meshHeight; y++ {
		name := fmt.Sprintf("Agent[%d][%d]", x, y)
		agent := acceptance.NewAgent(engine, freq, name, 4, test)
		agent.TickLater(0)

		// monitor.RegisterComponent(agent)

		connector.AddTile([3]int{x, y, 0}, agent.AgentPorts)
		test.RegisterAgent(agent)
	}
}

connector.EstablishNetwork()

test.GenerateMsgs(uint64(numMessages))

engine.Run()

test.MustHaveReceivedAllMsgs()
fmt.Println("passed!")
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) 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) WithNoCTracer

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

WithNoCTracer sets the tracer used to trace NoC-specific metrics, such as the traffics and congestions in the channels.

func (*Connector) WithPerfAnalyzer

func (c *Connector) WithPerfAnalyzer(
	analyzer *analysis.PerfAnalyzer,
) *Connector

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

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