CIRCT  19.0.0git
Public Member Functions | Public Attributes | Private Attributes | List of all members
circt::llhd::sim::UpdateQueue Class Reference

This is equivalent to and std::priorityQueue<Slot> ordered using the greater operator, which adds an insertion method to add changes to a slot. More...

#include <State.h>

Inheritance diagram for circt::llhd::sim::UpdateQueue:
Inheritance graph
[legend]
Collaboration diagram for circt::llhd::sim::UpdateQueue:
Collaboration graph
[legend]

Public Member Functions

void insertOrUpdate (Time time, int index, int bitOffset, uint8_t *bytes, unsigned width)
 Check wheter a slot for the given time already exists. More...
 
void insertOrUpdate (Time time, unsigned inst)
 Check wheter a slot for the given time already exists. More...
 
SlotgetOrCreateSlot (Time time)
 Return a reference to a slot with the given timestamp. More...
 
const Slottop ()
 Get a reference to the current top of the queue (the earliest event available). More...
 
void pop ()
 Pop the current top of the queue. More...
 

Public Attributes

unsigned events = 0
 

Private Attributes

unsigned topSlot = 0
 
llvm::SmallVector< unsigned, 4 > unused
 

Detailed Description

This is equivalent to and std::priorityQueue<Slot> ordered using the greater operator, which adds an insertion method to add changes to a slot.

Definition at line 237 of file State.h.

Member Function Documentation

◆ getOrCreateSlot()

Slot & UpdateQueue::getOrCreateSlot ( Time  time)

Return a reference to a slot with the given timestamp.

If such a slot already exists, a reference to it will be returned. Otherwise a reference to a fresh slot is returned.

Definition at line 113 of file State.cpp.

References circt::llhd::sim::Time::time, and circt::llhd::sim::Slot::unused.

◆ insertOrUpdate() [1/2]

void UpdateQueue::insertOrUpdate ( Time  time,
int  index,
int  bitOffset,
uint8_t *  bytes,
unsigned  width 
)

Check wheter a slot for the given time already exists.

If that's the case, add the new change to it, else create a new slot and push it to the queue.

Definition at line 102 of file State.cpp.

References width.

Referenced by driveSignal().

◆ insertOrUpdate() [2/2]

void UpdateQueue::insertOrUpdate ( Time  time,
unsigned  inst 
)

Check wheter a slot for the given time already exists.

If that's the case, add the scheduled wakeup to it, else create a new slot and push it to the queue.

Definition at line 108 of file State.cpp.

◆ pop()

void UpdateQueue::pop ( )

Pop the current top of the queue.

This marks the current top slot as unused and resets its internal structures such that they can be reused.

Definition at line 171 of file State.cpp.

◆ top()

const Slot & UpdateQueue::top ( )

Get a reference to the current top of the queue (the earliest event available).

Definition at line 161 of file State.cpp.

References assert().

Member Data Documentation

◆ events

unsigned circt::llhd::sim::UpdateQueue::events = 0

Definition at line 265 of file State.h.

◆ topSlot

unsigned circt::llhd::sim::UpdateQueue::topSlot = 0
private

Definition at line 238 of file State.h.

◆ unused

llvm::SmallVector<unsigned, 4> circt::llhd::sim::UpdateQueue::unused
private

Definition at line 239 of file State.h.


The documentation for this class was generated from the following files: