messaging

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

Documentation

Overview

Package messaging and its subpackages provides infrastructures to simulate interconnects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	*sim.TickingComponent
	// contains filtered or unexported fields
}

Channel connects two ports and can deliver messages with configurable latencies.

func (*Channel) CanSend

func (c *Channel) CanSend(port sim.Port) bool

CanSend returns true if the channel can send a message from a port.

func (*Channel) NotifyAvailable

func (c *Channel) NotifyAvailable(now sim.VTimeInSec, port sim.Port)

NotifyAvailable is called by a port to notify that the connection can deliver to the port again.

func (*Channel) PlugIn

func (c *Channel) PlugIn(port sim.Port, sourceSideBufSize int)

PlugIn marks the port to be connected with the connection.

func (*Channel) Send

func (c *Channel) Send(msg sim.Msg) *sim.SendError

Send of a Channel schedules a DeliveryEvent immediately

func (*Channel) Tick

func (c *Channel) Tick(now sim.VTimeInSec) bool

Tick moves the messages in the channel forward and delivers messages when possible.

func (*Channel) Unplug

func (c *Channel) Unplug(port sim.Port)

Unplug removes the association between the port and the channel.

type ChannelBuilder

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

ChannelBuilder can build channels.

func MakeChannelBuilder

func MakeChannelBuilder() ChannelBuilder

MakeChannelBuilder creates a ChannelBuilder.

func (ChannelBuilder) Build

func (b ChannelBuilder) Build(name string) *Channel

Build creates a new channel with the given name.

func (ChannelBuilder) WithEngine

func (b ChannelBuilder) WithEngine(e sim.Engine) ChannelBuilder

WithEngine sets the engine of the channel to be built.

func (ChannelBuilder) WithFreq

func (b ChannelBuilder) WithFreq(f sim.Freq) ChannelBuilder

WithFreq sets the frequency of the channel to be built.

func (ChannelBuilder) WithPipelineParameters

func (b ChannelBuilder) WithPipelineParameters(
	numStage, cyclesPerStage, width int,
) ChannelBuilder

WithPipelineParameters sets the parameters of the channel internel pipeline.

type Flit

type Flit struct {
	sim.MsgMeta
	SeqID        int
	NumFlitInMsg int
	Msg          sim.Msg
	OutputBuf    sim.Buffer // The buffer to route to within a switch
}

Flit is the smallest trasferring unit on a network.

func (*Flit) Meta

func (f *Flit) Meta() *sim.MsgMeta

Meta returns the meta data associated with the Flit.

type FlitBuilder

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

FlitBuilder can build flits

func (FlitBuilder) Build

func (b FlitBuilder) Build() *Flit

Build creates a new flit.

func (FlitBuilder) WithDst

func (b FlitBuilder) WithDst(dst sim.Port) FlitBuilder

WithDst sets the dst of the request to send

func (FlitBuilder) WithMsg

func (b FlitBuilder) WithMsg(msg sim.Msg) FlitBuilder

WithMsg sets the msg of the flit to build.

func (FlitBuilder) WithNumFlitInMsg

func (b FlitBuilder) WithNumFlitInMsg(n int) FlitBuilder

WithNumFlitInMsg sets the NumFlitInMsg for of flit to build.

func (FlitBuilder) WithSendTime

func (b FlitBuilder) WithSendTime(t sim.VTimeInSec) FlitBuilder

WithSendTime sets the send time of the request to build

func (FlitBuilder) WithSeqID

func (b FlitBuilder) WithSeqID(i int) FlitBuilder

WithSeqID sets the SeqID of the Flit.

func (FlitBuilder) WithSrc

func (b FlitBuilder) WithSrc(src sim.Port) FlitBuilder

WithSrc sets the src of the request to send

type MsgBuffer

type MsgBuffer struct {
	Capacity int
	Buf      []sim.Msg
	// contains filtered or unexported fields
}

MsgBuffer is a buffer that can hold requests

type TrafficCounter

type TrafficCounter struct {
	TotalData uint64
}

A TrafficCounter counts number of bytes transferred over a connection

func (*TrafficCounter) Func

func (c *TrafficCounter) Func(ctx *sim.HookCtx)

Func adds the delivered traffic to the counter

type TransferEvent

type TransferEvent struct {
	*sim.EventBase
	// contains filtered or unexported fields
}

A TransferEvent is an event that marks that a message completes transfer.

func NewTransferEvent

func NewTransferEvent(
	time sim.VTimeInSec,
	handler sim.Handler,
	msg sim.Msg,
	vc int,
) *TransferEvent

NewTransferEvent creates a new TransferEvent.

Jump to

Keyboard shortcuts

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