CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::llhd Namespace Reference

Namespaces

namespace  deseq

Classes

class  WrapperType
 Common base of types wrapping a nested type. More...
struct  ConstProjectionRange
 Portion of a signal selected by a projection, with a statically known offset and width in bits. More...
struct  DynProjectionRange
 Portion of a signal selected by a projection with a dynamic index. More...

Typedefs

using ProjectionRange = std::variant<ConstProjectionRange, DynProjectionRange>
 Portion of the signal operand that is selected by a projection.

Functions

unsigned getLLHDTypeWidth (Type type)
Type getLLHDElementType (Type type)
void registerDestructableIntegerExternalModel (mlir::DialectRegistry &registry)
bool isDynamic (const ProjectionRange &range)
 Helper to check if a projection range is dynamic or not.
Type getStoredType (Value slot)
 Return the type stored in a signal or projection.
bool isProjection (const Operation *op)
 Check if an op is one of the supported projection types.
std::optional< ProjectionRange > getProjectionRange (Operation *op)
 Calculate a projection's range.
bool isProvablyDisjoint (const ProjectionRange &a, const ProjectionRange &b)
 Check whether two projections provably describe disjoint storage.
Operation * getRootSignal (Value sig)
 Given a signal or a projection, walk back the projection chain until you find the root signal declaration.
std::pair< Operation *, std::optional< ProjectionRange > > getRootSignalAndRange (Value sig)
 Given a signal or a projection, find the root signal declaration by traversing the projection chain.

Typedef Documentation

◆ ProjectionRange

Portion of the signal operand that is selected by a projection.

Definition at line 42 of file ProjectionUtils.h.

Function Documentation

◆ getLLHDElementType()

Type circt::llhd::getLLHDElementType ( Type type)

◆ getLLHDTypeWidth()

unsigned circt::llhd::getLLHDTypeWidth ( Type type)

◆ getProjectionRange()

std::optional< ProjectionRange > circt::llhd::getProjectionRange ( Operation * op)

Calculate a projection's range.

Returns nullopt if the range could not be calculated for this projection. Asserts if the provided Operation is not a (supported) projection.

Definition at line 27 of file ProjectionUtils.cpp.

References circt::hw::getBitWidth(), and getStoredType().

Referenced by getRootSignalAndRange().

◆ getRootSignal()

Operation * circt::llhd::getRootSignal ( Value sig)

Given a signal or a projection, walk back the projection chain until you find the root signal declaration.

A nullptr is returned if at any point of the use-def chain we encounter an Operation that is not a (supported) projection.

Definition at line 97 of file ProjectionUtils.cpp.

References isProjection().

◆ getRootSignalAndRange()

std::pair< Operation *, std::optional< ProjectionRange > > circt::llhd::getRootSignalAndRange ( Value sig)

Given a signal or a projection, find the root signal declaration by traversing the projection chain.

Optionally, if the projection chain is fully constant, return the portion of the original signal that this operation probes or drives. A null Operation is returned if the use-def chain does not bottom-out in a signal declaration, and a null range is returned if a dynamic index is found.

Definition at line 113 of file ProjectionUtils.cpp.

References circt::hw::getBitWidth(), getProjectionRange(), getStoredType(), isDynamic(), and isProjection().

◆ getStoredType()

Type circt::llhd::getStoredType ( Value slot)
inline

Return the type stored in a signal or projection.

Definition at line 50 of file ProjectionUtils.h.

Referenced by getProjectionRange(), and getRootSignalAndRange().

◆ isDynamic()

bool circt::llhd::isDynamic ( const ProjectionRange & range)
inline

Helper to check if a projection range is dynamic or not.

Definition at line 45 of file ProjectionUtils.h.

Referenced by getRootSignalAndRange().

◆ isProjection()

bool circt::llhd::isProjection ( const Operation * op)

Check if an op is one of the supported projection types.

Definition at line 20 of file ProjectionUtils.cpp.

Referenced by getRootSignal(), and getRootSignalAndRange().

◆ isProvablyDisjoint()

bool circt::llhd::isProvablyDisjoint ( const ProjectionRange & a,
const ProjectionRange & b )

Check whether two projections provably describe disjoint storage.

Definition at line 83 of file ProjectionUtils.cpp.

◆ registerDestructableIntegerExternalModel()

void circt::llhd::registerDestructableIntegerExternalModel ( mlir::DialectRegistry & registry)