CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::FirMemLowering Class Reference

FIR memory lowering helper. More...

#include <FirMemLowering.h>

Collaboration diagram for circt::FirMemLowering:

Public Types

using UniqueConfigs
 A vector of unique FirMemConfigs and all the FirMemOps that use it.
using MemoryConfig
 Information required to lower a single memory in a module.

Public Member Functions

 FirMemLowering (ModuleOp circuit)
UniqueConfigs collectMemories (ArrayRef< hw::HWModuleOp > modules)
 Groups memories by their kind from the whole design.
void lowerMemoriesInModule (hw::HWModuleOp module, ArrayRef< MemoryConfig > mems)
 Lowers a group of memories from the same module.
hw::HWModuleGeneratedOp createMemoryModule (FirMemConfig &mem, ArrayRef< seq::FirMemOp > memOps)
 Creates the generated module for a given configuration.

Private Member Functions

FirMemConfig collectMemory (seq::FirMemOp op)
 Determine the exact parametrization of the memory that should be generated for a given FirMemOp.
FlatSymbolRefAttr getOrCreateSchema ()
 Find the schema or create it if it does not exist.

Private Attributes

MLIRContext * context
ModuleOp circuit
SymbolCache symbolCache
Namespace globalNamespace
DenseMap< hw::HWModuleOp, size_t > moduleIndex
hw::HWGeneratorSchemaOp schemaOp

Detailed Description

FIR memory lowering helper.

Definition at line 65 of file FirMemLowering.h.

Member Typedef Documentation

◆ MemoryConfig

Initial value:
std::tuple<FirMemConfig *, hw::HWModuleGeneratedOp, seq::FirMemOp>

Information required to lower a single memory in a module.

Definition at line 72 of file FirMemLowering.h.

◆ UniqueConfigs

Initial value:

A vector of unique FirMemConfigs and all the FirMemOps that use it.

Definition at line 68 of file FirMemLowering.h.

Constructor & Destructor Documentation

◆ FirMemLowering()

FirMemLowering::FirMemLowering ( ModuleOp circuit)

Definition at line 44 of file FirMemLowering.cpp.

References circuit, context, globalNamespace, moduleIndex, and symbolCache.

Member Function Documentation

◆ collectMemories()

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 57 of file FirMemLowering.cpp.

References context.

Referenced by circt::SeqToSVPass::runOnOperation().

◆ collectMemory()

◆ createMemoryModule()

◆ getOrCreateSchema()

FlatSymbolRefAttr FirMemLowering::getOrCreateSchema ( )
private

Find the schema or create it if it does not exist.

Definition at line 138 of file FirMemLowering.cpp.

References circuit, and schemaOp.

Referenced by createMemoryModule().

◆ lowerMemoriesInModule()

void FirMemLowering::lowerMemoriesInModule ( hw::HWModuleOp module,
ArrayRef< MemoryConfig > mems )

Lowers a group of memories from the same module.

Replace all FirMemOps in an HW module with an instance of the corresponding generated module.

Definition at line 331 of file FirMemLowering.cpp.

References hw.ConstantOp::create().

Referenced by circt::SeqToSVPass::runOnOperation().

Member Data Documentation

◆ circuit

ModuleOp circt::FirMemLowering::circuit
private

Definition at line 104 of file FirMemLowering.h.

Referenced by FirMemLowering(), and getOrCreateSchema().

◆ context

MLIRContext* circt::FirMemLowering::context
private

Definition at line 103 of file FirMemLowering.h.

Referenced by collectMemories(), createMemoryModule(), and FirMemLowering().

◆ globalNamespace

Namespace circt::FirMemLowering::globalNamespace
private

Definition at line 107 of file FirMemLowering.h.

Referenced by createMemoryModule(), and FirMemLowering().

◆ moduleIndex

DenseMap<hw::HWModuleOp, size_t> circt::FirMemLowering::moduleIndex
private

Definition at line 109 of file FirMemLowering.h.

Referenced by createMemoryModule(), and FirMemLowering().

◆ schemaOp

hw::HWGeneratorSchemaOp circt::FirMemLowering::schemaOp
private

Definition at line 111 of file FirMemLowering.h.

Referenced by getOrCreateSchema().

◆ symbolCache

SymbolCache circt::FirMemLowering::symbolCache
private

Definition at line 106 of file FirMemLowering.h.

Referenced by FirMemLowering().


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