ACT Library
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ActDynamicPass Class Reference

This is an ActPass that is dynamically loaded in at run-time via a shared object library. A dynamic pass can be used to extend the Act framework at run-time without having to re-compile/statically link in new functionality. Apart from loading in new passes in at runtime via C++, the interact command-line interface to the Act system also supports loading in new passes at runtime. More...

#include <act.h>

Inheritance diagram for ActDynamicPass:
ActPass

Classes

struct  act_sh_dispatch_table
 These are the C function pointers extracted from the shared library used to execute the various methods in the ActDynamicPass. More...
 
struct  act_sh_passlib_info
 This holds information about the shared object file. More...
 

Public Member Functions

 ActDynamicPass (Act *_a, const char *name, const char *lib, const char *prefix)
 
 ~ActDynamicPass ()
 release storage
 
int run (Process *p=NULL)
 
void run_recursive (Process *p=NULL, int mode=0)
 
void setParam (const char *name, void *v)
 
void setParam (const char *name, int v)
 
void setParam (const char *name, double v)
 
int getIntParam (const char *name)
 
void * getPtrParam (const char *name)
 
double getRealParam (const char *name)
 
bool hasParam (const char *name)
 
int runcmd (const char *name)
 
struct Hashtable * getConfig ()
 
TechnologygetTech ()
 
bool loaded ()
 
int addDependency (const char *name)
 
- Public Member Functions inherited from ActPass
 ActPass (Act *_a, const char *name, int doroot=0)
 
virtual ~ActPass ()
 release storage
 
void update (Process *p)
 
int rundeps (Process *p=NULL)
 
const char * getName ()
 
virtual int run (Process *p=NULL)
 
int completed ()
 
int pending ()
 
void * getMap (UserDef *u)
 
void * getGlobalInfo ()
 
ActgetAct ()
 
ActPassgetPass (const char *name)
 
ProcessgetRoot ()
 
virtual void run_recursive (Process *p=NULL, int mode=0)
 
void disableUpdate ()
 
void enableUpdate ()
 
void mkStickyVisited ()
 
void clrStickyVisited ()
 

Private Member Functions

virtual void * local_op (Process *, int=0)
 
virtual void * local_op (Channel *, int=0)
 
virtual void * local_op (Data *, int=0)
 
virtual void free_local (void *)
 

Private Attributes

bool _load_success
 flag set when the pass is loaded
 
char * _libused
 library used by this pass
 
act_sh_dispatch_table _d
 dispatch table for this pass
 
struct Hashtable * _params
 
struct Hashtable * _config_state
 
TechnologyT
 the technology pointer for the library
 

Static Private Attributes

static list_t * _sh_libs
 

Additional Inherited Members

- Static Public Member Functions inherited from ActPass
static void refreshAll (Act *a, Process *p=NULL)
 
- Protected Member Functions inherited from ActPass
virtual void _actual_update (Process *p)
 
int AddDependency (const char *pass)
 
- Protected Attributes inherited from ActPass
int _finished
 has the pass finished execution?
 
int _sticky_visited
 
Acta
 
list_t * deps
 
list_t * fwdeps
 
const char * name
 the name for the pass
 
int _update_propagate
 
int _root_dirty
 
Process_root
 the root of the design
 
void * _global_info
 

Detailed Description

This is an ActPass that is dynamically loaded in at run-time via a shared object library. A dynamic pass can be used to extend the Act framework at run-time without having to re-compile/statically link in new functionality. Apart from loading in new passes in at runtime via C++, the interact command-line interface to the Act system also supports loading in new passes at runtime.

An example of how to write a dynamic pass and load it into interact and run it is provided in the skeleton github repository available at https://github.com/asyncvlsi/actpass

Constructor & Destructor Documentation

◆ ActDynamicPass()

ActDynamicPass::ActDynamicPass ( Act _a,
const char *  name,
const char *  lib,
const char *  prefix 
)

Load a dynamic pass from a shared object file.

Parameters
_ais the Act design where the pass should be added
nameis the name of the ActPass
libis the shared object library name
prefixis the string prefix for the functions in the shared object library associated with the pass. Function names will be prefix_<name>

◆ ~ActDynamicPass()

ActDynamicPass::~ActDynamicPass ( )

release storage

Member Function Documentation

◆ addDependency()

int ActDynamicPass::addDependency ( const char *  name)
inline

This provides access to the protected ActPass::AddDependency() method since this call may be required from the dynamically loaded functions

Parameters
nameis the name of the pass for dependency tracking.
Returns
pass-through for ActPass::AddDependency()

◆ free_local()

virtual void ActDynamicPass::free_local ( void *  )
privatevirtual

Implementation of free_local() for dynamic pass.

Reimplemented from ActPass.

◆ getConfig()

struct Hashtable * ActDynamicPass::getConfig ( )

For internal use only. Used to get the hash table that holds all the config parameters.

Returns
the configuration parameter hash table.

◆ getIntParam()

int ActDynamicPass::getIntParam ( const char *  name)
Parameters
nameis the name of the parameter to be queried
Returns
the integer value associated with the parameter, -1 on a failure

◆ getPtrParam()

void * ActDynamicPass::getPtrParam ( const char *  name)
Parameters
nameis the name of the parameter to be queried
Returns
the pointer associated with the parameter, NULL on a failure

◆ getRealParam()

double ActDynamicPass::getRealParam ( const char *  name)
Parameters
nameis the name of the parameter to be queried
Returns
the real number associated with the parameter, -1 on a failure

◆ getTech()

Technology * ActDynamicPass::getTech ( )
inline

For internal use only. Used to get the Technology class

Returns
the technology class

◆ hasParam()

bool ActDynamicPass::hasParam ( const char *  name)
Parameters
nameis the name of the pameter to be queried
Returns
true if the parameter is defined, false otherwise.

◆ loaded()

bool ActDynamicPass::loaded ( )
inline
Returns
true if the pass was successfully loaded, false otherwise

◆ local_op() [1/3]

virtual void * ActDynamicPass::local_op ( Channel ,
int  = 0 
)
privatevirtual

Implementation of local_op() for dynamic pass.

Reimplemented from ActPass.

◆ local_op() [2/3]

virtual void * ActDynamicPass::local_op ( Data ,
int  = 0 
)
privatevirtual

Implementation of local_op() for dynamic pass.

Reimplemented from ActPass.

◆ local_op() [3/3]

virtual void * ActDynamicPass::local_op ( Process ,
int  = 0 
)
privatevirtual

Implementation of local_op() for dynamic pass.

Reimplemented from ActPass.

◆ run()

int ActDynamicPass::run ( Process p = NULL)
virtual

Implementation of ActPass::run() for a dynamic pass

Reimplemented from ActPass.

◆ run_recursive()

void ActDynamicPass::run_recursive ( Process p = NULL,
int  mode = 0 
)
virtual

Implementation of ActPass::run_recursive() for a dynamic pass

Reimplemented from ActPass.

◆ runcmd()

int ActDynamicPass::runcmd ( const char *  name)

This is used to run the specified command. Parameters to the command are typically passed using the setParam() methods.

Returns
returns the result from the runcmd function, -1 if the function does not exist.

◆ setParam() [1/3]

void ActDynamicPass::setParam ( const char *  name,
double  v 
)

To pass extra parameters to/from a dynamic pass, a table of parameters is stored with the dynamic pass. This function is used to set a real valued parameter

Parameters
namethe name of the parameter
vis the real number for the parameter

◆ setParam() [2/3]

void ActDynamicPass::setParam ( const char *  name,
int  v 
)

To pass extra parameters to/from a dynamic pass, a table of parameters is stored with the dynamic pass. This function is used to set an integer parameter

Parameters
namethe name of the parameter
vis the integer for the parameter

◆ setParam() [3/3]

void ActDynamicPass::setParam ( const char *  name,
void *  v 
)

To pass extra parameters to/from a dynamic pass, a table of parameters is stored with the dynamic pass. This function is used to set a pointer parameter

Parameters
namethe name of the parameter
vis the pointer

Member Data Documentation

◆ _config_state

struct Hashtable* ActDynamicPass::_config_state
private

hash table holding the config parameter state

◆ _d

act_sh_dispatch_table ActDynamicPass::_d
private

dispatch table for this pass

◆ _libused

char* ActDynamicPass::_libused
private

library used by this pass

◆ _load_success

bool ActDynamicPass::_load_success
private

flag set when the pass is loaded

◆ _params

struct Hashtable* ActDynamicPass::_params
private

hash table holding parameters for the pass

◆ _sh_libs

list_t* ActDynamicPass::_sh_libs
staticprivate

A list of shared object libraries stored as a list of act_sh_passlib_info pointers. THis is shared across all dynamic passes.

◆ T

Technology* ActDynamicPass::T
private

the technology pointer for the library


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