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

Class SensitivityMatcher. More...

#include <SensitivityMatcher.h>

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

Public Types

typedef std::tuple< std::string, clang::ValueDecl *, clang::MemberExpr *, clang::VarDecl *, clang::ArraySubscriptExpr *, clang::ForStmt * > SensitivityTupleType
 
typedef std::pair< std::string, std::vector< SensitivityTupleType > > SensitivityPairType
 This is the pair for inserting key-value entries in the map.
 
typedef std::map< std::string, std::vector< SensitivityTupleType > > SenseMapType
 The key is going to be the name of the FieldDecl/VarDecl.
 

Public Member Functions

SenseMapType getSensitivityMap ()
 Return the sensitivity map that has been created.
 
void registerMatchers (MatchFinder &finder)
 Defines the matcher, and setup the matcher.
 
virtual void run (const MatchFinder::MatchResult &result)
 This is the callback function whenever there is a match.
 
void dump ()
 Dump out the detected sensitivity list for every process.
 

Private Member Functions

std::string generateSensitivityName (const std::vector< SensitivityTupleType > &sense_args)
 This generates an encoded name of the argument for the sensitivity.
 

Private Attributes

SenseMapType sensitivity_
 This is the map structure to store the identified sensitivity list.
 
clang::VarDecl * process_handle_
 This provides access to the SystemC process' entry function handler.
 

Detailed Description

Class SensitivityMatcher.

Definition at line 211 of file SensitivityMatcher.h.

Member Typedef Documentation

◆ SenseMapType

typedef std::map<std::string, std::vector<SensitivityTupleType> > sc_ast_matchers::SensitivityMatcher::SenseMapType

The key is going to be the name of the FieldDecl/VarDecl.

Definition at line 228 of file SensitivityMatcher.h.

◆ SensitivityPairType

This is the pair for inserting key-value entries in the map.

Definition at line 224 of file SensitivityMatcher.h.

◆ SensitivityTupleType

typedef std::tuple<std::string, clang::ValueDecl*, clang::MemberExpr*, clang::VarDecl*, clang::ArraySubscriptExpr*, clang::ForStmt*> sc_ast_matchers::SensitivityMatcher::SensitivityTupleType

A sensitivity will typically have a member field, and sometimes a call on the member field. The ValueDecl records the FieldDecl, and the VarDecl that may be used in the sensitivity list. The MemberExpr is just a way to represent where this particular ValueDecl was found for further parsing. The VarDecl* is the process handle to which this sensitivity is bound to.

Definition at line 220 of file SensitivityMatcher.h.

Member Function Documentation

◆ dump()

void sc_ast_matchers::SensitivityMatcher::dump ( )
inline

Dump out the detected sensitivity list for every process.

This is going to print out the sensitivity list.

Definition at line 429 of file SensitivityMatcher.h.

◆ generateSensitivityName()

std::string sc_ast_matchers::SensitivityMatcher::generateSensitivityName ( const std::vector< SensitivityTupleType > & sense_args)
inlineprivate

This generates an encoded name of the argument for the sensitivity.

Definition at line 238 of file SensitivityMatcher.h.

◆ getSensitivityMap()

SenseMapType sc_ast_matchers::SensitivityMatcher::getSensitivityMap ( )
inline

Return the sensitivity map that has been created.

Returns
A map of sensitivity lists found.

This method just returns the identified map of sensitivity lists.

Definition at line 255 of file SensitivityMatcher.h.

◆ registerMatchers()

void sc_ast_matchers::SensitivityMatcher::registerMatchers ( MatchFinder & finder)
inline

Defines the matcher, and setup the matcher.

Add the matcher.

Definition at line 259 of file SensitivityMatcher.h.

◆ run()

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

This is the callback function whenever there is a match.

Debug code

If the argument to the operator<<() is a MemberExpr. This is the situation when we only have a FieldDecl as a part of the sensitivity list. This is when there is no member call being invoked on the FieldDecl.

If the argument to the operator<<() is a CXXMemberCallExpr. This is needed when there is a clk.pos() in the sensitivity list. This is when we have member call expressions on the FieldDecl.

If the argument is an ArraySubscriptExpr, then only provide access to the pointer to ArraySubscriptExpr.

Definition at line 307 of file SensitivityMatcher.h.

Member Data Documentation

◆ process_handle_

clang::VarDecl* sc_ast_matchers::SensitivityMatcher::process_handle_
private

This provides access to the SystemC process' entry function handler.

Definition at line 235 of file SensitivityMatcher.h.

◆ sensitivity_

SenseMapType sc_ast_matchers::SensitivityMatcher::sensitivity_
private

This is the map structure to store the identified sensitivity list.

Definition at line 232 of file SensitivityMatcher.h.


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