Class PortMatcher.
More...
#include <PortMatcher.h>
Class PortMatcher.
This class identifies a SystemC module's port declaration, and nested submodules as well.
Definition at line 43 of file PortMatcher.h.
◆ MemberDeclType
A vector of tuples that holds the name of the port, and a pointer to PortDecl.
Definition at line 47 of file PortMatcher.h.
◆ PortMatcher()
sc_ast_matchers::PortMatcher::PortMatcher |
( |
| ) |
|
|
inline |
◆ checkMatch()
template<typename NodeType >
auto sc_ast_matchers::PortMatcher::checkMatch |
( |
const std::string & | name, |
|
|
const MatchFinder::MatchResult & | result ) |
|
inline |
◆ dump()
void sc_ast_matchers::PortMatcher::dump |
( |
| ) |
|
|
inline |
◆ getClockPorts()
const MemberDeclType & sc_ast_matchers::PortMatcher::getClockPorts |
( |
| ) |
const |
|
inline |
Returns the identified clock ports.
Definition at line 71 of file PortMatcher.h.
◆ getInOutPorts()
const MemberDeclType & sc_ast_matchers::PortMatcher::getInOutPorts |
( |
| ) |
const |
|
inline |
Returns the identified inout ports.
Definition at line 83 of file PortMatcher.h.
◆ getInputPorts()
const MemberDeclType & sc_ast_matchers::PortMatcher::getInputPorts |
( |
| ) |
const |
|
inline |
Returns the identified input ports.
Definition at line 75 of file PortMatcher.h.
◆ getInputStreamPorts()
const MemberDeclType & sc_ast_matchers::PortMatcher::getInputStreamPorts |
( |
| ) |
const |
|
inline |
Returns the identified sc_stream input ports.
Definition at line 99 of file PortMatcher.h.
◆ getOtherVars()
const MemberDeclType & sc_ast_matchers::PortMatcher::getOtherVars |
( |
| ) |
const |
|
inline |
Returns the identified variables that are not ports or signals.
Definition at line 87 of file PortMatcher.h.
◆ getOutputPorts()
const MemberDeclType & sc_ast_matchers::PortMatcher::getOutputPorts |
( |
| ) |
const |
|
inline |
Returns the identified output ports.
Definition at line 79 of file PortMatcher.h.
◆ getOutputStreamPorts()
const MemberDeclType & sc_ast_matchers::PortMatcher::getOutputStreamPorts |
( |
| ) |
const |
|
inline |
Returns the identified sc_stream output ports.
Definition at line 103 of file PortMatcher.h.
◆ getPorts()
const MemberDeclType & sc_ast_matchers::PortMatcher::getPorts |
( |
| ) |
const |
|
inline |
◆ getSignals()
const MemberDeclType & sc_ast_matchers::PortMatcher::getSignals |
( |
| ) |
const |
|
inline |
Returns the identified signals.
Definition at line 91 of file PortMatcher.h.
◆ getSubmodules()
const MemberDeclType & sc_ast_matchers::PortMatcher::getSubmodules |
( |
| ) |
const |
|
inline |
Returns the identified submodules.
Definition at line 95 of file PortMatcher.h.
◆ insert_port()
template<typename T >
void sc_ast_matchers::PortMatcher::insert_port |
( |
MemberDeclType & | port, |
|
|
T * | decl, |
|
|
bool | isFieldDecl = true ) |
|
inline |
Cast it to see if it's array type.
Definition at line 389 of file PortMatcher.h.
◆ makeArraySubModule()
auto sc_ast_matchers::PortMatcher::makeArraySubModule |
( |
llvm::StringRef | name | ) |
|
|
inline |
◆ makeArrayTypeMatcher()
auto sc_ast_matchers::PortMatcher::makeArrayTypeMatcher |
( |
const std::string & | name | ) |
|
|
inline |
◆ makeFieldMatcher()
auto sc_ast_matchers::PortMatcher::makeFieldMatcher |
( |
llvm::StringRef | name | ) |
|
|
inline |
AST matcher to detect field declarations.
The generic field matcher has the following conditions.
- It is in the main provided file (not in the library files).
- It is derived from sc_module
- For each child that is a FieldDecl,
- The type of it is a C++ class whose class name is "name"
Definition at line 114 of file PortMatcher.h.
◆ makeMemberIsSubModule()
auto sc_ast_matchers::PortMatcher::makeMemberIsSubModule |
( |
| ) |
|
|
inline |
◆ makePortHasNamedDeclNameMatcher()
auto sc_ast_matchers::PortMatcher::makePortHasNamedDeclNameMatcher |
( |
llvm::StringRef | name | ) |
|
|
inline |
This is a matcher for sc_in_clk since it uses a NamedDecl. It has the following conditions:
- It must be a FieldDecl,
- It has a type that is an array whose type has a name "name".
- Or, it has a type that is a NamedDecl whose name is "name".
Definition at line 288 of file PortMatcher.h.
◆ makePortHasNameMatcher()
auto sc_ast_matchers::PortMatcher::makePortHasNameMatcher |
( |
llvm::StringRef | name | ) |
|
|
inline |
◆ makeSignalArrayType()
auto sc_ast_matchers::PortMatcher::makeSignalArrayType |
( |
const std::string & | name | ) |
|
|
inline |
This is a matcher to identify sc_signal. The reason for this matcher is for it to match arrays of sc_signals as well. The conditions are as follows:
- It must be a FieldDecl
- It must have a type that is either an array whose type is a c++ class derived from a class name called "name"
- Or, it is has a type that is a c++ class that is derived from class name "name".
Definition at line 141 of file PortMatcher.h.
◆ makeSignalMatcher()
auto sc_ast_matchers::PortMatcher::makeSignalMatcher |
( |
llvm::StringRef | name | ) |
|
|
inline |
◆ parseTemplateType()
template<typename T >
auto sc_ast_matchers::PortMatcher::parseTemplateType |
( |
const T * | fd | ) |
|
|
inline |
◆ portNameMatcher()
auto sc_ast_matchers::PortMatcher::portNameMatcher |
( |
const std::string & | name | ) |
|
|
inline |
This is a matcher for sc_port. It has the following conditions:
- It must be a FieldDecl
- It has a type that is an array whose type has a name "name"
- Or, it has a type that is a C++ class whose class name is "name".
I'm not sure how to do 1d,2d,3d array matching other than the way it is done. The key idea is to see that there is an arrayType() within an arrayType(), and so on.
Definition at line 208 of file PortMatcher.h.
◆ printTemplateArguments()
void sc_ast_matchers::PortMatcher::printTemplateArguments |
( |
MemberDeclType & | found_ports | ) |
|
|
inline |
◆ registerMatchers()
void sc_ast_matchers::PortMatcher::registerMatchers |
( |
MatchFinder & | finder | ) |
|
|
inline |
Matchers for compositions. These matchers are used to form other matchers.
Matches all the SystemC Ports.
Definition at line 439 of file PortMatcher.h.
◆ run()
virtual void sc_ast_matchers::PortMatcher::run |
( |
const MatchFinder::MatchResult & | result | ) |
|
|
inlinevirtual |
Array types
Submodules
Not a submodule and not a port
Definition at line 546 of file PortMatcher.h.
◆ signalMatcher()
auto sc_ast_matchers::PortMatcher::signalMatcher |
( |
const std::string & | name | ) |
|
|
inline |
◆ clock_ports_
Separate out the member declarations found within a SystemC module.
Definition at line 54 of file PortMatcher.h.
◆ in_ports_
◆ inout_ports_
◆ instream_ports_
◆ other_fields_
◆ out_ports_
◆ outstream_ports_
◆ sc_ports_
◆ signal_fields_
◆ submodules_
Store the declaration of submodules.
Definition at line 65 of file PortMatcher.h.
The documentation for this class was generated from the following file: