CIRCT  19.0.0git
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
circt::esi::detail::ESIHWBuilder Class Reference

Assist the lowering steps for conversions which need to create auxiliary IR. More...

#include <PassDetails.h>

Inheritance diagram for circt::esi::detail::ESIHWBuilder:
Inheritance graph
[legend]
Collaboration diagram for circt::esi::detail::ESIHWBuilder:
Collaboration graph
[legend]

Public Member Functions

 ESIHWBuilder (Operation *top)
 
ArrayAttr getStageParameterList (Attribute value)
 Return a parameter list for the stage module with the specified value. More...
 
hw::HWModuleExternOp declareStage (Operation *symTable, PipelineStageOp)
 Write an 'ExternModuleOp' to use a hand-coded SystemVerilog module. More...
 
hw::HWModuleExternOp declareCosimEndpointToHostModule (Operation *symTable)
 Write an 'ExternModuleOp' to use a hand-coded SystemVerilog module. More...
 
hw::HWModuleExternOp declareCosimEndpointFromHostModule (Operation *symTable)
 
sv::InterfaceOp getOrConstructInterface (ChannelType)
 Return the InterfaceType which corresponds to an ESI port type. More...
 
sv::InterfaceOp constructInterface (ChannelType)
 

Public Attributes

const StringAttr a
 
const StringAttr aValid
 
const StringAttr aReady
 
const StringAttr x
 
const StringAttr xValid
 
const StringAttr xReady
 
const StringAttr dataOutValid
 
const StringAttr dataOutReady
 
const StringAttr dataOut
 
const StringAttr dataInValid
 
const StringAttr dataInReady
 
const StringAttr dataIn
 
const StringAttr clk
 
const StringAttr rst
 
const StringAttr width
 

Static Public Attributes

static constexpr char dataStr [] = "data"
 
static constexpr char validStr [] = "valid"
 
static constexpr char readyStr [] = "ready"
 
static constexpr char sourceStr [] = "source"
 
static constexpr char sinkStr [] = "sink"
 

Private Member Functions

StringAttr constructInterfaceName (ChannelType)
 Construct a type-appropriate name for the interface, making sure it's not taken in the symbol table. More...
 
Type getClockType ()
 

Private Attributes

std::optional< hw::HWModuleExternOpdeclaredCosimEndpointToHostModule
 
std::optional< hw::HWModuleExternOpdeclaredCosimEndpointFromHostModule
 
llvm::DenseMap< Type, hw::HWModuleExternOpdeclaredStage
 
llvm::DenseMap< Type, sv::InterfaceOp > portTypeLookup
 

Detailed Description

Assist the lowering steps for conversions which need to create auxiliary IR.

Definition at line 65 of file PassDetails.h.

Constructor & Destructor Documentation

◆ ESIHWBuilder()

ESIHWBuilder::ESIHWBuilder ( Operation *  top)

Definition at line 50 of file ESIPasses.cpp.

Member Function Documentation

◆ constructInterface()

InterfaceOp ESIHWBuilder::constructInterface ( ChannelType  chan)

Definition at line 245 of file ESIPasses.cpp.

References constructInterfaceName(), dataStr, readyStr, sinkStr, sourceStr, and validStr.

Referenced by getOrConstructInterface().

◆ constructInterfaceName()

StringAttr ESIHWBuilder::constructInterfaceName ( ChannelType  port)
private

Construct a type-appropriate name for the interface, making sure it's not taken in the symbol table.

Definition at line 100 of file ESIPasses.cpp.

References constructUniqueSymbol().

Referenced by constructInterface().

◆ declareCosimEndpointFromHostModule()

HWModuleExternOp ESIHWBuilder::declareCosimEndpointFromHostModule ( Operation *  symTable)

◆ declareCosimEndpointToHostModule()

HWModuleExternOp ESIHWBuilder::declareCosimEndpointToHostModule ( Operation *  symTable)

Write an 'ExternModuleOp' to use a hand-coded SystemVerilog module.

Said module contains a bi-directional Cosimulation DPI interface with valid/ready semantics.

Definition at line 178 of file ESIPasses.cpp.

References clk, constructUniqueSymbol(), dataIn, dataInReady, dataInValid, declaredCosimEndpointToHostModule, circt::calyx::direction::get(), getClockType(), Input, Output, and rst.

◆ declareStage()

HWModuleExternOp ESIHWBuilder::declareStage ( Operation *  symTable,
PipelineStageOp  stage 
)

Write an 'ExternModuleOp' to use a hand-coded SystemVerilog module.

Said module implements pipeline stage, adding 1 cycle latency. This particular implementation is double-buffered and fully pipelines the reverse-flow ready signal.

Definition at line 139 of file ESIPasses.cpp.

References a, aReady, aValid, clk, constructUniqueSymbol(), declaredStage, getClockType(), getStageParameterList(), Input, Output, rst, x, xReady, and xValid.

◆ getClockType()

Type ESIHWBuilder::getClockType ( )
private

◆ getOrConstructInterface()

InterfaceOp ESIHWBuilder::getOrConstructInterface ( ChannelType  t)

Return the InterfaceType which corresponds to an ESI port type.

If it doesn't exist in the cache, build the InterfaceOp and the corresponding type.

Definition at line 236 of file ESIPasses.cpp.

References constructInterface(), and portTypeLookup.

◆ getStageParameterList()

ArrayAttr ESIHWBuilder::getStageParameterList ( Attribute  value)

Return a parameter list for the stage module with the specified value.

Definition at line 129 of file ESIPasses.cpp.

References circt::calyx::direction::get(), and width.

Referenced by declareStage().

Member Data Documentation

◆ a

const StringAttr circt::esi::detail::ESIHWBuilder::a

Definition at line 78 of file PassDetails.h.

Referenced by declareStage().

◆ aReady

const StringAttr circt::esi::detail::ESIHWBuilder::aReady

Definition at line 78 of file PassDetails.h.

Referenced by declareStage().

◆ aValid

const StringAttr circt::esi::detail::ESIHWBuilder::aValid

Definition at line 78 of file PassDetails.h.

Referenced by declareStage().

◆ clk

const StringAttr circt::esi::detail::ESIHWBuilder::clk

◆ dataIn

const StringAttr circt::esi::detail::ESIHWBuilder::dataIn

Definition at line 80 of file PassDetails.h.

Referenced by declareCosimEndpointToHostModule().

◆ dataInReady

const StringAttr circt::esi::detail::ESIHWBuilder::dataInReady

Definition at line 80 of file PassDetails.h.

Referenced by declareCosimEndpointToHostModule().

◆ dataInValid

const StringAttr circt::esi::detail::ESIHWBuilder::dataInValid

Definition at line 79 of file PassDetails.h.

Referenced by declareCosimEndpointToHostModule().

◆ dataOut

const StringAttr circt::esi::detail::ESIHWBuilder::dataOut

Definition at line 79 of file PassDetails.h.

Referenced by declareCosimEndpointFromHostModule().

◆ dataOutReady

const StringAttr circt::esi::detail::ESIHWBuilder::dataOutReady

Definition at line 79 of file PassDetails.h.

Referenced by declareCosimEndpointFromHostModule().

◆ dataOutValid

const StringAttr circt::esi::detail::ESIHWBuilder::dataOutValid

Definition at line 79 of file PassDetails.h.

Referenced by declareCosimEndpointFromHostModule().

◆ dataStr

constexpr char ESIHWBuilder::dataStr = "data"
staticconstexpr

Definition at line 85 of file PassDetails.h.

Referenced by constructInterface().

◆ declaredCosimEndpointFromHostModule

std::optional<hw::HWModuleExternOp> circt::esi::detail::ESIHWBuilder::declaredCosimEndpointFromHostModule
private

Definition at line 97 of file PassDetails.h.

Referenced by declareCosimEndpointFromHostModule().

◆ declaredCosimEndpointToHostModule

std::optional<hw::HWModuleExternOp> circt::esi::detail::ESIHWBuilder::declaredCosimEndpointToHostModule
private

Definition at line 96 of file PassDetails.h.

Referenced by declareCosimEndpointToHostModule().

◆ declaredStage

llvm::DenseMap<Type, hw::HWModuleExternOp> circt::esi::detail::ESIHWBuilder::declaredStage
private

Definition at line 98 of file PassDetails.h.

Referenced by declareStage().

◆ portTypeLookup

llvm::DenseMap<Type, sv::InterfaceOp> circt::esi::detail::ESIHWBuilder::portTypeLookup
private

Definition at line 99 of file PassDetails.h.

Referenced by getOrConstructInterface().

◆ readyStr

constexpr char ESIHWBuilder::readyStr = "ready"
static

Definition at line 86 of file PassDetails.h.

Referenced by constructInterface().

◆ rst

const StringAttr circt::esi::detail::ESIHWBuilder::rst

◆ sinkStr

constexpr char ESIHWBuilder::sinkStr = "sink"
static

Definition at line 87 of file PassDetails.h.

Referenced by constructInterface().

◆ sourceStr

constexpr char ESIHWBuilder::sourceStr = "source"
static

Definition at line 86 of file PassDetails.h.

Referenced by constructInterface().

◆ validStr

constexpr char ESIHWBuilder::validStr = "valid"
static

Definition at line 85 of file PassDetails.h.

Referenced by constructInterface().

◆ width

const StringAttr circt::esi::detail::ESIHWBuilder::width

Definition at line 82 of file PassDetails.h.

Referenced by getStageParameterList().

◆ x

const StringAttr circt::esi::detail::ESIHWBuilder::x

Definition at line 78 of file PassDetails.h.

Referenced by declareStage().

◆ xReady

const StringAttr circt::esi::detail::ESIHWBuilder::xReady

Definition at line 78 of file PassDetails.h.

Referenced by declareStage().

◆ xValid

const StringAttr circt::esi::detail::ESIHWBuilder::xValid

Definition at line 78 of file PassDetails.h.

Referenced by declareStage().


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