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

User-defined processes. More...

#include <types.h>

Inheritance diagram for Process:
UserDef Type

Public Member Functions

 Process (UserDef *u)
 
virtual ~Process ()
 
void MkCell ()
 
int isCell ()
 
ProcessExpand (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)
 
ProcessgetUnexpanded ()
 
void recordGlobal (ActId *id)
 
int findGlobal (ActId *id)
 
int findGlobal (const char *s)
 
- Public Member Functions inherited from UserDef
 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
 
InstTypegetPortType (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)
 
InstTypegetParent () const
 
int isDefined ()
 
void MkDefined ()
 
int isPort (const char *name)
 
int getNumParams () const
 
int getRemainingParams () const
 
int getNumPorts () const
 
InstTypeLookup (ActId *id)
 
InstTypeLookup (const char *nm)
 
ScopeCurScope ()
 
int isStrictPort (const char *name)
 
virtual void Print (FILE *)
 
void PrintHeader (FILE *fp, const char *type)
 
void setBody (ActBody *x)
 
void AppendBody (ActBody *x)
 
ActBodygetBody ()
 
UserDefExpand (ActNamespace *, Scope *, int, inst_param *)
 
UserDefExpand (ActNamespace *ns, Scope *s, int nt, inst_param *u, int *cache_hit, int is_process=0)
 
ActNamespacegetns ()
 
InstTyperoot () const
 
act_prsgetprs ()
 
act_specgetspec ()
 
act_languagesgetlang ()
 
int isLeaf ()
 
void mkRefined ()
 
int hasRefinement ()
 
UserMacronewMacro (const char *name)
 
UserMacrogetMacro (const char *name)
 
- Public Member Functions inherited from Type
 Type ()
 
 ~Type ()
 constructor
 
virtual const char * getName ()=0
 destructor
 
virtual TypeExpand (ActNamespace *ns, Scope *s, int nt, inst_param *ip)=0
 
virtual int isEqual (const Type *t) const =0
 

Private Attributes

unsigned int is_cell:1
 1 if this is a defcell, 0 otherwise
 
list_t * ifaces
 
list_t * used_globals
 
int bufcnt
 

Additional Inherited Members

- Public Types inherited from Type
enum  direction {
  NONE = 0 , IN = 1 , OUT = 2 , INOUT = 3 ,
  OUTIN = 4
}
 
- Static Public Member Functions inherited from Type
static void Init ()
 
static const char * dirstring (direction d)
 
- Protected Member Functions inherited from UserDef
int emitMacros (FILE *fp)
 
 A_DECL (UserMacro *, um)
 user-defined macros
 
- Protected Attributes inherited from UserDef
InstTypeparent
 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_languageslang
 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
 
ScopeI
 instances
 
const char * name
 Name of the user-defined type.
 
ActBodyb
 body of user-defined type
 
ActNamespace_ns
 namespace within which this type is defined
 
UserDefunexpanded
 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
 

Detailed Description

User-defined processes.

Constructor & Destructor Documentation

◆ Process()

Process::Process ( UserDef u)

Construct a process from a UserDef

Parameters
uis the UserDef

◆ ~Process()

virtual Process::~Process ( )
virtual

Member Function Documentation

◆ 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
nameis the instance name
portis the port within the instance
bufis 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
ifaceis the interface exported
imapis the name mapping from the process ports to the interface ports

◆ Expand()

Process * Process::Expand ( ActNamespace ,
Scope ,
int  ,
inst_param  
)
virtual

Here in case someone called the wrong Expand!

Reimplemented from UserDef.

◆ findGlobal() [1/2]

int Process::findGlobal ( ActId id)
Parameters
idis 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
sis 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()

int Process::isCell ( )
inline
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()

void Process::MkCell ( )
inline

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
idis 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.

Member Data Documentation

◆ bufcnt

int Process::bufcnt
private

used to generate unique buffer names for buffer insertion

◆ ifaces

list_t* Process::ifaces
private

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: