The main Act class used to read in an ACT file and create basic data structures. All design information can be accessed through this data structure.
More...
#include <act.h>
|
| Act (const char *s=NULL) |
|
| ~Act () |
|
void | Merge (const char *s) |
|
bool | LocalizeGlobal (const char *s) |
|
void | Expand () |
|
void | mangle (char *s) |
|
int | mangle_set_char (unsigned char c) |
|
int | mangle_active () |
|
int | mangle_string (const char *src, char *dst, int sz) |
|
int | unmangle_string (const char *src, char *dst, int sz) |
|
void | mfprintf (FILE *fp, const char *s,...) |
|
void | ufprintf (FILE *fp, const char *s,...) |
|
int | msnprintf (char *fp, int sz, const char *s,...) |
|
int | usnprintf (char *fp, int sz, const char *s,...) |
|
void | msnprintfproc (char *fp, int sz, UserDef *u, int omit_ns=0) |
|
void | mfprintfproc (FILE *fp, UserDef *u, int omit_ns=0) |
|
int | unmangle_stringproc (const char *src, char *dst, int sz) |
|
Process * | findProcess (const char *s, bool allow_expand=false) |
|
Process * | findProcess (ActNamespace *ns, const char *s, bool allow_expand=false) |
|
UserDef * | findUserdef (const char *s) |
|
ActNamespace * | findNamespace (const char *s) |
|
ActNamespace * | findNamespace (ActNamespace *ns, const char *s) |
|
ActNamespace * | Global () |
|
void | Print (FILE *fp) |
|
void | pass_register (const char *name, ActPass *p) |
|
ActPass * | pass_find (const char *name) |
|
void | pass_unregister (const char *name) |
|
const char * | pass_name (const char *name) |
|
list_t * | getDecomp (Process *p) |
|
list_t * | getDecompTypes () |
|
TypeFactory * | getTypeFactory () |
|
int | getLevel () |
| get default level
|
|
int | getLevel (Process *p) |
| get level for this type
|
|
int | getLevel (ActId *id) |
| get level for this instance
|
|
int | getRefSteps () |
|
void | decRefSteps () |
|
void | incRefSteps () |
|
|
static void | Init (int *argc, char ***argv, const char *optional_conf) |
|
static void | Init (int *argc, char ***argv, list_t *multi_conf=NULL) |
|
static int | getOptions (int *argc, char ***argv) |
|
static void | setOptionString (char *str) |
|
static void | config_info (const char *s) |
|
static void | generic_msg (const char *s) |
|
|
static int | _process_act_arg (const char *argvp, int *tech_specified, char **conf) |
|
|
static Log * | L |
| Used for log messages.
|
|
static char * | _getopt_string |
| the string used for getopt
|
|
The main Act class used to read in an ACT file and create basic data structures. All design information can be accessed through this data structure.
◆ Act()
Act::Act |
( |
const char * |
s = NULL | ) |
|
Create an act data structure for the specified input file
- Parameters
-
s | is the name of the file containing the top-level ACT. If NULL, then the library is initialized without any ACT file being read. |
◆ ~Act()
◆ _process_act_arg()
static int Act::_process_act_arg |
( |
const char * |
argvp, |
|
|
int * |
tech_specified, |
|
|
char ** |
conf |
|
) |
| |
|
staticprivate |
Internal function used to actually process an argument, used to avoid replicating code.
◆ config_info()
static void Act::config_info |
( |
const char * |
s | ) |
|
|
static |
◆ decRefSteps()
void Act::decRefSteps |
( |
| ) |
|
|
inline |
decrement the number of remaining refinement steps
◆ Expand()
Expand types. This expands the entire design, updating the data structures stored in the Act class.
◆ findNamespace() [1/2]
Find a namespace nested within another namespace
- Parameters
-
ns | is the parent namespace |
s | is the name of the nested namespace |
- Returns
- the ActNamespace pointer if found, NULL otherwise
◆ findNamespace() [2/2]
Find a namespace.
- Parameters
-
s | is the name of the namespace |
- Returns
- the ActNamespace pointer if found, NULL otherwise
◆ findProcess() [1/2]
Find a process within a namespace
- Parameters
-
s | is the name of the process |
ns | is the ACT namespace |
allow_expand | if set to true, then if the process has angle brackets then findProcess is allowed to expand the process |
- Returns
- the process pointer if found, NULL otherwise
◆ findProcess() [2/2]
Process * Act::findProcess |
( |
const char * |
s, |
|
|
bool |
allow_expand = false |
|
) |
| |
Find a process given a name
- Parameters
-
s | is the name of the process |
allow_expand | if set to true, then if the process has angle brackets then findProcess is allowed to expand the process |
- Returns
- process pointer, or NULL if not found
◆ findUserdef()
UserDef * Act::findUserdef |
( |
const char * |
s | ) |
|
Find a user-defined type
- Parameters
-
- Returns
- the UserDef pointer if found, NULL otherwise
◆ generic_msg()
static void Act::generic_msg |
( |
const char * |
s | ) |
|
|
static |
◆ getDecomp()
list_t * Act::getDecomp |
( |
Process * |
p | ) |
|
Certain ACT passes can re-write the ACT and introduce decomposed processes. Currently the chpmem and chparb passes have this property, as they extract parts of the CHP and introduce new processes/instances. This method returns a list of list of ValueIdx pointers generated by the decomposition passes.
- Parameters
-
p | is the Process to query for any decomposed components |
- Returns
- a list of list of ValueIdx pointers. The list could be NULL if nothing exists.
◆ getDecompTypes()
list_t * Act::getDecompTypes |
( |
| ) |
|
- Returns
- a list of Process pointers that were generated during decomposition, if any. See the getDecomp() method for more details.
◆ getLevel() [1/3]
◆ getLevel() [2/3]
int Act::getLevel |
( |
ActId * |
id | ) |
|
get level for this instance
◆ getLevel() [3/3]
◆ getOptions()
static int Act::getOptions |
( |
int * |
argc, |
|
|
char *** |
argv |
|
) |
| |
|
static |
When the ACT library is used as part of a scripting language, it is sometimes useful for the script to initiate argument processing. This function is used to process command-line arguments, and create auxillary data structures to record the options specified by the user. The option string (ala getopt()) is set by the setOptionString() method.
- Parameters
-
argc | is a pointer to argc (command-line processing) |
argv | is a pointer to argv (command-line processing) |
- Returns
- 1 if this succeeded, 0 if there was an error during command-line argument processing.
◆ getRefSteps()
return the remaining refinement steps
◆ getTypeFactory()
Returns the type factory used to manipulate/create types.
- Returns
- the TypeFactory used by the ACT library.
◆ Global()
◆ incRefSteps()
void Act::incRefSteps |
( |
| ) |
|
|
inline |
increment the number of remaining refinement steps
◆ Init() [1/2]
static void Act::Init |
( |
int * |
argc, |
|
|
char *** |
argv, |
|
|
const char * |
optional_conf |
|
) |
| |
|
static |
Initialize the ACT library. *argc and *argv are modified to reflect the command-line options left after ACT has extracted the ones it understands
- Parameters
-
argc | is a pointer to argc (command-line processing) |
argv | is a pointer to argv (command-line processing) |
optional_conf | is a file name for an optional configuration file that must be loaded as part of the initialization. A configation name can be of the form prefix:file.conf . Here the names in the configuration file are assumed to be enclosed in a begin prefix /end group. |
◆ Init() [2/2]
static void Act::Init |
( |
int * |
argc, |
|
|
char *** |
argv, |
|
|
list_t * |
multi_conf = NULL |
|
) |
| |
|
static |
Another initialization method, supporting multiple configuration files. *argc and *argv are modified to reflect the command-line options left after ACT has extracted the ones it understands
- Parameters
-
argc | is a pointer to argc (command-line processing) |
argv | is a pointer to argv (command-line processing) |
multi_conf | is a list of strings, each corresponding to a configuration file name (same as the simple Init method). All the configuration files are loaded as part of the initialization. |
◆ LocalizeGlobal()
bool Act::LocalizeGlobal |
( |
const char * |
s | ) |
|
Change global signal to use the port list throughout the design.
- Parameters
-
s | is the name of the global signal |
- Returns
- true on success, false on error
◆ mangle()
void Act::mangle |
( |
char * |
s | ) |
|
Install string mangling functionality
- Parameters
-
s | is a string corresponding to the list of characters to be mangled. |
◆ mangle_active()
int Act::mangle_active |
( |
| ) |
|
|
inline |
- Returns
- 1 if mangling is active, 0 otherwise
◆ mangle_set_char()
int Act::mangle_set_char |
( |
unsigned char |
c | ) |
|
Specify the character used as the prefix for the name mangling procedure.
- Parameters
-
c | is the character used as the name mangling character. |
◆ mangle_string()
int Act::mangle_string |
( |
const char * |
src, |
|
|
char * |
dst, |
|
|
int |
sz |
|
) |
| |
mangle string from src to dst.
- Parameters
-
src | is the source string |
dst | is the destination string |
sz | is the space available in the destination string |
- Returns
- 0 on success, -1 on error
◆ Merge()
void Act::Merge |
( |
const char * |
s | ) |
|
Merge in ACT file "s" into current ACT database
- Parameters
-
s | is the name of an ACT file |
◆ mfprintf()
void Act::mfprintf |
( |
FILE * |
fp, |
|
|
const char * |
s, |
|
|
|
... |
|
) |
| |
Mangle fprintf functionality. This provides an fprintf() API, except the output is mangled.
- Parameters
-
fp | output file pointer |
s | format string |
◆ mfprintfproc()
void Act::mfprintfproc |
( |
FILE * |
fp, |
|
|
UserDef * |
u, |
|
|
int |
omit_ns = 0 |
|
) |
| |
Non-standard mangling for user-defined types
- Parameters
-
fp | is the output file |
u | is the user-defined type |
omit_ns | is 1 if you don't want to include the namespace in the string |
◆ msnprintf()
int Act::msnprintf |
( |
char * |
fp, |
|
|
int |
sz, |
|
|
const char * |
s, |
|
|
|
... |
|
) |
| |
Mangle snprintf functionality. This provides an snprintf() API, except the output is mangled.
- Parameters
-
fp | output string buffer |
sz | size of the output buffer |
s | format string |
- Returns
- snprintf() result
◆ msnprintfproc()
void Act::msnprintfproc |
( |
char * |
fp, |
|
|
int |
sz, |
|
|
UserDef * |
u, |
|
|
int |
omit_ns = 0 |
|
) |
| |
Non-standard mangling for user-defined types.
- Parameters
-
fp | is the output buffer |
sz | is the size of the output buffer |
u | is the user-defined type |
omit_ns | is 1 if you don't want to include the namespace in the string |
◆ pass_find()
ActPass * Act::pass_find |
( |
const char * |
name | ) |
|
Search for a pass by its registered name.
- Parameters
-
name | is the name of the pass |
- Returns
- the ActPass that is registered by the specified name, NULL if the pass does not exist.
◆ pass_name()
const char * Act::pass_name |
( |
const char * |
name | ) |
|
- Returns
- an immutable string that corresponds to the pass name, NULL if the pass does not exist
- Parameters
-
name | is the name of the pass of interest |
◆ pass_register()
void Act::pass_register |
( |
const char * |
name, |
|
|
ActPass * |
p |
|
) |
| |
Register an ActPass with the ACT library
- Parameters
-
name | is the name of the pass |
p | is the ActPass to be registered |
◆ pass_unregister()
void Act::pass_unregister |
( |
const char * |
name | ) |
|
Remove a previosly registered ActPass from the ACT library
- Parameters
-
name | is the name of the pass |
◆ Print()
void Act::Print |
( |
FILE * |
fp | ) |
|
Prints the entire ACT data structure to a file.
- Parameters
-
fp | is the file pointer to which the output is written. |
◆ setOptionString()
static void Act::setOptionString |
( |
char * |
str | ) |
|
|
static |
This function works together with getOptions() and is used to specify the option string for command-line argument processing.
- Parameters
-
str | is the getopt string for arguments |
◆ ufprintf()
void Act::ufprintf |
( |
FILE * |
fp, |
|
|
const char * |
s, |
|
|
|
... |
|
) |
| |
Unmangle fprintf functionality. This provides an fprintf() API, except the output is unmangled.
- Parameters
-
fp | output file pointer |
s | format string |
◆ unmangle_string()
int Act::unmangle_string |
( |
const char * |
src, |
|
|
char * |
dst, |
|
|
int |
sz |
|
) |
| |
unmangle string from src to dst.
- Parameters
-
src | is the source string |
dst | is the destination string |
sz | is the space available in the destination string |
- Returns
- 0 on success, -1 on error
◆ unmangle_stringproc()
int Act::unmangle_stringproc |
( |
const char * |
src, |
|
|
char * |
dst, |
|
|
int |
sz |
|
) |
| |
Unmangle string, assuming this is a process name and was mangled with process mangling. Same arguments and return value as unmangle_string().
◆ usnprintf()
int Act::usnprintf |
( |
char * |
fp, |
|
|
int |
sz, |
|
|
const char * |
s, |
|
|
|
... |
|
) |
| |
Unmangle snprintf functionality. This provides an snprintf() API, except the output is mangled.
- Parameters
-
fp | output string buffer |
sz | size of the output buffer |
s | format string |
- Returns
- snprintf() result
◆ _getopt_string
char* Act::_getopt_string |
|
staticprivate |
the string used for getopt
◆ any_mangling
1 if there is any name mangling, 0 otherwise
◆ cmdline_args
list_t* Act::cmdline_args |
|
static |
Command-line arguments if -opt= is used. Used to record the options from setOptionString().
◆ default_level
the default modeling level
file, corresponds to the instance string table for each modeling level
◆ emit_depend
Parser flags. If this is set, then the names of .act files read in during parsing are printed out. This is used by the adepend
tool, which can be useful when writing Makefiles.
◆ gns
the global namespace pointer
◆ inst_levels
◆ inv_map
map used for inverse lookup
◆ mangle_characters
int Act::mangle_characters[256] |
|
private |
which characters do we mangle?
◆ max_loop_iterations
int Act::max_loop_iterations |
|
static |
Maximum number of iterations for general loops
◆ max_recurse_depth
int Act::max_recurse_depth |
|
static |
Maximum depth of recursion for expanding types
◆ num_inst_levels
read from configuration file, corresponds to the size of the instance table for each modeling level
◆ num_type_levels
read from configuration file, corresponds to the size of the type table for each modeling level
◆ passes
struct Hashtable* Act::passes |
|
private |
◆ refine_steps
number of refinement steps to process
◆ tf
type factory for the Act instance
◆ type_levels
read from configuration file, the type string table for each modeling level
The documentation for this class was generated from the following file: