CIRCT  20.0.0git
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
circt::FirMemLowering Class Reference

FIR memory lowering helper. More...

#include <FirMemLowering.h>

Collaboration diagram for circt::FirMemLowering:
Collaboration graph
[legend]

Public Types

using UniqueConfigs = llvm::MapVector< FirMemConfig, SmallVector< seq::FirMemOp, 1 > >
 A vector of unique FirMemConfigs and all the FirMemOps 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
 

Detailed Description

FIR memory lowering helper.

Definition at line 66 of file FirMemLowering.h.

Member Typedef Documentation

◆ MemoryConfig

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.

◆ UniqueConfigs

using circt::FirMemLowering::UniqueConfigs = llvm::MapVector<FirMemConfig, SmallVector<seq::FirMemOp, 1> >

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

Definition at line 69 of file FirMemLowering.h.

Constructor & Destructor Documentation

◆ FirMemLowering()

FirMemLowering::FirMemLowering ( ModuleOp  circuit)

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

References context.

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

◆ collectMemory()

FirMemConfig FirMemLowering::collectMemory ( seq::FirMemOp  op)
private

◆ createMemoryModule()

HWModuleGeneratedOp FirMemLowering::createMemoryModule ( FirMemConfig mem,
ArrayRef< seq::FirMemOp >  memOps 
)

◆ getOrCreateSchema()

FlatSymbolRefAttr FirMemLowering::getOrCreateSchema ( )
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().

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

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

Member Data Documentation

◆ circuit

ModuleOp circt::FirMemLowering::circuit
private

Definition at line 105 of file FirMemLowering.h.

Referenced by FirMemLowering(), and getOrCreateSchema().

◆ context

MLIRContext* circt::FirMemLowering::context
private

Definition at line 104 of file FirMemLowering.h.

Referenced by collectMemories(), and createMemoryModule().

◆ globalNamespace

Namespace circt::FirMemLowering::globalNamespace
private

Definition at line 108 of file FirMemLowering.h.

Referenced by createMemoryModule(), and FirMemLowering().

◆ moduleIndex

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

Definition at line 110 of file FirMemLowering.h.

Referenced by createMemoryModule(), and FirMemLowering().

◆ schemaOp

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

Definition at line 112 of file FirMemLowering.h.

Referenced by getOrCreateSchema().

◆ symbolCache

SymbolCache circt::FirMemLowering::symbolCache
private

Definition at line 107 of file FirMemLowering.h.

Referenced by FirMemLowering().


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