pcie

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: 5 Imported by: 5

Documentation

Overview

Package pcie provides a Connector and establishes a PCIe connection.

Index

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
}

Connector can connect devices into a PCIe network.

func NewConnector

func NewConnector() *Connector

NewConnector creates a new connector that can help configure PCIe networks.

func (*Connector) AddRootComplex

func (c *Connector) AddRootComplex(cpuPorts []sim.Port) (switchID int)

AddRootComplex adds a new switch connecting CPU ports.

func (*Connector) AddSwitch

func (c *Connector) AddSwitch(baseSwitchID int) (switchID int)

AddSwitch adds a new switch connecting from an existing switch.

func (*Connector) CreateNetwork

func (c *Connector) CreateNetwork(name string)

CreateNetwork creates a network. This function should be called before creating root complexes.

func (*Connector) EstablishRoute

func (c *Connector) EstablishRoute()

EstablishRoute populates the routing tables in the network.

func (*Connector) PlugInDevice

func (c *Connector) PlugInDevice(baseSwitchID int, devicePorts []sim.Port)

PlugInDevice connects a series of ports to a switch.

func (*Connector) WithBandwidth

func (c *Connector) WithBandwidth(bytePerSecond uint64) *Connector

WithBandwidth sets the bandwidth of all the connections in the PCIe network.

func (*Connector) WithEngine

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

WithEngine sets the event-driven simulation engine that the PCIe connection uses.

func (*Connector) WithFrequency

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

WithFrequency sets the frequency used by the components in the connection. It does not have to be the exact frequency of the network. Instead, it is better to set as same frequency that the network interfaces work at.

func (*Connector) WithMonitor

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

WithMonitor sets the monitor that inspects the states of the component associated with the connection.

func (*Connector) WithSwitchLatency

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

WithSwitchLatency sets the extra latency on each switch before a switch can forward a flit.

func (*Connector) WithVersion

func (c *Connector) WithVersion(version int, width int) *Connector

WithVersion sets the version of the network.

func (*Connector) WithVisTracer

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

WithVisTracer sets the vis tracer that can be used to visualize the network.

Jump to

Keyboard shortcuts

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