systemc-clang 2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sc_ast_matchers::NetlistMatcher Class Reference

#include <NetlistMatcher.h>

Inheritance diagram for sc_ast_matchers::NetlistMatcher:
Inheritance graph
[legend]
Collaboration diagram for sc_ast_matchers::NetlistMatcher:
Collaboration graph
[legend]

Public Member Functions

void registerMatchers (MatchFinder &finder, systemc_clang::Model *model, ModuleDeclarationMatcher *module_matcher)
 
virtual void run (const MatchFinder::MatchResult &result)
 
void dump ()
 

Private Member Functions

ModuleInstancefindModuleDeclInstance (clang::Decl *decl)
 

Private Attributes

Modelmodel_
 
const InstanceMatcherinstance_matcher_
 
ModuleDeclarationMatchermodule_matcher_
 
std::string top_
 

Detailed Description

Class NetlistMatcher

Definition at line 26 of file NetlistMatcher.h.

Member Function Documentation

◆ dump()

void sc_ast_matchers::NetlistMatcher::dump ( )
inline

Definition at line 294 of file NetlistMatcher.h.

◆ findModuleDeclInstance()

ModuleInstance * sc_ast_matchers::NetlistMatcher::findModuleDeclInstance ( clang::Decl * decl)
inlineprivate

Definition at line 33 of file NetlistMatcher.h.

◆ registerMatchers()

void sc_ast_matchers::NetlistMatcher::registerMatchers ( MatchFinder & finder,
systemc_clang::Model * model,
ModuleDeclarationMatcher * module_matcher )
inline

Either a port (with sc_port base class) or module (with sc_module base class) can be bound. This will match if either one of those is the type.

Callers are nested within the CXXOperatorCallExpr; hence, the hasDescendant().

This priority is imporant. anyOf() priority is in the order of specification. Thus, we check if there is an ArraySubscriptExpr for the port, and only if it is not then we check a non-array port. The caller port could also be a array, so we need to check if the ancestor has an ArraySubscriptExpr. This should have worked better with using optionally(), but it didn't work.

Callees are children of the cxxOperatorCallExpr; hence, the use of has().

The memberExpr gives the port name. The arraySubscriptExpr gives the ArraySubscriptExpr to the array.

Definition at line 48 of file NetlistMatcher.h.

◆ run()

virtual void sc_ast_matchers::NetlistMatcher::run ( const MatchFinder::MatchResult & result)
inlinevirtual

Rework

MemberExpr that gives the method name (port name).

This string is necessary since addPortbinding stores a map of string => Portbinding. Thus just using port name is not unique.

Definition at line 183 of file NetlistMatcher.h.

Member Data Documentation

◆ instance_matcher_

const InstanceMatcher* sc_ast_matchers::NetlistMatcher::instance_matcher_
private

Definition at line 29 of file NetlistMatcher.h.

◆ model_

Model* sc_ast_matchers::NetlistMatcher::model_
private

Definition at line 28 of file NetlistMatcher.h.

◆ module_matcher_

ModuleDeclarationMatcher* sc_ast_matchers::NetlistMatcher::module_matcher_
private

Definition at line 30 of file NetlistMatcher.h.

◆ top_

std::string sc_ast_matchers::NetlistMatcher::top_
private

Definition at line 31 of file NetlistMatcher.h.


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