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

#include <HDLMain.h>

Inheritance diagram for systemc_hdl::HDLMain:
Inheritance graph
[legend]
Collaboration diagram for systemc_hdl::HDLMain:
Collaboration graph
[legend]

Public Member Functions

 HDLMain (CompilerInstance &ci, std::string topModule="!none", const std::string &hdl_file_out="default_hdl.txt")
 Provide hdl_file_out as argument.
 
 HDLMain (ASTUnit *from_ast, std::string topModule="!none", const std::string &hdl_file_out="default_hdl.txt")
 
bool postFire ()
 
- Public Member Functions inherited from systemc_clang::SystemCConsumer
 SystemCConsumer (clang::CompilerInstance &, std::string top="!none")
 
 SystemCConsumer (clang::ASTUnit *from_ast, std::string top="!none")
 
virtual ~SystemCConsumer ()
 
void processNetlist (FindSCMain *scmain, ModuleDeclarationMatcher *module_declaration_handler)
 
ModelgetSystemCModel ()
 
const std::string & getTopModule () const
 
void setTopModule (const std::string &top_module_decl)
 
clang::ASTContext & getContext () const
 
clang::SourceManager & getSourceManager () const
 
virtual bool fire ()
 
virtual bool preFire ()
 
virtual void HandleTranslationUnit (clang::ASTContext &context)
 

Private Member Functions

void SCmodule2hcode (ModuleInstance *mod, hNodep &h_module, llvm::raw_fd_ostream &SCout)
 
void GenerateInstanceNames (ModuleInstance *smod, std::vector< std::string > &instnames)
 
bool isValidMethod (CXXMethodDecl *method)
 
void SCport2hcode (ModuleInstance::portMapType pmap, hNode::hdlopsEnum h_op, hNodep &h_info, hdecl_name_map_t &mod_vname_map)
 
void SCsig2hcode (ModuleInstance::signalMapType pmap, hNode::hdlopsEnum h_op, hNodep &h_info, hdecl_name_map_t &mod_vname_map)
 
void SCproc2hcode (ModuleInstance::processMapType pm, hNodep &h_top, hNodep &h_port, hdecl_name_map_t &mod_vname_map, overridden_method_map_t &overridden_method_map, resetvar_map_t &threadresetmap)
 
void SCportbindings2hcode (ModuleInstance *mod, hNodep &h_pb)
 
void MakeResetMap (resetvar_map_t &threadresetmap, hNodep h_allsenslists)
 

Private Attributes

clang::DiagnosticsEngine & main_diag_engine {getContext().getDiagnostics()}
 
hfunc_name_map_t allmethodecls
 
std::unordered_set< string > module_vars
 
resetvar_map_t threadresetmap
 
HDLType HDLt
 
HDLBodyxbodyp
 
util mutil
 
hmodinst_name_map_t mod_name_map {"_sc_module_"}
 
std::string hdl_file_out_
 Command line options.
 

Additional Inherited Members

- Public Attributes inherited from systemc_clang::SystemCConsumer
llvm::raw_ostream & os_
 

Detailed Description

Definition at line 24 of file HDLMain.h.

Constructor & Destructor Documentation

◆ HDLMain() [1/2]

systemc_hdl::HDLMain::HDLMain ( CompilerInstance & ci,
std::string topModule = "!none",
const std::string & hdl_file_out = "default_hdl.txt" )
inline

Provide hdl_file_out as argument.

Definition at line 28 of file HDLMain.h.

◆ HDLMain() [2/2]

systemc_hdl::HDLMain::HDLMain ( ASTUnit * from_ast,
std::string topModule = "!none",
const std::string & hdl_file_out = "default_hdl.txt" )
inline

Definition at line 31 of file HDLMain.h.

Member Function Documentation

◆ GenerateInstanceNames()

void systemc_hdl::HDLMain::GenerateInstanceNames ( ModuleInstance * smod,
std::vector< std::string > & instnames )
private

Definition at line 523 of file HDLMain.cpp.

◆ isValidMethod()

bool systemc_hdl::HDLMain::isValidMethod ( CXXMethodDecl * method)
private

Definition at line 570 of file HDLMain.cpp.

◆ MakeResetMap()

void systemc_hdl::HDLMain::MakeResetMap ( resetvar_map_t & threadresetmap,
hNodep h_allsenslists )
private

Definition at line 820 of file HDLMain.cpp.

◆ postFire()

bool systemc_hdl::HDLMain::postFire ( )
virtual

Entry point for HDL generation

Starting with top level module, process systemc objects Generate hcode for modules and submodules, including their ports and variables, port bindings, sensitivity lists Generate hcode for SC_METHOD body declarations

File name passed from command line argument.

Reimplemented from systemc_clang::SystemCConsumer.

Definition at line 49 of file HDLMain.cpp.

◆ SCmodule2hcode()

void systemc_hdl::HDLMain::SCmodule2hcode ( ModuleInstance * mod,
hNodep & h_module,
llvm::raw_fd_ostream & SCout )
private

map of overridden method decl and overriding method decl warning: only supporting single inheritance

Definition at line 135 of file HDLMain.cpp.

◆ SCport2hcode()

void systemc_hdl::HDLMain::SCport2hcode ( ModuleInstance::portMapType pmap,
hNode::hdlopsEnum h_op,
hNodep & h_info,
hdecl_name_map_t & mod_vname_map )
private

Definition at line 578 of file HDLMain.cpp.

◆ SCportbindings2hcode()

void systemc_hdl::HDLMain::SCportbindings2hcode ( ModuleInstance * mod,
hNodep & h_pb )
private

Definition at line 855 of file HDLMain.cpp.

◆ SCproc2hcode()

void systemc_hdl::HDLMain::SCproc2hcode ( ModuleInstance::processMapType pm,
hNodep & h_top,
hNodep & h_port,
hdecl_name_map_t & mod_vname_map,
overridden_method_map_t & overridden_method_map,
resetvar_map_t & threadresetmap )
private

Get the diagnostic engine.

Definition at line 750 of file HDLMain.cpp.

◆ SCsig2hcode()

void systemc_hdl::HDLMain::SCsig2hcode ( ModuleInstance::signalMapType pmap,
hNode::hdlopsEnum h_op,
hNodep & h_info,
hdecl_name_map_t & mod_vname_map )
private

Definition at line 684 of file HDLMain.cpp.

Member Data Documentation

◆ allmethodecls

hfunc_name_map_t systemc_hdl::HDLMain::allmethodecls
private

Definition at line 60 of file HDLMain.h.

◆ hdl_file_out_

std::string systemc_hdl::HDLMain::hdl_file_out_
private

Command line options.

Definition at line 78 of file HDLMain.h.

◆ HDLt

HDLType systemc_hdl::HDLMain::HDLt
private

Definition at line 66 of file HDLMain.h.

◆ main_diag_engine

clang::DiagnosticsEngine& systemc_hdl::HDLMain::main_diag_engine {getContext().getDiagnostics()}
private

Definition at line 58 of file HDLMain.h.

◆ mod_name_map

hmodinst_name_map_t systemc_hdl::HDLMain::mod_name_map {"_sc_module_"}
private

Definition at line 75 of file HDLMain.h.

◆ module_vars

std::unordered_set<string> systemc_hdl::HDLMain::module_vars
private

Definition at line 62 of file HDLMain.h.

◆ mutil

util systemc_hdl::HDLMain::mutil
private

Definition at line 70 of file HDLMain.h.

◆ threadresetmap

resetvar_map_t systemc_hdl::HDLMain::threadresetmap
private

Definition at line 64 of file HDLMain.h.

◆ xbodyp

HDLBody* systemc_hdl::HDLMain::xbodyp
private

Definition at line 68 of file HDLMain.h.


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