PandA-2024.02
Public Types | Public Member Functions | Protected Attributes | Friends
generic_obj Class Reference

Generic class managing all resources into datapath. More...

#include <generic_obj.hpp>

Inheritance diagram for generic_obj:
Inheritance graph
[legend]
Collaboration diagram for generic_obj:
Collaboration graph
[legend]

Public Types

enum  resource_type {
  FUNCTIONAL_UNIT = 0, REGISTER, MULTI_UNBOUNDED_OBJ, COMMAND_PORT,
  DATA_PORT, CONNECTION_ELEMENT, ADDER_CONN_OBJ, UU_CONV_CONN_OBJ,
  UI_CONV_CONN_OBJ, IU_CONV_CONN_OBJ, II_CONV_CONN_OBJ, FF_CONV_CONN_OBJ,
  I_ASSIGN_CONN_OBJ, U_ASSIGN_CONN_OBJ, F_ASSIGN_CONN_OBJ
}
 Admissible resource types. More...
 

Public Member Functions

 generic_obj (const resource_type t, const std::string &_name)
 This is the constructor of the object class. More...
 
virtual ~generic_obj ()=default
 Destructor. More...
 
void print (std::ostream &os) const
 Prints elements into given stream. More...
 
const std::string get_string () const
 Returns the name associated with the element. More...
 
unsigned int get_type () const
 Return generic_obj type. More...
 
void set_structural_obj (const structural_objectRef &SM_)
 Sets structural_object associated to this object. More...
 
void set_out_sign (const structural_objectRef &out_sign_)
 Sets structural_object of output signal associated to this object. More...
 
const structural_objectRef get_structural_obj () const
 Gets structural_object associated to this object. More...
 
const structural_objectRef get_out_sign () const
 Gets structural_object of output signal associated to this object. More...
 
bool operator< (const generic_obj &other) const
 

Protected Attributes

const resource_type type
 type of resource More...
 
Wrefcount< structural_objectSM
 structural_object associated to element More...
 
Wrefcount< structural_objectout_sign
 output signal associated to element. More...
 
std::string name
 connection obj id More...
 

Friends

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

Detailed Description

Generic class managing all resources into datapath.

Definition at line 66 of file generic_obj.hpp.

Member Enumeration Documentation

◆ resource_type

Admissible resource types.

Enumerator
FUNCTIONAL_UNIT 
REGISTER 

a functional resource

MULTI_UNBOUNDED_OBJ 

a register

COMMAND_PORT 

a multi unbounded controller

DATA_PORT 

a command port (mainly connections from/to controller)

CONNECTION_ELEMENT 

a data port (in/out data)

ADDER_CONN_OBJ 

an element used for connecting the resources (e.g., muxes)

UU_CONV_CONN_OBJ 

an adder object representation used to compute some addresses

UI_CONV_CONN_OBJ 

a converter from unsigned to unsigned int

IU_CONV_CONN_OBJ 

a converter from unsigned to signed int

II_CONV_CONN_OBJ 

a converter from signed to unsigned int

FF_CONV_CONN_OBJ 

a converter from signed to signed int

I_ASSIGN_CONN_OBJ 

a converter from real to real int

U_ASSIGN_CONN_OBJ 

specify the type of a connection object: INT

F_ASSIGN_CONN_OBJ 

specify the type of a connection object: UINT

Definition at line 70 of file generic_obj.hpp.

Constructor & Destructor Documentation

◆ generic_obj()

generic_obj::generic_obj ( const resource_type  t,
const std::string &  _name 
)
inline

This is the constructor of the object class.

Definition at line 107 of file generic_obj.hpp.

References ~generic_obj().

Here is the call graph for this function:

◆ ~generic_obj()

virtual generic_obj::~generic_obj ( )
virtualdefault

Destructor.

Referenced by generic_obj().

Here is the caller graph for this function:

Member Function Documentation

◆ get_out_sign()

const structural_objectRef generic_obj::get_out_sign ( ) const
inline

Gets structural_object of output signal associated to this object.

Returns
a reference to structural_object of signal associated

Definition at line 187 of file generic_obj.hpp.

References Wrefcount< T >::lock(), and operator<().

Referenced by fu_binding::add_to_SM(), and conn_binding::mux_connection().

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

◆ get_string()

const std::string generic_obj::get_string ( ) const
inline

◆ get_structural_obj()

const structural_objectRef generic_obj::get_structural_obj ( ) const
inline

Gets structural_object associated to this object.

Returns
a reference to structural_object associated

Definition at line 178 of file generic_obj.hpp.

References Wrefcount< T >::lock().

Referenced by conn_binding::add_command_ports(), conn_binding::mux_allocation(), conn_binding::mux_connection(), and conn_binding::specialise_mux().

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

◆ get_type()

unsigned int generic_obj::get_type ( ) const
inline

Return generic_obj type.

See also
generic_obj::resource_type to get more details on meaning of value
Returns
an integer representing resource type

Definition at line 151 of file generic_obj.hpp.

References type.

Referenced by conn_binding::add_command_ports().

Here is the caller graph for this function:

◆ operator<()

bool generic_obj::operator< ( const generic_obj other) const
Parameters
otheris the second operand
Returns
this < other

Definition at line 79 of file generic_obj.cpp.

References get_string().

Referenced by get_out_sign().

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

◆ print()

void generic_obj::print ( std::ostream &  os) const
inline

Prints elements into given stream.

Parameters
osis the selected stream

Definition at line 120 of file generic_obj.hpp.

References name.

Referenced by conn_binding::mux_connection().

Here is the caller graph for this function:

◆ set_out_sign()

void generic_obj::set_out_sign ( const structural_objectRef out_sign_)
inline

Sets structural_object of output signal associated to this object.

Parameters
SM_is reference to structural_object of signal to be associated

Definition at line 169 of file generic_obj.hpp.

Referenced by classic_datapath::add_ports(), and conn_binding::mux_connection().

Here is the caller graph for this function:

◆ set_structural_obj()

void generic_obj::set_structural_obj ( const structural_objectRef SM_)
inline

Sets structural_object associated to this object.

Parameters
SM_is reference to structural_object to be associated

Definition at line 160 of file generic_obj.hpp.

Referenced by classic_datapath::add_ports(), reg_binding::add_to_SM(), and fu_binding::add_to_SM().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const generic_obj s 
)
friend

Friend definition of the << operator.

Parameters
osis output stream
sis object to be written
Returns
the stream where the object is written

Definition at line 131 of file generic_obj.hpp.

Field Documentation

◆ name

std::string generic_obj::name
protected

connection obj id

Definition at line 101 of file generic_obj.hpp.

Referenced by get_string(), and print().

◆ out_sign

Wrefcount<structural_object> generic_obj::out_sign
protected

output signal associated to element.

It allows to connect multiple elements to output of this object. So broadcast communication is possible

Definition at line 98 of file generic_obj.hpp.

◆ SM

Wrefcount<structural_object> generic_obj::SM
protected

structural_object associated to element

Definition at line 94 of file generic_obj.hpp.

◆ type

const resource_type generic_obj::type
protected

type of resource

Definition at line 91 of file generic_obj.hpp.

Referenced by get_type().


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

Generated on Mon Feb 12 2024 13:03:53 for PandA-2024.02 by doxygen 1.8.13