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

User-defined channel type. Channels can be unidirectional or bi-directional (sometimes called exchange channels). More...

#include <types.h>

Inheritance diagram for Channel:
UserDef Type

Public Member Functions

 Channel (UserDef *u)
 
virtual ~Channel ()
 
void setMethod (int t, act_chp_lang *h)
 
void setMethod (int t, Expr *e)
 
act_chp_langgetMethod (int t)
 
ExprgeteMethod (int t)
 
void copyMethods (Channel *c)
 
ChannelExpand (ActNamespace *ns, Scope *s, int nt, inst_param *u)
 
void Print (FILE *fp)
 
int chanDir (ActId *id, int isinput)
 
int mustbeActiveSend ()
 
int mustbeActiveRecv ()
 
int isBiDirectional ()
 
- 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

struct act_chp_langmethods [ACT_NUM_STD_METHODS]
 methods table
 
Expremethods [ACT_NUM_EXPR_METHODS]
 emethods table
 

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 channel type. Channels can be unidirectional or bi-directional (sometimes called exchange channels).

Constructor & Destructor Documentation

◆ Channel()

Channel::Channel ( UserDef u)

◆ ~Channel()

virtual Channel::~Channel ( )
virtual

Member Function Documentation

◆ chanDir()

int Channel::chanDir ( ActId id,
int  isinput 
)

Check the direction flags for an identifier that is part of the channel.

Given that the id has the direction specified, what is the channel direction? 1 = input, 2 = output, 3 = both, 0 = undetermined id is typically a fragmented piece of the channel, and hence this involves examining the channel methods as well.

Parameters
idis the part of the channel to be inspected
isinputis 1 to check on the direction of the type assuming a "?" operation, 0 if it is a "!" operation
Returns
0, 1, 2, or 3 (see above).

◆ copyMethods()

void Channel::copyMethods ( Channel c)

Copy methods over from the specified channel. This copies pointers over—i.e. a shallow copy

Parameters
cis the Channel from whom methods should be copied over

◆ Expand()

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

Here in case someone called the wrong Expand!

Reimplemented from UserDef.

◆ geteMethod()

Expr * Channel::geteMethod ( int  t)
inline
Returns
similar to getMethod(), but returns the expression for e-methods

◆ getMethod()

act_chp_lang * Channel::getMethod ( int  t)
inline

Similar to Data::getMethod()

◆ isBiDirectional()

int Channel::isBiDirectional ( )
inline

For this to work the channel must have a parent definition.

Returns
1 if this is a bidirectional channel, 0 otherwise

◆ mustbeActiveRecv()

int Channel::mustbeActiveRecv ( )

One end of a channel is active and the other is passive. Only one end of the channel can be probed, and this checks if a probe has been defined that dictates the active v/s passive end of the channel.

Returns
1 if the receive on this channel must be active, 0 if it must be passive, -1 if it is not determined by the channel type

◆ mustbeActiveSend()

int Channel::mustbeActiveSend ( )

One end of a channel is active and the other is passive. Only one end of the channel can be probed, and this checks if a probe has been defined that dictates the active v/s passive end of the channel.

Returns
1 if the send of this channel must be active, 0 if it must be passive, -1 if it is not determined by the channel type

◆ Print()

void Channel::Print ( FILE *  )
virtual

Print out user defined type

Reimplemented from UserDef.

◆ setMethod() [1/2]

void Channel::setMethod ( int  t,
act_chp_lang h 
)
inline

Similar to Data::setMethod()

◆ setMethod() [2/2]

void Channel::setMethod ( int  t,
Expr e 
)
inline

Similar to setMethod(), but used to set methods that return expressions

Parameters
tis the method number (from the datatype_methods enumeration)
eis the expression to be used as the return value

Member Data Documentation

◆ emethods

Expr* Channel::emethods[ACT_NUM_EXPR_METHODS]
private

emethods table

◆ methods

struct act_chp_lang* Channel::methods[ACT_NUM_STD_METHODS]
private

methods table


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