pipelining

package
v4.0.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package pipelining provides a pipeline definition.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

A Builder can build pipelines.

func MakeBuilder

func MakeBuilder() Builder

MakeBuilder creates a default builder

func (Builder) Build

func (b Builder) Build(name string) Pipeline

Build builds a pipeline.

func (Builder) WithCyclePerStage

func (b Builder) WithCyclePerStage(n int) Builder

WithCyclePerStage sets the the number of cycles that each element needs to stage in each stage.

func (Builder) WithNumStage

func (b Builder) WithNumStage(n int) Builder

WithNumStage sets the number of pipeline stages

func (Builder) WithPipelineWidth

func (b Builder) WithPipelineWidth(n int) Builder

WithPipelineWidth sets the number of lanes in the pipeline. If width=4, 4 elements can be in the same stage at the same time.

func (Builder) WithPostPipelineBuffer

func (b Builder) WithPostPipelineBuffer(buf sim.Buffer) Builder

WithPostPipelineBuffer sets the buffer that the elements can be pushed to after passing through the pipeline.

type Pipeline

type Pipeline interface {
	tracing.NamedHookable

	// Tick moves elements in the pipeline forward.
	Tick() (madeProgress bool)

	// CanAccept checks if the pipeline can accept a new element.
	CanAccept() bool

	// Accept adds an element to the pipeline. If the first pipeline stage is
	// currently occupied, this function panics.
	Accept(elem PipelineItem)

	// Clear discards all the items that are currently in the pipeline.
	Clear()
}

Pipeline allows simulation designers to define pipeline structures.

func NewPipeline deprecated

func NewPipeline(
	name string,
	numStage, cyclePerStage int,
	postPipelineBuf sim.Buffer,
) Pipeline

NewPipeline creates a default pipeline

Deprecated: use PipelineBuilder instead.

type PipelineItem

type PipelineItem interface {
	TaskID() string
}

PipelineItem is an item that can pass through a pipeline.

Jump to

Keyboard shortcuts

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