User-defined processes.
More...
#include <types.h>
|
| Process (UserDef *u) |
|
virtual | ~Process () |
|
void | MkCell () |
|
int | isCell () |
|
Process * | Expand (ActNamespace *ns, Scope *s, int nt, inst_param *u) |
|
void | Print (FILE *fp) |
|
int | isBlackBox () |
|
int | isLowLevelBlackBox () |
|
void | addIface (InstType *iface, list_t *imap) |
|
int | hasIface (InstType *x, int weak) |
|
list_t * | findMap (InstType *iface) |
|
bool | updateInst (char *name, Process *t) |
|
const char * | addBuffer (char *name, ActId *port, Process *buf) |
|
const char * | addBuffer (Process *buf, list_t *inst_ports) |
|
Process * | getUnexpanded () |
|
void | recordGlobal (ActId *id) |
|
int | findGlobal (ActId *id) |
|
int | findGlobal (const char *s) |
|
| UserDef (ActNamespace *ns) |
|
| UserDef (UserDef *x) |
|
virtual | ~UserDef () |
| destructor, releases storage
|
|
const char * | getFile () |
|
void | setFile (const char *s) |
|
int | getLine () |
|
void | setLine (int num) |
|
int | IsExported () |
|
void | MkExported () |
|
int | isExpanded () const |
|
int | AddMetaParam (InstType *t, const char *id) |
|
int | AddPort (InstType *t, const char *id) |
|
int | FindPort (const char *id) |
|
const char * | getPortName (int pos) const |
|
InstType * | getPortType (int pos) const |
|
void | refinePortType (int pos, InstType *u) |
|
const char * | getName () |
|
char * | getFullName () |
|
void | printActName (FILE *fp) |
|
int | isEqual (const Type *t) const |
|
void | setName (const char *s) |
|
void | MkCopy (UserDef *u) |
|
int | isEqual (const UserDef *u) const |
|
void | SetParent (InstType *t) |
|
InstType * | getParent () const |
|
int | isDefined () |
|
void | MkDefined () |
|
int | isPort (const char *name) |
|
int | getNumParams () const |
|
int | getRemainingParams () const |
|
int | getNumPorts () const |
|
InstType * | Lookup (ActId *id) |
|
InstType * | Lookup (const char *nm) |
|
Scope * | CurScope () |
|
int | isStrictPort (const char *name) |
|
virtual void | Print (FILE *) |
|
void | PrintHeader (FILE *fp, const char *type) |
|
void | setBody (ActBody *x) |
|
void | AppendBody (ActBody *x) |
|
ActBody * | getBody () |
|
UserDef * | Expand (ActNamespace *, Scope *, int, inst_param *) |
|
UserDef * | Expand (ActNamespace *ns, Scope *s, int nt, inst_param *u, int *cache_hit, int is_process=0) |
|
ActNamespace * | getns () |
|
InstType * | root () const |
|
act_prs * | getprs () |
|
act_spec * | getspec () |
|
act_languages * | getlang () |
|
int | isLeaf () |
|
void | mkRefined () |
|
int | hasRefinement () |
|
UserMacro * | newMacro (const char *name) |
|
UserMacro * | getMacro (const char *name) |
|
| Type () |
|
| ~Type () |
| constructor
|
|
virtual const char * | getName ()=0 |
| destructor
|
|
virtual Type * | Expand (ActNamespace *ns, Scope *s, int nt, inst_param *ip)=0 |
|
virtual int | isEqual (const Type *t) const =0 |
|
|
enum | direction {
NONE = 0
, IN = 1
, OUT = 2
, INOUT = 3
,
OUTIN = 4
} |
|
static void | Init () |
|
static const char * | dirstring (direction d) |
|
int | emitMacros (FILE *fp) |
|
| A_DECL (UserMacro *, um) |
| user-defined macros
|
|
InstType * | parent |
| implementation relationship, if any
|
|
unsigned int | defined:1 |
| 1 if this has been defined, 0 otherwise
|
|
unsigned int | expanded:1 |
| 1 if this has been expanded, 0 otherwise
|
|
unsigned int | pending:1 |
| 1 if this is currently being expanded, 0 otherwise
|
|
unsigned int | exported:1 |
| 1 if the type is exported, 0 otherwise
|
|
act_languages * | lang |
| sub-languages within this type
|
|
int | nt |
| number of template parameters
|
|
InstType ** | pt |
| parameter types
|
|
const char ** | pn |
| parameter names
|
|
int | nports |
| number of ports
|
|
InstType ** | port_t |
| port types
|
|
const char ** | port_n |
| port names
|
|
Scope * | I |
| instances
|
|
const char * | name |
| Name of the user-defined type.
|
|
ActBody * | b |
| body of user-defined type
|
|
ActNamespace * | _ns |
| namespace within which this type is defined
|
|
UserDef * | unexpanded |
| unexpanded type, if any
|
|
int | level |
| default modeling level for the type
|
|
const char * | file |
| file name (if known) where this was defined
|
|
int | lineno |
| line number (if known) where this was defined
|
|
int | has_refinement |
| 1 if there is a refinement body
|
|
int | inherited_templ |
| number of inherited template parameters
|
|
inst_param ** | inherited_param |
| the inherited parameters
|
|
◆ Process()
Construct a process from a UserDef
- Parameters
-
◆ ~Process()
virtual Process::~Process |
( |
| ) |
|
|
virtual |
◆ addBuffer() [1/2]
const char * Process::addBuffer |
( |
char * |
name, |
|
|
ActId * |
port, |
|
|
Process * |
buf |
|
) |
| |
Buffer insertion
Take name.port, disconnect it from whatever it is driving, and then create a new instance "buf" (has to have one input port and one output port).
port has to be either a simple id or id[num]
- Parameters
-
name | is the instance name |
port | is the port within the instance |
buf | is the buffer type |
- Returns
- the name of the newly created buffer instance, or NULL if it failed.
◆ addBuffer() [2/2]
const char * Process::addBuffer |
( |
Process * |
buf, |
|
|
list_t * |
inst_ports |
|
) |
| |
Similar to the single buffer addition, except that a list of end-points are disconnected. Each of them must be connected to the same primary name, must be disconnectable, and must all be input pins
◆ addIface()
void Process::addIface |
( |
InstType * |
iface, |
|
|
list_t * |
imap |
|
) |
| |
Add an interface specification that this process exports. Note that a process can export multiple interfaces.
- Parameters
-
iface | is the interface exported |
imap | is the name mapping from the process ports to the interface ports |
◆ Expand()
Here in case someone called the wrong Expand!
Reimplemented from UserDef.
◆ findGlobal() [1/2]
int Process::findGlobal |
( |
ActId * |
id | ) |
|
- Parameters
-
id | is the name of the signal |
- Returns
- 1 if the global signal was found in the recorded global signal list, 0 otherwise.
◆ findGlobal() [2/2]
int Process::findGlobal |
( |
const char * |
s | ) |
|
- Parameters
-
s | is the name of the signal |
- Returns
- 1 if the global signal was found in the recorded global signal list, 0 otherwise
◆ findMap()
list_t * Process::findMap |
( |
InstType * |
iface | ) |
|
- Returns
- the port name map for the interface exported by this process
◆ getUnexpanded()
Process * Process::getUnexpanded |
( |
| ) |
|
- Returns
- the unexpanded type from which this one was generated
◆ hasIface()
int Process::hasIface |
( |
InstType * |
x, |
|
|
int |
weak |
|
) |
| |
Weak check for interface equality
◆ isBlackBox()
int Process::isBlackBox |
( |
| ) |
|
- Returns
- 1 if this is a black-box definition, 0 otherwise
◆ isCell()
- Returns
- 1 if this is a cell, 0 otherwise
◆ isLowLevelBlackBox()
int Process::isLowLevelBlackBox |
( |
| ) |
|
A low level blackbox: might have CHP, HSE, or dataflow models, but does not have any circuits (prs) and is a leaf cell. Low level black boxes are used to provide a simulation model, but where the circuit implementation is provided by a macro. This is used for memories, for example.
- Returns
- 1 if this is a low-level black box, 0 otherwise
◆ MkCell()
This process is actually a defcell
◆ Print()
void Process::Print |
( |
FILE * |
| ) |
|
|
virtual |
Print out user defined type
Reimplemented from UserDef.
◆ recordGlobal()
void Process::recordGlobal |
( |
ActId * |
id | ) |
|
record the usage of a global signal
- Parameters
-
id | is the global signal name |
◆ updateInst()
bool Process::updateInst |
( |
char * |
name, |
|
|
Process * |
t |
|
) |
| |
Take "name" and replace its base type with "t" For this to succeed, "t" must have exactly the same port list as the orginal type for "name"
- Returns
- true on success, false on failure.
◆ bufcnt
used to generate unique buffer names for buffer insertion
◆ ifaces
a mixed list of interface, map pairs. The map is also a list of oldname, newname pairs
◆ is_cell
unsigned int Process::is_cell |
|
private |
1 if this is a defcell, 0 otherwise
◆ used_globals
list_t* Process::used_globals |
|
private |
list of used globals as ActId pointers
The documentation for this class was generated from the following file: