Documentation ¶
Overview ¶
Package networkconnector defines a connector that is flexible to build any network topologies.
Index ¶
- type BandwidthFirstRouter
- type Connector
- func (c *Connector) AddSwitch() (switchID int)
- func (c *Connector) AddSwitchWithName(swName string) (switchID int)
- func (c *Connector) AddSwitchWithNameAndRoutingTable(swName string, rt routing.Table) (switchID int)
- func (c *Connector) ConnectDevice(switchID int, ports []sim.Port, param DeviceToSwitchLinkParameter)
- func (c *Connector) ConnectDeviceWithEPName(epName string, switchID int, ports []sim.Port, ...) (epPort, swPort sim.Port)
- func (c *Connector) ConnectSwitches(leftSwitchID, rightSwitchID int, param SwitchToSwitchLinkParameter) (leftPort, rightPort sim.Port)
- func (c *Connector) EstablishRoute()
- func (c *Connector) GetFlitSize() int
- func (c *Connector) NewNetwork(name string)
- func (c Connector) WithDefaultFreq(f sim.Freq) Connector
- func (c Connector) WithEngine(e sim.Engine) Connector
- func (c Connector) WithFlitSize(size int) Connector
- func (c Connector) WithMonitor(m *monitoring.Monitor) Connector
- func (c Connector) WithNoCTracer(t tracing.Tracer) Connector
- func (c Connector) WithPerfAnalyzer(a *analysis.PerfAnalyzer) Connector
- func (c Connector) WithRouter(r Router) Connector
- func (c Connector) WithVisTracer(t tracing.Tracer) Connector
- type DeviceToSwitchLinkParameter
- type FloydWarshallRouter
- type LinkEndDeviceParameter
- type LinkEndSwitchParameter
- type LinkParameter
- type Node
- type Remote
- type Router
- type SwitchToSwitchLinkParameter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BandwidthFirstRouter ¶
type BandwidthFirstRouter struct {
FlitSize int
}
BandwidthFirstRouter is a simple router that always establish route that involves the least number of hops.
func (BandwidthFirstRouter) EstablishRoute ¶
func (r BandwidthFirstRouter) EstablishRoute(nodes []Node)
EstablishRoute creates routes for the tables.
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector can build complex network topologies.
func (*Connector) AddSwitchWithName ¶
AddSwitchWithName adds a new switch to the network with an externally provided Name.
func (*Connector) AddSwitchWithNameAndRoutingTable ¶
func (c *Connector) AddSwitchWithNameAndRoutingTable( swName string, rt routing.Table, ) (switchID int)
AddSwitchWithNameAndRoutingTable adds a new switch to the network with an externally provided name and routing table.
func (*Connector) ConnectDevice ¶
func (c *Connector) ConnectDevice( switchID int, ports []sim.Port, param DeviceToSwitchLinkParameter, )
ConnectDevice connects a few ports that belongs to the device to a switch that is identified by switchID.
func (*Connector) ConnectDeviceWithEPName ¶
func (c *Connector) ConnectDeviceWithEPName( epName string, switchID int, ports []sim.Port, param DeviceToSwitchLinkParameter, ) (epPort, swPort sim.Port)
ConnectDeviceWithEPName connects a few ports that belongs to the device to a switch that is identified by switchID.
func (*Connector) ConnectSwitches ¶
func (c *Connector) ConnectSwitches( leftSwitchID, rightSwitchID int, param SwitchToSwitchLinkParameter, ) (leftPort, rightPort sim.Port)
ConnectSwitches create a connection between two switches. The connection created is bi-directional.
func (*Connector) EstablishRoute ¶
func (c *Connector) EstablishRoute()
EstablishRoute sets the routing table for all the nodes.
func (*Connector) GetFlitSize ¶
GetFlitSize returns the flit size used by the network.
func (*Connector) NewNetwork ¶
NewNetwork resets the connector, making it ready to create a new network with the give Name.
func (Connector) WithDefaultFreq ¶
WithDefaultFreq sets the default frequency used by the components in the connection. Note that channels will not use the default frequency. Channels use their own frequency to adjust bandwidth.
func (Connector) WithEngine ¶
WithEngine sets the engine to be used by all the components in the connection.
func (Connector) WithFlitSize ¶
WithFlitSize sets the flit size to be used throughout the network.
func (Connector) WithMonitor ¶
func (c Connector) WithMonitor(m *monitoring.Monitor) Connector
WithMonitor sets the monitor that monitors all the components in the connection.
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( a *analysis.PerfAnalyzer, ) Connector
WithPerfAnalyzer sets the buffer analyzer that can record the buffer levels in the network.
func (Connector) WithRouter ¶
WithRouter sets the router to use to establish the routing tables.
type DeviceToSwitchLinkParameter ¶
type DeviceToSwitchLinkParameter struct { DeviceEndParam LinkEndDeviceParameter SwitchEndParam LinkEndSwitchParameter LinkParam LinkParameter }
DeviceToSwitchLinkParameter contains the parameters that define a link between a device and a switch.
type FloydWarshallRouter ¶
type FloydWarshallRouter struct{}
FloydWarshallRouter is a simple router that always establish route that involves the least number of hops.
func (FloydWarshallRouter) EstablishRoute ¶
func (r FloydWarshallRouter) EstablishRoute(nodes []Node)
EstablishRoute creates routes for the tables.
type LinkEndDeviceParameter ¶
type LinkEndDeviceParameter struct { IncomingBufSize int OutgoingBufSize int NumInputChannel int NumOutputChannel int }
LinkEndDeviceParameter defines the parameter that associated with an end of a link that is connected to a device.
type LinkEndSwitchParameter ¶
type LinkEndSwitchParameter struct { IncomingBufSize int OutgoingBufSize int NumInputChannel int NumOutputChannel int Latency int PortName string }
LinkEndSwitchParameter defines the parameter that associated with an end of a link that is connected to a switch.
type LinkParameter ¶
type LinkParameter struct { IsIdeal bool Frequency sim.Freq NumStage int CyclePerStage int PipelineWidth int }
LinkParameter defines the parameter of the link that connects to nodes.
type Remote ¶
type Remote struct { LocalNode Node LocalPort sim.Port RemoteNode Node RemotePort sim.Port Link sim.Connection }
Remote records the link between two nodes.
type Router ¶
type Router interface {
EstablishRoute(nodes []Node)
}
Router can help establish the routes of a network.
type SwitchToSwitchLinkParameter ¶
type SwitchToSwitchLinkParameter struct { LeftEndParam LinkEndSwitchParameter RightEndParam LinkEndSwitchParameter LinkParam LinkParameter }
SwitchToSwitchLinkParameter contains the parameters that define a link between two switches.