ACT Library
|
This pass is used to pre-process information about languages and variables within the design. The pass computes the act_boolean_netlist_t data structure, which contains information about all the local variables used by the process. More...
#include <booleanize.h>
Public Member Functions | |
ActBooleanizePass (Act *a) | |
constructor | |
~ActBooleanizePass () | |
release storage | |
int | run (Process *p=NULL) |
act_boolean_netlist_t * | getBNL (Process *p) |
void | createNets (Process *p=NULL) |
void | Print (FILE *fp, Process *p) |
![]() | |
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 () |
Act * | getAct () |
ActPass * | getPass (const char *name) |
Process * | getRoot () |
virtual void | run_recursive (Process *p=NULL, int mode=0) |
void | disableUpdate () |
void | enableUpdate () |
void | mkStickyVisited () |
void | clrStickyVisited () |
Static Public Member Functions | |
static act_dynamic_var_t * | isDynamicRef (act_boolean_netlist_t *, act_connection *) |
static act_dynamic_var_t * | isDynamicRef (act_boolean_netlist_t *, ActId *) |
![]() | |
static void | refreshAll (Act *a, Process *p=NULL) |
Private Member Functions | |
void * | local_op (Process *p, int mode=0) |
void | free_local (void *) |
act_boolean_netlist_t * | _create_local_bools (Process *p) |
void | _print (Process *p) |
void | flatten_ports_to_bools (act_boolean_netlist_t *n, ActId *prefix, Scope *s, UserDef *u, int nochp) |
void | update_used_flags (act_boolean_netlist_t *n, ValueIdx *vx, Process *p) |
void | rec_update_used_flags (act_boolean_netlist_t *n, act_boolean_netlist_t *subinst, ActId *prefix, Scope *s, UserDef *u, int *count, int *count2) |
void | append_base_port (act_boolean_netlist_t *n, act_connection *c, Type *t, int mode) |
void | _createNets (Process *p) |
int | addNet (act_boolean_netlist_t *n, act_connection *c) |
void | addPin (act_boolean_netlist_t *n, int netid, const char *name, Array *a, act_connection *pin) |
void | importPins (act_boolean_netlist_t *n, int netid, const char *name, Array *a, act_local_net_t *net) |
Private Attributes | |
int | black_box_mode |
int | _create_nets_run |
FILE * | _fp |
Additional Inherited Members | |
![]() | |
virtual void | _actual_update (Process *p) |
int | AddDependency (const char *pass) |
![]() | |
int | _finished |
has the pass finished execution? | |
int | _sticky_visited |
Act * | a |
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 |
This pass is used to pre-process information about languages and variables within the design. The pass computes the act_boolean_netlist_t data structure, which contains information about all the local variables used by the process.
The reason this is called "Booleanize" is that channels/integers are expanded out into collections of Booleans as specified by the user. For example, imagine the following program:
Running the Booleanize pass will expand out the ports for test
into l.t
, l.f
, l.e
, r.t
, r.f
, r.e
. These will be part of the Boolean port list (the ports array). The CHP level of abstraction would have ports l
and r
, since we treat those as channels for CHP level modeling, and so those two variables will appear in the chpports array but not the ports array.
If in the above example l.e
and r.e
are connected to each other internally within test
, then one of the two ports will be marked as omitted using the omit
flag (see the netlist_bool_port).
ActBooleanizePass::ActBooleanizePass | ( | Act * | a | ) |
constructor
ActBooleanizePass::~ActBooleanizePass | ( | ) |
release storage
|
private |
This is the local call to create the act_boolean_netlist_t data structure for the process. This assumes that all child processes have been processed already.
p | is the Process of interest |
|
private |
Helper function for createNets()
|
private |
Helper function to print local process info
p | is the local process Implicitly uses _fp as the output file. |
|
private |
Helper function for createNets()
|
private |
Helper function for createNets()
|
private |
Helper function for update_used_flags()
n | is the netlist where the port is to be appended |
c | is the new port |
t | is the Type for the port |
mode | is 0 if this is both a CHP and Boolean port, 1 if this is Boolean-only, and 2 if it is CHP-only |
void ActBooleanizePass::createNets | ( | Process * | p = NULL | ) |
Create net data structure that contains a netname and instance names + pins
p | is the top level process |
|
private |
Recursively expand out ports into their consitituent leaf types
prefix | is used to construct the full ActId name for the expanded port component. This is the prefix to the current instance. |
n | is the boolean netlist data structure |
s | is the parent scope of the current user defined object |
u | is the current user-defined object |
nochp | is a flag saying we've broken down a channel so skip for chp |
|
privatevirtual |
act_boolean_netlist_t * ActBooleanizePass::getBNL | ( | Process * | p | ) |
p | is a pointer to a process; NULL means the top-level global namespace (the global scope, external to any process) |
|
private |
Helper function for createNets()
|
static |
|
static |
|
privatevirtual |
void ActBooleanizePass::Print | ( | FILE * | fp, |
Process * | p | ||
) |
Print ports/flags computed.
|
private |
Helper function for update_used_flags().
n | is the netlist where the update should be done |
subinst | is the netlist of current instance |
prefix | is the prefix to current instance |
s | is the scope in which the instance exists |
u | is the user-defined type corresponding to the prefix |
count | is the in/out used to track instports to make things simpler for other tools |
count2 | is the same as count, but for chp ports |
|
virtual |
Run the pass
p | is the top-level process. Must be an expanded process. (NULL means the global namespace scope) |
Reimplemented from ActPass.
|
private |
Update the used flags in the current act_boolean_netlist_t, based on connections to the ports of a specific instance of a process type
p | is the process type |
vx | is a process instance of type Process p. |
n | is the netlist where the flags should be updated. |
|
private |
set to 1 if the creatNets() operation has already been run.
|
private |
used internally as the FILE pointer for printing.
|
private |
if set to 1, this pass operates in "black box" mode. In this mode, an empty process is assumed to correspond to an external black box macro and hence all the ports are assumed to exist even though they are not referenced within the process.