org

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package org defines the DRAM organization related sub-component definitions, such as Channels and Banks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bank

type Bank interface {
	tracing.NamedHookable

	GetReadyCommand(
		now sim.VTimeInSec,
		cmd *signal.Command,
	) *signal.Command
	StartCommand(now sim.VTimeInSec, cmd *signal.Command)
	UpdateTiming(cmdKind signal.CommandKind, cycleNeeded int)
	Tick(now sim.VTimeInSec) bool
}

A Bank is a DRAM Bank. It contains a number of rows and columns.

type BankImpl

type BankImpl struct {
	sim.HookableBase
	BankName string

	CmdCycles map[signal.CommandKind]int
	// contains filtered or unexported fields
}

BankImpl provides a basic implementation of a bank.

func NewBankImpl

func NewBankImpl(name string) *BankImpl

NewBankImpl creates a new BankImpl.

func (*BankImpl) GetReadyCommand

func (b *BankImpl) GetReadyCommand(
	now sim.VTimeInSec,
	cmd *signal.Command,
) *signal.Command

GetReadyCommand returns the next command is ready to be issued.

func (*BankImpl) Name

func (b *BankImpl) Name() string

Name returns the name of the Bank.

func (*BankImpl) StartCommand

func (b *BankImpl) StartCommand(now sim.VTimeInSec, cmd *signal.Command)

StartCommand starts a new command in the Bank.

func (*BankImpl) Tick

func (b *BankImpl) Tick(now sim.VTimeInSec) (madeProgress bool)

Tick updates the internal states of the bank.

func (*BankImpl) UpdateTiming

func (b *BankImpl) UpdateTiming(cmdKind signal.CommandKind, cycleNeeded int)

UpdateTiming updates timing related states of the bank.

type BankState

type BankState int

BankState represents the current state of a bank.

const (
	BankStateOpen BankState = iota
	BankStateClosed
	BankStateSRef
	BankStatePD
	BankStateInvalid
)

A list of possible bank states.

type Banks

type Banks [][][]Bank

Banks is indexed by rank, bank-group, bank.

func MakeBanks

func MakeBanks(numRank, numBankGroup, numBank uint64) Banks

MakeBanks create all the banks.

func (Banks) GetBank

func (b Banks) GetBank(rank, bankGroup, bank uint64) Bank

GetBank returns a specific bank identified by the rank index, bank-group index, and the bank index.

func (Banks) GetSize

func (b Banks) GetSize() (rank, bankGroup, bank uint64)

GetSize returns the number of ranks, bank-groups, and banks.

type Channel

type Channel interface {
	GetReadyCommand(
		now sim.VTimeInSec,
		cmd *signal.Command,
	) *signal.Command

	StartCommand(
		now sim.VTimeInSec,
		cmd *signal.Command,
	)

	UpdateTiming(
		now sim.VTimeInSec,
		cmd *signal.Command,
	)

	Tick(now sim.VTimeInSec) (madeProgress bool)
}

A Channel is a group of ranks.

type ChannelImpl

type ChannelImpl struct {
	Banks  Banks
	Timing Timing
}

ChannelImpl implements a Channel.

func (*ChannelImpl) GetReadyCommand

func (cs *ChannelImpl) GetReadyCommand(
	now sim.VTimeInSec,
	cmd *signal.Command,
) *signal.Command

GetReadyCommand returns the command that is ready to start in the channel.

func (*ChannelImpl) StartCommand

func (cs *ChannelImpl) StartCommand(now sim.VTimeInSec, cmd *signal.Command)

StartCommand starts a command in a bank.

func (*ChannelImpl) Tick

func (cs *ChannelImpl) Tick(now sim.VTimeInSec) (madeProgress bool)

Tick updates the internal states of the channel.

func (*ChannelImpl) UpdateTiming

func (cs *ChannelImpl) UpdateTiming(now sim.VTimeInSec, cmd *signal.Command)

UpdateTiming updates the timing-related states of the banks.

type TimeTable

type TimeTable [][]TimeTableEntry

TimeTable is a table that records the minimum number of cycles between any two types of DRAM commands.

func MakeTimeTable

func MakeTimeTable() TimeTable

MakeTimeTable creates a new TimeTable.

type TimeTableEntry

type TimeTableEntry struct {
	NextCmdKind       signal.CommandKind
	MinCycleInBetween int
}

TimeTableEntry is an entry in the TimeTable.

type Timing

type Timing struct {
	SameBank              TimeTable
	OtherBanksInBankGroup TimeTable
	SameRank              TimeTable
	OtherRanks            TimeTable
}

Timing records all the timing-related parameters for a DRAM model.

Jump to

Keyboard shortcuts

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