CGRAOmp  0.1
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
CGRAOmp::CGRAModel Class Reference

A base class of CGRA model for DFG extraction. More...

#include <CGRAModel.hpp>

Inheritance diagram for CGRAOmp::CGRAModel:
CGRAOmp::DecoupledCGRA CGRAOmp::TMCGRA

Public Types

enum  CGRACategory { CGRACategory::TimeMultiplexed, CGRACategory::Decoupled }
 a category of the CGRA model More...
 
enum  ConditionalStyle { ConditionalStyle::No, ConditionalStyle::MuxInst, ConditionalStyle::TriState }
 Ability to handle conditional execution (i.e., if-else part) More...
 
enum  InterLoopDep { InterLoopDep::No, InterLoopDep::Generic, InterLoopDep::BackwardInst }
 How to describe the inter-loop dependecy. More...
 

Public Member Functions

 CGRAModel (StringRef filename, CGRACategory category, ConditionalStyle cond, InterLoopDep inter_loop_dep)
 Construct a new CGRAModel object. More...
 
 CGRAModel ()=delete
 
 CGRAModel (const CGRAModel &)=default
 Copy constructor. More...
 
 CGRAModel (CGRAModel &&)=default
 Move constructor. More...
 
Error addSupportedInst (StringRef opcode)
 add a supported generic insturction for the CGRA More...
 
void addCustomInst (StringRef opcode, ModuleAnalysisManager &MAM)
 add a custom insturction for the CGRA More...
 
Error add_map_entry (StringRef opcode, MapCondition *map_cond)
 add a instruction mapping entry to the CGRA model More...
 
InstMapEntryisSupported (Instruction *I)
 checking whether the instruction is supported by the CGRA or not. More...
 
template<typename DerivedT >
DerivedT * asDerived ()
 an interface to down cast to derived classes More...
 
CGRACategory getKind () const
 Get the category of the CGRA. More...
 
InterLoopDep getInterLoopDepType () const
 Get the Inter Loop Dependency avility. More...
 

Static Public Attributes

static StringMap< CGRACategoryCategoryMap
 Map category string to CGRACategory. More...
 
static StringMap< ConditionalStyleCondStyleMap
 Map category string to ConditionalStyle. More...
 
static StringMap< InterLoopDepInterLoopDepMap
 Map category string to InterLoopDep. More...
 

Protected Attributes

StringRef filename
 
ConditionalStyle cond
 
InterLoopDep inter_loop_dep
 
CGRACategory category
 
InstMap inst_map
 

Detailed Description

A base class of CGRA model for DFG extraction.

Member Enumeration Documentation

◆ CGRACategory

a category of the CGRA model

Enumerator
TimeMultiplexed 

time-multiplexed CGRAs

Decoupled 

A CGRA decoupling memory access & computation.

◆ ConditionalStyle

Ability to handle conditional execution (i.e., if-else part)

Enumerator
No 

conditional is not allowd

MuxInst 

conditional is handled by MUX operation

TriState 

conditional is handled by TriState ALU

◆ InterLoopDep

How to describe the inter-loop dependecy.

Enumerator
No 

loop with inter-loop dependency is not allowed

Generic 

Generating a DFG with back-edge as inter-loop dependency.

BackwardInst 

Replacing the inter-loop dependency with backward operation node.

Constructor & Destructor Documentation

◆ CGRAModel() [1/4]

CGRAOmp::CGRAModel::CGRAModel ( StringRef  filename,
CGRACategory  category,
ConditionalStyle  cond,
InterLoopDep  inter_loop_dep 
)
inlineexplicit

Construct a new CGRAModel object.

Parameters
filenamefilename of the configration file
categorycategory of the CGRA
condconditional style of the CGRA
inter_loop_depability to handle inter loop dependency

◆ CGRAModel() [2/4]

CGRAOmp::CGRAModel::CGRAModel ( )
delete

◆ CGRAModel() [3/4]

CGRAOmp::CGRAModel::CGRAModel ( const CGRAModel )
default

Copy constructor.

◆ CGRAModel() [4/4]

CGRAOmp::CGRAModel::CGRAModel ( CGRAModel &&  )
default

Move constructor.

Member Function Documentation

◆ add_map_entry()

Error CGRAModel::add_map_entry ( StringRef  opcode,
MapCondition map_cond 
)

add a instruction mapping entry to the CGRA model

Parameters
opcodeopcode of the instruction to be replaced
map_conda mapping condition
Returns
Error is returned if the opcode is for unsupported instruction

◆ addCustomInst()

void CGRAModel::addCustomInst ( StringRef  opcode,
ModuleAnalysisManager &  MAM 
)

add a custom insturction for the CGRA

Parameters
opcodeopcode of the instruction
  • if it is already added instruction, this function does nothing
MAMModuleAnalysisManager

◆ addSupportedInst()

Error CGRAModel::addSupportedInst ( StringRef  opcode)

add a supported generic insturction for the CGRA

Parameters
opcodeopcode of the instruction
  • if it is already added instruction, this function does nothing
Returns
Error is returned if unknown opcode is specified

◆ asDerived()

template<typename DerivedT >
DerivedT* CGRAOmp::CGRAModel::asDerived ( )
inline

an interface to down cast to derived classes

Template Parameters
DerivedTderived class named
Returns
DerivedT* casted pointer to the derived class

◆ getInterLoopDepType()

InterLoopDep CGRAOmp::CGRAModel::getInterLoopDepType ( ) const
inline

Get the Inter Loop Dependency avility.

Returns
InterLoopDep

◆ getKind()

CGRACategory CGRAOmp::CGRAModel::getKind ( ) const
inline

Get the category of the CGRA.

Returns
CGRACategory

◆ isSupported()

InstMapEntry * CGRAModel::isSupported ( Instruction *  I)

checking whether the instruction is supported by the CGRA or not.

Parameters
Ian instruction
Returns
a pointer of InstMapEntry is return if it is supported. Otherwise, it return nullptr.

Member Data Documentation

◆ category

CGRACategory CGRAOmp::CGRAModel::category
protected

◆ CategoryMap

StringMap< CGRAModel::CGRACategory > CGRAModel::CategoryMap
static

Map category string to CGRACategory.

◆ cond

ConditionalStyle CGRAOmp::CGRAModel::cond
protected

◆ CondStyleMap

StringMap< CGRAModel::ConditionalStyle > CGRAModel::CondStyleMap
static

Map category string to ConditionalStyle.

◆ filename

StringRef CGRAOmp::CGRAModel::filename
protected

◆ inst_map

InstMap CGRAOmp::CGRAModel::inst_map
protected

◆ inter_loop_dep

InterLoopDep CGRAOmp::CGRAModel::inter_loop_dep
protected

◆ InterLoopDepMap

StringMap< CGRAModel::InterLoopDep > CGRAModel::InterLoopDepMap
static

Map category string to InterLoopDep.


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