CIRCT
20.0.0git
|
FIR memory lowering helper. More...
#include <FirMemLowering.h>
Public Types | |
using | UniqueConfigs = llvm::MapVector< FirMemConfig, SmallVector< seq::FirMemOp, 1 > > |
A vector of unique FirMemConfig s and all the FirMemOp s that use it. More... | |
using | MemoryConfig = std::tuple< FirMemConfig *, hw::HWModuleGeneratedOp, seq::FirMemOp > |
Information required to lower a single memory in a module. More... | |
Public Member Functions | |
FirMemLowering (ModuleOp circuit) | |
UniqueConfigs | collectMemories (ArrayRef< hw::HWModuleOp > modules) |
Groups memories by their kind from the whole design. More... | |
void | lowerMemoriesInModule (hw::HWModuleOp module, ArrayRef< MemoryConfig > mems) |
Lowers a group of memories from the same module. More... | |
hw::HWModuleGeneratedOp | createMemoryModule (FirMemConfig &mem, ArrayRef< seq::FirMemOp > memOps) |
Creates the generated module for a given configuration. More... | |
Private Member Functions | |
FirMemConfig | collectMemory (seq::FirMemOp op) |
Determine the exact parametrization of the memory that should be generated for a given FirMemOp . More... | |
FlatSymbolRefAttr | getOrCreateSchema () |
Find the schema or create it if it does not exist. More... | |
Private Attributes | |
MLIRContext * | context |
ModuleOp | circuit |
SymbolCache | symbolCache |
Namespace | globalNamespace |
DenseMap< hw::HWModuleOp, size_t > | moduleIndex |
hw::HWGeneratorSchemaOp | schemaOp |
FIR memory lowering helper.
Definition at line 66 of file FirMemLowering.h.
using circt::FirMemLowering::MemoryConfig = std::tuple<FirMemConfig *, hw::HWModuleGeneratedOp, seq::FirMemOp> |
Information required to lower a single memory in a module.
Definition at line 73 of file FirMemLowering.h.
using circt::FirMemLowering::UniqueConfigs = llvm::MapVector<FirMemConfig, SmallVector<seq::FirMemOp, 1> > |
A vector of unique FirMemConfig
s and all the FirMemOp
s that use it.
Definition at line 69 of file FirMemLowering.h.
FirMemLowering::FirMemLowering | ( | ModuleOp | circuit | ) |
Definition at line 21 of file FirMemLowering.cpp.
References circt::Namespace::add(), circt::SymbolCacheBase::addDefinitions(), circuit, globalNamespace, moduleIndex, and symbolCache.
FirMemLowering::UniqueConfigs FirMemLowering::collectMemories | ( | ArrayRef< hw::HWModuleOp > | modules | ) |
Groups memories by their kind from the whole design.
Collect the memories in a list of HW modules.
Definition at line 34 of file FirMemLowering.cpp.
References context.
Referenced by circt::SeqToSVPass::runOnOperation().
|
private |
Determine the exact parametrization of the memory that should be generated for a given FirMemOp
.
Definition at line 72 of file FirMemLowering.cpp.
References circt::FirMemConfig::dataWidth, circt::FirMemConfig::depth, circt::FirMemConfig::initFilename, circt::FirMemConfig::initIsBinary, circt::FirMemConfig::initIsInline, lookThroughWires(), circt::FirMemConfig::maskBits, circt::FirMemConfig::numReadPorts, circt::FirMemConfig::numReadWritePorts, circt::FirMemConfig::numWritePorts, circt::FirMemConfig::outputFile, circt::FirMemConfig::prefix, circt::FirMemConfig::readLatency, circt::FirMemConfig::readUnderWrite, circt::FirMemConfig::writeClockIDs, circt::FirMemConfig::writeLatency, and circt::FirMemConfig::writeUnderWrite.
HWModuleGeneratedOp FirMemLowering::createMemoryModule | ( | FirMemConfig & | mem, |
ArrayRef< seq::FirMemOp > | memOps | ||
) |
Creates the generated module for a given configuration.
Create the HWModuleGeneratedOp
for a single memory parametrization.
Definition at line 144 of file FirMemLowering.cpp.
References context, circt::FirMemConfig::dataWidth, circt::FirMemConfig::depth, circt::calyx::direction::get(), getOrCreateSchema(), globalNamespace, circt::FirMemConfig::initFilename, circt::FirMemConfig::initIsBinary, circt::FirMemConfig::initIsInline, Input, circt::FirMemConfig::maskBits, moduleIndex, circt::Namespace::newName(), circt::FirMemConfig::numReadPorts, circt::FirMemConfig::numReadWritePorts, circt::FirMemConfig::numWritePorts, Output, circt::FirMemConfig::outputFile, circt::FirMemConfig::prefix, circt::FirMemConfig::readLatency, circt::FirMemConfig::readUnderWrite, toVector(), circt::FirMemConfig::writeClockIDs, circt::FirMemConfig::writeLatency, and circt::FirMemConfig::writeUnderWrite.
Referenced by circt::SeqToSVPass::runOnOperation().
|
private |
Find the schema or create it if it does not exist.
Definition at line 115 of file FirMemLowering.cpp.
References circuit, circt::calyx::direction::get(), and schemaOp.
Referenced by createMemoryModule().
void FirMemLowering::lowerMemoriesInModule | ( | hw::HWModuleOp | module, |
ArrayRef< MemoryConfig > | mems | ||
) |
Lowers a group of memories from the same module.
Replace all FirMemOp
s in an HW module with an instance of the corresponding generated module.
Definition at line 305 of file FirMemLowering.cpp.
References width.
Referenced by circt::SeqToSVPass::runOnOperation().
|
private |
Definition at line 105 of file FirMemLowering.h.
Referenced by FirMemLowering(), and getOrCreateSchema().
|
private |
Definition at line 104 of file FirMemLowering.h.
Referenced by collectMemories(), and createMemoryModule().
|
private |
Definition at line 108 of file FirMemLowering.h.
Referenced by createMemoryModule(), and FirMemLowering().
|
private |
Definition at line 110 of file FirMemLowering.h.
Referenced by createMemoryModule(), and FirMemLowering().
|
private |
Definition at line 112 of file FirMemLowering.h.
Referenced by getOrCreateSchema().
|
private |
Definition at line 107 of file FirMemLowering.h.
Referenced by FirMemLowering().