CIRCT 21.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
esi::HWModule Class Reference

Represents either the top level or an instance of a hardware module. More...

#include <Design.h>

Inheritance diagram for esi::HWModule:
Inheritance graph
[legend]
Collaboration diagram for esi::HWModule:
Collaboration graph
[legend]

Public Member Functions

virtual ~HWModule ()=default
 
std::optional< ModuleInfogetInfo () const
 Access the module's metadata, if any.
 
std::vector< const Instance * > getChildrenOrdered () const
 Get a vector of the module's children in a deterministic order.
 
const std::map< AppID, Instance * > & getChildren () const
 Access the module's children by ID.
 
std::vector< std::reference_wrapper< BundlePort > > getPortsOrdered () const
 Get the module's ports in a deterministic order.
 
const std::map< AppID, BundlePort & > & getPorts () const
 Access the module's ports by ID.
 
const std::vector< services::Service * > & getServices () const
 Access the services provided by this module.
 
bool poll ()
 Master poll method.
 
const HWModuleresolveInst (const AppIDPath &path, AppIDPath &lastLookup) const
 Attempt to resolve a path to a module instance.
 
BundlePortresolvePort (const AppIDPath &path, AppIDPath &lastLookup) const
 Attempt to resolve a path to a port.
 

Protected Member Functions

 HWModule (std::optional< ModuleInfo > info, std::vector< std::unique_ptr< Instance > > children, std::vector< services::Service * > services, std::vector< std::unique_ptr< BundlePort > > &ports)
 

Protected Attributes

const std::optional< ModuleInfoinfo
 
const std::vector< std::unique_ptr< Instance > > children
 
const std::map< AppID, Instance * > childIndex
 
const std::vector< services::Service * > services
 
const std::vector< std::unique_ptr< BundlePort > > ports
 
const std::map< AppID, BundlePort & > portIndex
 

Detailed Description

Represents either the top level or an instance of a hardware module.

Definition at line 47 of file Design.h.

Constructor & Destructor Documentation

◆ HWModule()

esi::HWModule::HWModule ( std::optional< ModuleInfo info,
std::vector< std::unique_ptr< Instance > >  children,
std::vector< services::Service * >  services,
std::vector< std::unique_ptr< BundlePort > > &  ports 
)
protected

Definition at line 42 of file Design.cpp.

◆ ~HWModule()

virtual esi::HWModule::~HWModule ( )
virtualdefault

Member Function Documentation

◆ getChildren()

const std::map< AppID, Instance * > & esi::HWModule::getChildren ( ) const
inline

Access the module's children by ID.

Definition at line 67 of file Design.h.

References childIndex.

Referenced by hostmemTest(), and PYBIND11_MODULE().

◆ getChildrenOrdered()

std::vector< const Instance * > esi::HWModule::getChildrenOrdered ( ) const
inline

Get a vector of the module's children in a deterministic order.

Definition at line 60 of file Design.h.

References children.

Referenced by printInstance().

◆ getInfo()

std::optional< ModuleInfo > esi::HWModule::getInfo ( ) const
inline

Access the module's metadata, if any.

Definition at line 58 of file Design.h.

References info.

Referenced by PYBIND11_MODULE().

◆ getPorts()

const std::map< AppID, BundlePort & > & esi::HWModule::getPorts ( ) const
inline

Access the module's ports by ID.

Definition at line 76 of file Design.h.

References portIndex.

Referenced by PYBIND11_MODULE(), registerCallbacks(), and resolvePort().

◆ getPortsOrdered()

std::vector< std::reference_wrapper< BundlePort > > esi::HWModule::getPortsOrdered ( ) const
inline

Get the module's ports in a deterministic order.

Definition at line 69 of file Design.h.

References ports.

Referenced by printInstance().

◆ getServices()

const std::vector< services::Service * > & esi::HWModule::getServices ( ) const
inline

Access the services provided by this module.

Definition at line 78 of file Design.h.

References services.

Referenced by PYBIND11_MODULE().

◆ poll()

bool esi::HWModule::poll ( )

Master poll method.

Calls the poll method on all locally owned ports and the master poll method on all of the children. Returns true if any of the poll calls returns true.

Definition at line 50 of file Design.cpp.

References children, and ports.

◆ resolveInst()

const HWModule * esi::HWModule::resolveInst ( const AppIDPath path,
AppIDPath lastLookup 
) const

Attempt to resolve a path to a module instance.

If a child is not found, return null and set lastLookup to the path which wasn't found.

Definition at line 59 of file Design.cpp.

References childIndex.

Referenced by resolvePort().

◆ resolvePort()

BundlePort * esi::HWModule::resolvePort ( const AppIDPath path,
AppIDPath lastLookup 
) const

Attempt to resolve a path to a port.

If a child or port is not found, return null and set lastLookup to the path which wasn't found.

Definition at line 72 of file Design.cpp.

References getPorts(), ports, and resolveInst().

Referenced by bandwidthReadTest(), bandwidthWriteTest(), dmaReadTest(), and dmaWriteTest().

Member Data Documentation

◆ childIndex

const std::map<AppID, Instance *> esi::HWModule::childIndex
protected

Definition at line 99 of file Design.h.

Referenced by getChildren(), and resolveInst().

◆ children

const std::vector<std::unique_ptr<Instance> > esi::HWModule::children
protected

Definition at line 98 of file Design.h.

Referenced by getChildrenOrdered(), and poll().

◆ info

const std::optional<ModuleInfo> esi::HWModule::info
protected

Definition at line 97 of file Design.h.

Referenced by getInfo().

◆ portIndex

const std::map<AppID, BundlePort &> esi::HWModule::portIndex
protected

Definition at line 102 of file Design.h.

Referenced by getPorts().

◆ ports

const std::vector<std::unique_ptr<BundlePort> > esi::HWModule::ports
protected

Definition at line 101 of file Design.h.

Referenced by getPortsOrdered(), poll(), and resolvePort().

◆ services

const std::vector<services::Service *> esi::HWModule::services
protected

Definition at line 100 of file Design.h.

Referenced by getServices().


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