pinapa Namespace Reference


Namespaces

namespace  parser_flags

Classes

struct  event_assoc_unit
class  st_backend
class  st_basic_slave_method_handle
class  st_c_value
class  st_c_int
class  st_c_bool
class  key_assoc_tree_module
struct  equal_to_key_assoc_tree_module
struct  hash_key_assoc_tree_module
class  st_tree_instance_module_deco_t
class  st_deco_b
class  st_deco_first
class  st_deco
class  st_event_deco_t
class  slave_method_as_process
 Constructor for a pseudo process highlighting a remarkable method. More...
class  get_initial_values
class  st_module_deco_t
class  st_port_deco_t
class  port_to_port_hook
struct  port_assoc_unit
class  sc_interface_list_hook
class  st_systemc_deco_t
class  st_deco_first< st_systemc_deco_t, sc_object >
class  st_deco_first< st_systemc_deco_t, sc_event >
class  st_deco_first< st_systemc_deco_t, void >
class  st_process_deco_t
class  sensitive_hook
class  st_sensitivity
class  st_time_sensitivity
class  st_sensitivity_list
class  st_signal_deco_t
class  simcontext
class  st_tac_slave_method_handle
class  st_deco_first< deco, tree_node >
class  key_assoc_tree_handle
struct  equal_to_key_assoc_tree_handle
struct  hash_key_assoc_tree_handle
class  st_tree_instance_deco_t
class  st_tree_deco_t
class  st_dependant_deco
class  st_read_deco
class  st_write_deco
class  st_func_decl_deco
class  st_tlm_write_deco
class  st_type_deco
class  st_data_member_decl_deco
class  st_inst_dependant_deco
class  st_event_tree_deco
class  st_wait_deco
class  treeFacade
class  treeVisitor
class  resizeable_array
class  analysis_set
class  function_body_visitor
class  st_hook_param
class  st_hooked_function
class  hook
class  sensitive_param

Typedefs

typedef vector< event_assoc_unitevent_assoc
typedef
st_basic_slave_method_handle
basic_slave_method_handle
typedef st_c_valuec_value
typedef st_deco_first
< st_tree_instance_module_deco_t,
key_assoc_tree_module
st_tree_instance_module_deco
typedef
st_tree_instance_module_deco
tree_instance_module_deco
typedef hash_map
< key_assoc_tree_module,
tree_instance_module_deco,
hash_key_assoc_tree_module,
equal_to_key_assoc_tree_module
assoc_tree_module
typedef st_deco_bdeco_b
typedef st_deco_first
< st_event_deco_t, sc_event
st_event_deco
typedef st_event_decoevent_deco
typedef slave_method_as_processslave_method_handle
typedef st_deco_first
< st_module_deco_t, sc_module
st_module_deco
typedef st_module_decomodule_deco
typedef st_deco_first
< st_port_deco_t, sc_port_base
st_port_deco
typedef st_port_decoport_deco
typedef st_deco_first
< st_port_deco_t,
sc_export_base
st_export_deco
typedef st_export_decoexport_deco
typedef vector< port_assoc_unitport_assoc
typedef st_deco_first
< st_systemc_deco_t, sc_object
st_scobject_deco_t
typedef st_deco_first
< st_systemc_deco_t, sc_event
st_scevent_deco_t
typedef st_deco_first
< st_systemc_deco_t, void > 
st_scdummy_deco_t
typedef st_deco_first
< st_process_deco_t,
sc_process_b
st_process_deco
typedef st_process_decoprocess_deco
typedef st_sensitivitysensitivity
typedef st_sensitivity_listsensitivity_list
typedef st_time_sensitivitytime_sensitivity
typedef st_deco_first
< st_signal_deco_t,
sc_interface
st_signal_deco
typedef st_signal_decosignal_deco
typedef
st_tac_slave_method_handle
tac_slave_method_handle
typedef st_tree_deco_ttree_deco_t
typedef st_dependant_decodependant_deco
typedef st_type_decotype_deco
typedef st_data_member_decl_decodata_member_decl_deco
typedef st_event_tree_decoevent_tree_deco
typedef st_inst_dependant_decoinst_dependant_deco
typedef st_deco_first
< st_tree_deco_t, tree_node > 
st_tree_deco
typedef st_tree_decotree_deco
typedef st_deco_first
< st_tree_instance_deco_t,
key_assoc_tree_handle
st_tree_instance_deco
typedef st_tree_instance_decotree_instance_deco
typedef hash_map
< key_assoc_tree_handle,
tree_instance_deco,
hash_key_assoc_tree_handle,
equal_to_key_assoc_tree_handle
assoc_tree_handle
typedef st_wait_decowait_deco
typedef hash_set< treefunction_set_t
typedef st_hook_paramhook_param
typedef st_hooked_functionhooked_function

Enumerations

enum  rw { read, write }
enum  type_of_function {
  CPP_STANDARD_FUNC, SC_PROCESS, BASIC_READ_TARGET, BASIC_WRITE_TARGET,
  TAC_READ_TARGET, TAC_READ_BYTE_ENABLE_TARGET, TAC_READ_BLOCK_TARGET, TAC_WRITE_TARGET,
  TAC_WRITE_BYTE_ENABLE_TARGET, TAC_WRITE_BLOCK_TARGET, USER_HIGHLIGHT_TARGET
}
enum  sc_primitive_t {
  CPP_STANDARD, CPP_FUNC_DECL, CPP_DATA_MEMBER, SC_VARIABLE_DECL,
  PINAPA_TYPE, SC_PORT, SC_WRITE, SC_READ,
  SC_MODULE, SC_WAIT, PINAPA_BASIC_SEQ_WRITE, PINAPA_BASIC_ARBITER_WRITE,
  PINAPA_BASIC_SEQ_READ, PINAPA_BASIC_ARBITER_READ, PINAPA_TAC_ROUTER_READ, PINAPA_TAC_ARBITER_READ,
  PINAPA_TAC_SEQ_READ, PINAPA_TAC_ROUTER_WRITE, PINAPA_TAC_ARBITER_WRITE, PINAPA_TAC_SEQ_WRITE,
  PINAPA_TAC_SET_ACCESS_ERROR, TLM_IS_ERROR, TLM_IS_OK, TLM_IS_OVERLAP,
  TLM_IS_NO_RESPONSE, TLM_SET_OK, TLM_SET_ERROR, SC_NOTIFY,
  SC_NEXT_TRIGGER, PINAPA_TLM_BASIC_READ, PINAPA_TLM_BASIC_WRITE, PINAPA_TLM_TAC_READ,
  PINAPA_TLM_TAC_WRITE, TLM_PV_WAIT, TLM_PV_NEXT_TRIGGER, TLM_IS_SYNCHRO
}
enum  type_of_type { PINAPA_TLM_ADDRESS_TYPE, PINAPA_TLM_DATA_TYPE, PINAPA_STANDARD_TYPE }

Functions

void process_type (tree body, tree value)
void get_value_at_end_of_elaboration (tree body, const vector< sc_process_b * > &vh)
void get_value_at_address (tree type, int address)
void analyze_function_body (tree body, tree module, const vector< sc_process_b * > &vh)
void mark_function_calls (tree body, tree module)
void finish_proc_analysisses ()
string build_gcc_command (const string &tmpfilename, const string &libfilename)
template<>
void * get_decoration< key_assoc_tree_module > (key_assoc_tree_module &th)
template<>
void set_decoration< key_assoc_tree_module > (key_assoc_tree_module &th, void *d)
template<class parent >
void * get_decoration (parent &p)
template<class parent >
void set_decoration (parent &p, void *c)
void finalize ()
template<typename T >
size_t hash_ptr_fct (const void *ptr)
void initialize ()
void connect_interfaces_to_slave ()
int main (int argc, char *argv[], pinapa::st_backend *destination)
int sc_main_in_parser (int argc, char *argv[])
string parser_getopt_file_to_parse ()
string parser_getopt_lib_to_load ()
bool parser_getopt_retrieve_source_locations ()
bool parser_getopt_enable_process_analysis ()
bool parser_getopt_gcc_permissive ()
set< pair< string, string > > parser_getopt_hightlight_slaves ()
void parser_initialize_parse_file (const string &parser_file_to_parse)
void parser_initialize_lib_to_load (const string &lib_to_load)
void parser_retrieve_source_locations (const bool flag=true)
void parser_enable_process_analysis (const bool flag=true)
void parser_gcc_permissive (const bool flag=true)
void parser_highlight_slave (const string &slave_base, const string &slave_method)
void parser_highlight_slaves_include (const string &file_name)
void analyze_read_or_write (rw rw, tree function, tree module, vector< sc_process_b * > vh)
template<typename sc_type_of_object >
inst_dependant_deco decoration_for (sc_type_of_object *obj)
template<>
inst_dependant_deco decoration_for< sc_event > (sc_event *obj)
template<>
inst_dependant_deco decoration_for< sc_port_base > (sc_port_base *obj)
template<typename sc_type_of_object , typename assoc_unit >
vector< assoc_unit > this_one_may_be_a (tree port, tree module, const vector< sc_process_b * > &vh)
void replace (string &Source, const string &Find, const string &Replacement)
bool end_with (string &Source, const string &End)
void end_with__test ()
void push_split (const string &str, const string &sep, vector< string > &dest)
void push_split__test ()
template<class T >
string string_from (const T &val, ios_base &(*f)(ios_base &)=dec)
template<class T >
to (const std::string &s, std::ios_base &(*f)(std::ios_base &)=std::dec)
string defensive_getenv (const char *variable)
char * get_name (sc_primitive_t prim)
char * get_doc (sc_primitive_t prim)
template<>
void * get_decoration< key_assoc_tree_handle > (key_assoc_tree_handle &th)
template<>
void set_decoration< key_assoc_tree_handle > (key_assoc_tree_handle &th, void *d)
void gdb_dump_instance_deco ()
void print_primitive (sc_primitive_t sc_primitive)
template<typename T , typename P >
bool instance_of (P p)
tree_deco analyze_wait_or_nt_arguments (sc_primitive_t primitive, tree list_args, tree module, const vector< sc_process_b * > &vh, tree to_be_decorated)
void analyze_notify (tree function, tree module, vector< sc_process_b * > vh)
void __do_analyze_function (tree body, tree module, const vector< sc_process_b * > &vh)
int call_gcc ()
void parser_start ()

Variables

assoc_tree_module instances_module_deco
pinapa::st_backendgo_back_to
hash_map< tree, tree_decotree_decoration_map
assoc_tree_handle instances_deco
static vector< analysis_sets_process_analyzed
function_set_t global_function_set
tree current_function
tree pinapa_current_function_return_value
bool named_return_value_attach_it = false

Typedef Documentation

association (sc_process -> sc_event). This could have been done with a hashtable, but is probably more efficient like this.

typedef hash_set<tree> pinapa::function_set_t

association (sc_process -> sc_port). This could have been done with a hashtable, but is probably more efficient like this.


Enumeration Type Documentation

enum pinapa::rw

Enumerator:
read 
write 

Type of statement or object in SystemC.

Enumerator:
CPP_STANDARD  C++ code unrelated to SystemC
CPP_FUNC_DECL  C++ function declaration
CPP_DATA_MEMBER  A variable which is a data-member of a class
SC_VARIABLE_DECL  Declaration of a variable which is of a SC or TLM primitive time
PINAPA_TYPE  Type. (decoration of TREE_TYPE field in the tree)
SC_PORT  An object of type sc_in sc_out or sc_inout
SC_WRITE  A function call port.write(value)
SC_READ  A function call port.read(value)
SC_MODULE  A module in SystemC
SC_WAIT  A function call wait(...)
PINAPA_BASIC_SEQ_WRITE  Obsolete
PINAPA_BASIC_ARBITER_WRITE  Obsolete
PINAPA_BASIC_SEQ_READ  Obsolete
PINAPA_BASIC_ARBITER_READ  Obsolete
PINAPA_TAC_ROUTER_READ  Obsolete
PINAPA_TAC_ARBITER_READ  Obsolete
PINAPA_TAC_SEQ_READ  Obsolete
PINAPA_TAC_ROUTER_WRITE  Obsolete
PINAPA_TAC_ARBITER_WRITE  Obsolete
PINAPA_TAC_SEQ_WRITE  Obsolete
PINAPA_TAC_SET_ACCESS_ERROR  set_access_error in a TAC slave method
TLM_IS_ERROR  tlm_status::is_error()
TLM_IS_OK  tlm_status::is_ok()
TLM_IS_OVERLAP  Obsolete
TLM_IS_NO_RESPONSE  tlm_status::is_no_response()
TLM_SET_OK  tlm_status::set_ok()
TLM_SET_ERROR  tlm_status::set_error()
SC_NOTIFY  Event notification in SystemC
SC_NEXT_TRIGGER  Call to a next_trigger() function in SystemC
PINAPA_TLM_BASIC_READ  A function call port.read(value) on a TLM Basic port
PINAPA_TLM_BASIC_WRITE  A function call port.write(value) on a TLM Basic port
PINAPA_TLM_TAC_READ  A function call port.read(value) on a TLM Tac port
PINAPA_TLM_TAC_WRITE  A function call port.write(value) on a TLM Tac port
TLM_PV_WAIT  A function call module.pv_wait() on a TLM module
TLM_PV_NEXT_TRIGGER  A function call module.pv_next_trigger() on a TLM module
TLM_IS_SYNCHRO  tlm_status::is_synchro()

Enumerator:
CPP_STANDARD_FUNC  C++ standard function of method
SC_PROCESS  function implementing a SystemC process
BASIC_READ_TARGET  Overloaded read function in a BASIC target module.
BASIC_WRITE_TARGET  Overloaded write function in a BASIC target module.
TAC_READ_TARGET  Overloaded read function in a TAC target module.
TAC_READ_BYTE_ENABLE_TARGET  Overloaded read function in a TAC target module with byte enable.
TAC_READ_BLOCK_TARGET  Overloaded read block function in a TAC target module.
TAC_WRITE_TARGET  Overloaded write function in a TAC target module.
TAC_WRITE_BYTE_ENABLE_TARGET  Overloaded write function in a TAC target module with byte enable.
TAC_WRITE_BLOCK_TARGET  Overloaded write block function in a TAC target module.
USER_HIGHLIGHT_TARGET  Overloaded method module (hightlighted upon user's request)

Types in the source code can be primitive types of SystemC or TLM. This enumeration lists the primitive types.

Enumerator:
PINAPA_TLM_ADDRESS_TYPE  Type of an address in the basic protocol
PINAPA_TLM_DATA_TYPE  Type of a data in the basic protocol
PINAPA_STANDARD_TYPE  C++ standard type.


Function Documentation

void pinapa::__do_analyze_function ( tree  body,
tree  module,
const vector< sc_process_b * > &  vh 
)

void pinapa::analyze_function_body ( tree  body,
tree  module,
const vector< sc_process_b * > &  vh 
)

top-level function to call to analyze the body of the function.

References __do_analyze_function(), pinapa::simcontext::hook3, and s_process_analyzed.

Referenced by pinapa_gcc_analyze_function_hook().

void pinapa::analyze_notify ( tree  function,
tree  module,
vector< sc_process_b * >  vh 
)

void pinapa::analyze_read_or_write ( rw  rw,
tree  function,
tree  module,
vector< sc_process_b * >  vh 
)

tree_deco pinapa::analyze_wait_or_nt_arguments ( sc_primitive_t  primitive,
tree  list_args,
tree  module,
const vector< sc_process_b * > &  vh,
tree  to_be_decorated 
)

string pinapa::build_gcc_command ( const string &  tmpfilename,
const string &  libfilename 
)

Returns a GCC command to be executed to generate the loadable module to extract the initial values of data-members of objects. See file pinapa-get-initial-values.h

Todo:
Replace the string + system() call by an array of char * + a fork()/execvp() call.

Todo:
Take the value of CXX from autoconf script.

References defensive_getenv(), and parser_getopt_file_to_parse().

Referenced by pinapa::get_initial_values::do_decoration().

int pinapa::call_gcc (  ) 

void pinapa::connect_interfaces_to_slave (  ) 

template<typename sc_type_of_object >
inst_dependant_deco pinapa::decoration_for ( sc_type_of_object *  obj  )  [inline]

template<>
inst_dependant_deco pinapa::decoration_for< sc_event > ( sc_event obj  )  [inline]

template<>
inst_dependant_deco pinapa::decoration_for< sc_port_base > ( sc_port_base obj  )  [inline]

string pinapa::defensive_getenv ( const char *  variable  )  [inline]

devensive version of GETENV. Stops the program if the variable is not defined.

References NULL, and PINAPA_ASSERT.

Referenced by build_gcc_command().

bool pinapa::end_with ( string &  Source,
const string &  End 
) [inline]

Referenced by end_with__test().

void pinapa::end_with__test (  )  [inline]

References end_with().

void pinapa::finalize (  ) 

void pinapa::finish_proc_analysisses (  ) 

void pinapa::gdb_dump_instance_deco (  ) 

template<class parent >
void* pinapa::get_decoration ( parent &  p  )  [inline]

parent == grandparent. First decoration of a chain.

Function used by the decoration infrastructure to access the field pinapa_decoration. This is a template that can be specialized to make more fancy decorations

template<>
void* pinapa::get_decoration< key_assoc_tree_handle > ( key_assoc_tree_handle &  th  )  [inline]

template<>
void* pinapa::get_decoration< key_assoc_tree_module > ( key_assoc_tree_module &  th  )  [inline]

char * pinapa::get_doc ( sc_primitive_t  prim  ) 

References PINAPA_REPORT_ERROR.

char * pinapa::get_name ( sc_primitive_t  prim  ) 

void pinapa::get_value_at_address ( tree  type,
int  address 
)

Gets the value of type "type" in memory at the address "address"

References DCOUT, PINAPA_NOT_IMPLEMENTED, and TREE_SWITCH.

Referenced by get_value_at_end_of_elaboration().

void pinapa::get_value_at_end_of_elaboration ( tree  body,
const vector< sc_process_b * > &  vh 
)

Gets the value of the actual variable at the end of elaboration. Since we are at the end of elaboration, the value should be initialized.

See Initial values of data-members for more information.

References get_value_at_address(), PINAPA_ASSERT, and sc_core::sc_object::pinapa_get_class_name().

template<typename T >
size_t pinapa::hash_ptr_fct ( const void *  ptr  )  [inline]

void pinapa::initialize (  ) 

template<typename T , typename P >
bool pinapa::instance_of ( p  )  [inline]

Test whether the given pointer points to an instance of the template parameter.

References NULL.

int pinapa::main ( int  argc,
char *  argv[],
pinapa::st_backend destination 
)

The function pinapa::main is the one to call to do all the job of the parser.

The function pinapa::main() is the one to call to do all the job of the parser.

References go_back_to, initialize(), and sc_real_main().

void pinapa::mark_function_calls ( tree  body,
tree  module 
)

decorates only function calls embedded in the function.

References pinapa::treeVisitor::accept().

Referenced by pinapa_gcc_analyze_function_hook().

void pinapa::parser_enable_process_analysis ( const bool  flag = true  ) 

void pinapa::parser_gcc_permissive ( const bool  flag = true  ) 

bool pinapa::parser_getopt_enable_process_analysis (  ) 

string pinapa::parser_getopt_file_to_parse (  ) 

bool pinapa::parser_getopt_gcc_permissive (  ) 

References parser_getopt::gcc_permissive.

Referenced by call_gcc().

set< pair< string, string > > pinapa::parser_getopt_hightlight_slaves (  ) 

string pinapa::parser_getopt_lib_to_load (  ) 

bool pinapa::parser_getopt_retrieve_source_locations (  ) 

void pinapa::parser_highlight_slave ( const string &  slave_base,
const string &  slave_method 
)

void pinapa::parser_highlight_slaves_include ( const string &  file_name  ) 

void pinapa::parser_initialize_lib_to_load ( const string &  lib_to_load  ) 

void pinapa::parser_initialize_parse_file ( const string &  parser_file_to_parse  ) 

void pinapa::parser_retrieve_source_locations ( const bool  flag = true  ) 

void pinapa::parser_start (  ) 

void pinapa::print_primitive ( sc_primitive_t  sc_primitive  ) 

References get_name().

void pinapa::process_type ( tree  body,
tree  value 
)

void pinapa::push_split ( const string &  str,
const string &  sep,
vector< string > &  dest 
) [inline]

Referenced by push_split__test().

void pinapa::push_split__test (  )  [inline]

References push_split().

void pinapa::replace ( string &  Source,
const string &  Find,
const string &  Replacement 
) [inline]

int pinapa::sc_main_in_parser ( int  argc,
char *  argv[] 
)

Just calls sc_main with the same arguments. The reason for this function being here is just that a direct call from libsystemc.a to libTLMrun.a wasn't accepted at link time.

The function pinapa::main_in_parser makes a call to the function sc_main located in the dynamic library libTLMrun.so. It will dlopen this library for this purpose.

template<class parent >
void pinapa::set_decoration ( parent &  p,
void *  c 
) [inline]

Function used by the decoration infrastructure to set the field pinapa_decoration. This is a template that can be specialized to make more fancy decorations

template<>
void pinapa::set_decoration< key_assoc_tree_handle > ( key_assoc_tree_handle &  th,
void *  d 
) [inline]

template<>
void pinapa::set_decoration< key_assoc_tree_module > ( key_assoc_tree_module &  th,
void *  d 
) [inline]

template<class T >
string pinapa::string_from ( const T &  val,
ios_base &(*)(ios_base &)  f = dec 
) [inline]

Converter to string for anything convertible

Referenced by pinapa::get_initial_values::do_decoration(), and pinapa::st_process_deco_t::get_uniq().

template<typename sc_type_of_object , typename assoc_unit >
vector<assoc_unit> pinapa::this_one_may_be_a ( tree  port,
tree  module,
const vector< sc_process_b * > &  vh 
) [inline]

Returns an association (sc_process -> sc_port) corresponding to the port "port" from GCC's AST.

The association is empty if the object is not a port.

port.write(true) is transformed into write(this->port, true), which becomes write((port *)(this + port_offset), true) We've got the first argument, so, this is (port *)(this + port_offset)

This method has initialy been written for ports, but the template allows the extension to events.

References pinapa::treeFacade::adjust_shift(), DCOUT, pinapa::st_deco_first< deco, parent >::get(), NULL, PINAPA_ASSERT, PINAPA_DEBUG_CODE, PINAPA_NOT_IMPLEMENTED, and pinapa::treeFacade::skip_nop().

Referenced by analyze_notify(), and analyze_read_or_write().

template<class T >
T pinapa::to ( const std::string &  s,
std::ios_base &(*)(std::ios_base &)  f = std::dec 
) [inline]

Converter from string. Throws 333 on problem


Variable Documentation

Function-class to be called to return to the backend

Referenced by main().

Hash map used to associate a decoration to a tree.

Historically, this used to be a "void *" field in the common part of tree_node, in GCC, but GCC 3.4 has a special thing that seems to prevent me from adding a field there. Therefore, I'm using this hash_map.

Referenced by pinapa::st_tree_deco_t::get().

Generated by
Matthieu Moy <Matthieu.Moy@st.com>
Back to Pinapa Home Page