PandA-2024.02
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Private Attributes | Friends
structural_type_descriptor Struct Reference

Structure representing the most relevant information about the type of a structural object. More...

#include <structural_objects.hpp>

Public Types

enum  s_type {
  OTHER = 0, BOOL, INT, UINT,
  REAL, USER, VECTOR_BOOL, VECTOR_INT,
  VECTOR_UINT, VECTOR_REAL, VECTOR_USER, UNKNOWN
}
 Define the possible type of a structural object. More...
 

Public Member Functions

 structural_type_descriptor ()
 Constructor. More...
 
 structural_type_descriptor (const std::string &type_name, unsigned long long vector_size)
 Object factory. More...
 
 structural_type_descriptor (const std::string &module_name)
 Object factory for module objects. More...
 
 structural_type_descriptor (unsigned int index, const BehavioralHelperConstRef helper)
 Object factory used in HLS. More...
 
 ~structural_type_descriptor ()=default
 Destructor. More...
 
void copy (structural_type_descriptorRef dest)
 Method that copies the contents of the current structural_type_descriptorRef into another structural_type_descriptor. More...
 
const std::string get_name () const
 Returns the name of the type descriptor. More...
 
void xload (const xml_element *Enode, structural_type_descriptorRef owner)
 Load a structural_type_descriptor starting from an xml file. More...
 
void xwrite (xml_element *rootnode)
 Add a structural_type_descriptor to an xml tree. More...
 
void print (std::ostream &os) const
 function that prints the class. More...
 
std::string get_kind_text () const
 Definition of get_kind_text() More...
 

Static Public Member Functions

static bool check_type (structural_type_descriptorRef src_type, structural_type_descriptorRef dest_type)
 Check if two type descriptors are consistent. More...
 

Data Fields

s_type type
 The type of the port or the signal. More...
 
unsigned long long size
 The size of the object (in bit). The objects having a size are: ports, signals, channels, data, and actions. More...
 
unsigned long long vector_size
 The number of the elements of a vector. More...
 
std::string id_type
 Original type id of the structural object. More...
 
unsigned int treenode
 Treenode id of the type. More...
 

Static Private Attributes

static const char * s_typeNames []
 store the names of the enumerative s_type. More...
 
default values associated with the members of the structural_type_descriptor class.
static const s_type type_DEFAULT = OTHER
 
static const unsigned int treenode_DEFAULT = 0
 
static const unsigned int size_DEFAULT = 0
 
static const unsigned int vector_size_DEFAULT = 0
 

Friends

std::ostream & operator<< (std::ostream &os, const structural_type_descriptorRef o)
 Friend definition of the << operator. More...
 

Detailed Description

Structure representing the most relevant information about the type of a structural object.

In case the structural object is a signal or a port all member has a real meaning, while when the structural object is a channel, component, event, data or an action the only relevant information stored into the descriptor is the id_type and treenode when available. The size member has also a relevant meaning when a channel, data, and an action? is considered.

Definition at line 130 of file structural_objects.hpp.

Member Enumeration Documentation

◆ s_type

Define the possible type of a structural object.

Enumerator
OTHER 
BOOL 
INT 
UINT 
REAL 
USER 
VECTOR_BOOL 
VECTOR_INT 
VECTOR_UINT 
VECTOR_REAL 
VECTOR_USER 
UNKNOWN 

Definition at line 133 of file structural_objects.hpp.

Constructor & Destructor Documentation

◆ structural_type_descriptor() [1/4]

structural_type_descriptor::structural_type_descriptor ( )
inline

Constructor.

Definition at line 167 of file structural_objects.hpp.

Referenced by structural_type_descriptor().

Here is the caller graph for this function:

◆ structural_type_descriptor() [2/4]

structural_type_descriptor::structural_type_descriptor ( const std::string &  type_name,
unsigned long long  vector_size 
)

Object factory.

Parameters
type_nameis the string starting from which the object is built.
vector_sizeis the size of the the vector. In case vector_size is zero the descriptor type represents a scalar object, otherwise an array.

first set defaults

Definition at line 306 of file structural_objects.cpp.

References BOOL, INT, REAL, size, size_DEFAULT, THROW_ERROR, type, UINT, UNKNOWN, VECTOR_BOOL, VECTOR_INT, VECTOR_REAL, and VECTOR_UINT.

◆ structural_type_descriptor() [3/4]

structural_type_descriptor::structural_type_descriptor ( const std::string &  module_name)
inlineexplicit

Object factory for module objects.

Parameters
treenodeis the treenode descriptor of the type.

Definition at line 185 of file structural_objects.hpp.

References check_type(), copy(), get_name(), index, print(), structural_type_descriptor(), xload(), xwrite(), and ~structural_type_descriptor().

Here is the call graph for this function:

◆ structural_type_descriptor() [4/4]

structural_type_descriptor::structural_type_descriptor ( unsigned int  index,
const BehavioralHelperConstRef  helper 
)

◆ ~structural_type_descriptor()

structural_type_descriptor::~structural_type_descriptor ( )
default

Destructor.

Referenced by structural_type_descriptor().

Here is the caller graph for this function:

Member Function Documentation

◆ check_type()

bool structural_type_descriptor::check_type ( structural_type_descriptorRef  src_type,
structural_type_descriptorRef  dest_type 
)
static

Check if two type descriptors are consistent.

Parameters
src_typeis the first type descriptor.
dest_typeis the second type descriptor.
Returns
true if the two type descriptors are consistent.

Definition at line 511 of file structural_objects.cpp.

References BOOL, id_type, INT, structural_object::PP, print(), REAL, size, THROW_WARNING, treenode, treenode_DEFAULT, type, UINT, UNKNOWN, USER, VECTOR_BOOL, VECTOR_INT, vector_size, and VECTOR_UINT.

Referenced by WB4_interface::build_WB4_complete_logic(), structural_manager::check_type(), and structural_type_descriptor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy()

void structural_type_descriptor::copy ( structural_type_descriptorRef  dest)

Method that copies the contents of the current structural_type_descriptorRef into another structural_type_descriptor.

Parameters
destis the reference to the structural_type_descriptor where the contents have to be written

Definition at line 170 of file structural_objects.cpp.

References id_type, size, treenode, type, and vector_size.

Referenced by structural_object::copy(), signal_o::get_lsb(), fu_binding::join_merge_split(), and structural_type_descriptor().

Here is the caller graph for this function:

◆ get_kind_text()

std::string structural_type_descriptor::get_kind_text ( ) const
inline

Definition of get_kind_text()

Definition at line 248 of file structural_objects.hpp.

Referenced by xwrite().

Here is the caller graph for this function:

◆ get_name()

const std::string structural_type_descriptor::get_name ( ) const

Returns the name of the type descriptor.

Definition at line 90 of file structural_objects.cpp.

References s_typeNames, type, and UNKNOWN.

Referenced by structural_manager::add_connection(), conn_binding::add_datapath_connection(), classic_datapath::add_ports(), structural_type_descriptor(), and VHDL_writer::write_port_binding().

Here is the caller graph for this function:

◆ print()

void structural_type_descriptor::print ( std::ostream &  os) const

◆ xload()

void structural_type_descriptor::xload ( const xml_element Enode,
structural_type_descriptorRef  owner 
)

Load a structural_type_descriptor starting from an xml file.

Parameters
nodeis a node of the xml tree.
owneris the refcount version of this.

Definition at line 102 of file structural_objects.cpp.

References BOOL, CE_XVM, id_type, LOAD_XVFM, LOAD_XVM, s_typeNames, size, THROW_ASSERT, treenode, type, type_DEFAULT, UNKNOWN, and vector_size.

Referenced by signal_o::get_lsb(), structural_type_descriptor(), and structural_object::xload().

Here is the caller graph for this function:

◆ xwrite()

void structural_type_descriptor::xwrite ( xml_element rootnode)

Add a structural_type_descriptor to an xml tree.

Parameters
rootnodeis the root node at which the xml representation of the structural type descriptor is attached.

Definition at line 145 of file structural_objects.cpp.

References xml_child::add_child_element(), get_kind_text(), id_type, s_typeNames, size, size_DEFAULT, treenode, treenode_DEFAULT, type, type_DEFAULT, vector_size, WRITE_XNVM, and WRITE_XVM.

Referenced by signal_o::get_lsb(), structural_type_descriptor(), and structural_object::xwrite().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const structural_type_descriptorRef  o 
)
friend

Friend definition of the << operator.

Definition at line 256 of file structural_objects.hpp.

Field Documentation

◆ id_type

std::string structural_type_descriptor::id_type

◆ s_typeNames

const char * structural_type_descriptor::s_typeNames
staticprivate
Initial value:
= {"OTHER", "BOOL", "INT", "UINT",
"REAL", "USER", "VECTOR_BOOL", "VECTOR_INT",
"VECTOR_UINT", "VECTOR_REAL", "VECTOR_USER", "UNKNOWN"}

store the names of the enumerative s_type.

Definition at line 276 of file structural_objects.hpp.

Referenced by get_name(), legalize(), xload(), and xwrite().

◆ size

unsigned long long structural_type_descriptor::size

◆ size_DEFAULT

const unsigned int structural_type_descriptor::size_DEFAULT = 0
staticprivate

Definition at line 272 of file structural_objects.hpp.

Referenced by structural_type_descriptor(), and xwrite().

◆ treenode

unsigned int structural_type_descriptor::treenode

Treenode id of the type.

Definition at line 162 of file structural_objects.hpp.

Referenced by minimal_interface::build_wrapper(), check_type(), copy(), print(), structural_type_descriptor(), xload(), and xwrite().

◆ treenode_DEFAULT

const unsigned int structural_type_descriptor::treenode_DEFAULT = 0
staticprivate

Definition at line 271 of file structural_objects.hpp.

Referenced by check_type(), and xwrite().

◆ type

s_type structural_type_descriptor::type

◆ type_DEFAULT

const s_type structural_type_descriptor::type_DEFAULT = OTHER
staticprivate

Definition at line 270 of file structural_objects.hpp.

Referenced by xload(), and xwrite().

◆ vector_size

unsigned long long structural_type_descriptor::vector_size

◆ vector_size_DEFAULT

const unsigned int structural_type_descriptor::vector_size_DEFAULT = 0
staticprivate

Definition at line 273 of file structural_objects.hpp.

Referenced by structural_type_descriptor().


The documentation for this struct was generated from the following files:

Generated on Mon Feb 12 2024 13:04:05 for PandA-2024.02 by doxygen 1.8.13