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 ¶
- type Connector
- func (c *Connector) AddTile(loc [3]int, ports []sim.Port)
- func (c *Connector) CreateNetwork(name string)
- func (c *Connector) EstablishNetwork()
- func (c *Connector) WithBandwidth(transferPerCycle float64) *Connector
- func (c *Connector) WithEngine(e sim.Engine) *Connector
- func (c *Connector) WithFlitSize(size int) *Connector
- func (c *Connector) WithFreq(freq sim.Freq) *Connector
- func (c *Connector) WithMonitor(monitor *monitoring.Monitor) *Connector
- func (c *Connector) WithNoCTracer(t tracing.Tracer) *Connector
- func (c *Connector) WithPerfAnalyzer(analyzer *analysis.PerfAnalyzer) *Connector
- func (c *Connector) WithSwitchLatency(numCycles int) *Connector
- func (c *Connector) WithVisTracer(t tracing.Tracer) *Connector
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 (*Connector) AddTile ¶
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 ¶
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 ¶
WithBandwidth sets the bandwidth on each link in the unit of how many transfers per cycle.
func (*Connector) WithEngine ¶
WithEngine sets the engine to be used.
func (*Connector) WithFlitSize ¶
WithFlitSize sets the flit size of the network.
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 ¶
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 ¶
WithSwitchLatency sets the latency on each switch.