PandA-2024.02
Public Member Functions | Static Public Attributes | Private Attributes
signal_o Class Reference

This class describes a simple logic/RTL signal. More...

#include <structural_objects.hpp>

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

Public Member Functions

 signal_o (int debug_level, const structural_objectRef o, so_kind _signal_type)
 Constructor. More...
 
 ~signal_o () override=default
 Destructor. More...
 
void add_port (structural_objectRef p)
 Bind the connection object with a port. More...
 
void remove_port (structural_objectRef s)
 remove the connection of this signal with a port More...
 
bool is_connected (structural_objectRef s) const
 
void substitute_port (structural_objectRef old_conn, structural_objectRef new_conn)
 
void set_critical ()
 set the signal as critical with respect to the timing path More...
 
bool get_critical () const
 return if the component is critical or not More...
 
const structural_objectRef get_port (unsigned int n) const
 Return the ith port bounded to the connection. More...
 
structural_objectRef get_port (unsigned int n)
 Return the ith port bounded to the connection. More...
 
unsigned int get_connected_objects_size () const
 Return the number of ports associated with the connection. More...
 
bool is_full_connected () const
 Return if signal has both input and output. More...
 
void add_n_signals (unsigned int n_signals, structural_objectRef owner)
 Specify the number of ports of a generic port_vector object and add its corresponding ports. More...
 
const structural_objectRef get_signal (unsigned int n) const
 Return the ith port of the vector. More...
 
const structural_objectRef get_positional_signal (unsigned int n) const
 Return the ith port of the vector with respect to lsb. More...
 
unsigned int get_signals_size () const
 Return the number of ports. More...
 
unsigned int get_lsb () const
 return the index of the least significant port More...
 
void copy (structural_objectRef dest) const override
 Perform a copy of the signal. More...
 
structural_objectRef find_member (const std::string &id, so_kind type, const structural_objectRef owner) const override
 Return the object named id of a given type which belongs to or it is associated with the object. More...
 
structural_objectRef find_isomorphic (const structural_objectRef key) const override
 Find key in this object. More...
 
void xload (const xml_element *Enode, structural_objectRef owner, structural_managerRef const &CM) override
 Load a structural_object starting from an xml file. More...
 
void xwrite (xml_element *rootnode) override
 Add a structural_object to an xml tree. More...
 
void print (std::ostream &os) const override
 Print the signal (for debug purpose) More...
 
std::string get_kind_text () const override
 return the name of the class as a string. More...
 
enum so_kind get_kind () const override
 return the type of the class More...
 
- Public Member Functions inherited from structural_object
 structural_object (int debug_level, const structural_objectRef o)
 Constructor for the structural_object. More...
 
virtual ~structural_object ()=default
 virtual destructor More...
 
const structural_objectRef get_owner () const
 Return the owner. More...
 
void set_owner (const structural_objectRef new_owner)
 set the owner of the structural object More...
 
void set_treenode (unsigned int n)
 Set the treenode id associated with the structural_object. More...
 
unsigned int get_treenode () const
 Return the treenode id associated with the structural_object. More...
 
void set_id (const std::string &s)
 Set the identifier associated with the structural_object. More...
 
const std::string & get_id () const
 Return the identifier associated with the structural_object. More...
 
void set_type (const structural_type_descriptorRef &s)
 Set the type of the structural_object. More...
 
const structural_type_descriptorRefget_typeRef () const
 Return the type descriptor of the structural_object. More...
 
void type_resize (unsigned long long new_bit_size)
 Just resize the size of the bits of the object. More...
 
void type_resize (unsigned long long new_bit_size, unsigned long long new_vec_size)
 resizing of vector objects More...
 
void set_black_box (bool bb)
 Set the black box property associated with the structural_object. More...
 
bool get_black_box () const
 Return the black box property. More...
 
void SetParameter (const std::string &name, const std::string &value)
 Set a parameter value. More...
 
bool ExistsParameter (std::string name) const
 Check if a parameter has been specified. More...
 
std::string GetParameter (std::string name) const
 Get the value associated to parameter if it has been associated; if it has not specified returns the default. More...
 
std::string GetDefaultParameter (std::string name) const
 Get the value associated to parameter if it has been associate; It throws an exception if it has not been associated. More...
 
CustomMap< std::string, std::string > GetParameters () const
 return the whole set of parameters More...
 
virtual void AddParameter (const std::string &name, const std::string &default_value)
 Add a parameter. More...
 
const std::string get_path () const
 Return a unique identifier of the structural object. More...
 

Static Public Attributes

static const unsigned int PARAMETRIC_SIGNAL = static_cast<unsigned int>(-1)
 

Private Attributes

std::vector< Wrefcount< structural_object > > connected_objects
 List of ports bound to the signal object. More...
 
bool is_critical
 when true the signal is involved into the critical path of the netlist More...
 
std::vector< structural_objectRefsignals_
 The list of signals associated with the vector of signals. More...
 
unsigned int lsb
 
so_kind signal_type
 port type More...
 

Additional Inherited Members

- Protected Member Functions inherited from structural_object
std::string convert_so_short (so_kind in) const
 Convert a so_kind in a short string. More...
 
- Protected Attributes inherited from structural_object
friend structural_manager
 
int debug_level
 debug level for the object More...
 
- Static Protected Attributes inherited from structural_object
static simple_indent PP
 pretty print functor object used by all print members to indent the output of the print function. More...
 

Detailed Description

This class describes a simple logic/RTL signal.

A signal can be an array of bit but it cannot be sliced or partially accessed. In case of partial access or slicing the bus_connection_o object should be used.

Definition at line 1576 of file structural_objects.hpp.

Constructor & Destructor Documentation

◆ signal_o()

signal_o::signal_o ( int  debug_level,
const structural_objectRef  o,
so_kind  _signal_type 
)

Constructor.

Parameters
ois the owner of the port

Definition at line 2406 of file structural_objects.cpp.

Referenced by add_n_signals(), copy(), and xload().

Here is the caller graph for this function:

◆ ~signal_o()

signal_o::~signal_o ( )
overridedefault

Destructor.

Member Function Documentation

◆ add_n_signals()

void signal_o::add_n_signals ( unsigned int  n_signals,
structural_objectRef  owner 
)

Specify the number of ports of a generic port_vector object and add its corresponding ports.

It can be done only on port_vectors not yet specialized. The type of the port is equal to the type descriptor of the port_vector.

Parameters
n_signalsis the number of signals.
owneris the reference version of "this".

Definition at line 2822 of file structural_objects.cpp.

References structural_object::debug_level, refcount< T >::get(), structural_object::get_typeRef(), PARAMETRIC_SIGNAL, structural_object::set_id(), structural_object::set_type(), signal_o(), signal_o_K, signal_type, signal_vector_o_K, signals_, and THROW_ASSERT.

Here is the call graph for this function:

◆ add_port()

void signal_o::add_port ( structural_objectRef  p)

Bind the connection object with a port.

Parameters
pis the port

Definition at line 2421 of file structural_objects.cpp.

References connected_objects, and THROW_ASSERT.

Referenced by xload().

Here is the caller graph for this function:

◆ copy()

void signal_o::copy ( structural_objectRef  dest) const
overridevirtual

Perform a copy of the signal.

Parameters
destdestination object.

someone has to take care of connected_objects

Reimplemented from structural_object.

Definition at line 2633 of file structural_objects.cpp.

References structural_object::copy(), structural_object::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, structural_object::get_path(), is_critical, lsb, PRINT_DBG_MEX, set_critical(), signal_o(), signal_o_K, and signals_.

Here is the call graph for this function:

◆ find_isomorphic()

structural_objectRef signal_o::find_isomorphic ( const structural_objectRef  key) const
overridevirtual

Find key in this object.

Parameters
keyis the object searched.

Please pay attention to this: connected_objects are not built in this moment! check first the if key is part of a port vector

port_vector at the same level

primary ports

simple port at the same level

search key in the owner

search the owner of the key and then the key

Implements structural_object.

Definition at line 2652 of file structural_objects.cpp.

References action_o_K, bus_connection_o_K, channel_o_K, component_o_K, constant_o_K, data_o_K, event_o_K, structural_object::get_id(), structural_object::get_kind(), structural_object::get_owner(), port_o_K, port_vector_o_K, signal_o_K, signal_vector_o_K, signals_, THROW_ASSERT, and THROW_ERROR.

Here is the call graph for this function:

◆ find_member()

structural_objectRef signal_o::find_member ( const std::string &  id,
so_kind  type,
const structural_objectRef  owner 
) const
overridevirtual

Return the object named id of a given type which belongs to or it is associated with the object.

Parameters
idis the identifier of the object we are looking for.
typeis the type of the object we are looking for.
owneris the owner of the object named id.

Implements structural_object.

Definition at line 2591 of file structural_objects.cpp.

References action_o_K, bus_connection_o_K, channel_o_K, component_o_K, connected_objects, constant_o_K, data_o_K, event_o_K, structural_object::get_kind_text(), port_o_K, port_vector_o_K, signal_o_K, signal_vector_o_K, signals_, and THROW_ERROR.

Here is the call graph for this function:

◆ get_connected_objects_size()

unsigned int signal_o::get_connected_objects_size ( ) const

Return the number of ports associated with the connection.

Definition at line 2524 of file structural_objects.cpp.

References connected_objects.

◆ get_critical()

bool signal_o::get_critical ( ) const

return if the component is critical or not

Definition at line 2416 of file structural_objects.cpp.

References is_critical.

◆ get_kind()

enum so_kind signal_o::get_kind ( ) const
inlineoverridevirtual

return the type of the class

Implements structural_object.

Definition at line 1731 of file structural_objects.hpp.

◆ get_kind_text()

std::string signal_o::get_kind_text ( ) const
inlineoverridevirtual

return the name of the class as a string.

Implements structural_object.

Definition at line 1717 of file structural_objects.hpp.

References signal_vector_o_K.

Referenced by xwrite().

Here is the caller graph for this function:

◆ get_lsb()

unsigned int signal_o::get_lsb ( ) const
inline

return the index of the least significant port

Definition at line 1668 of file structural_objects.hpp.

References structural_type_descriptor::copy(), key, structural_type_descriptor::print(), structural_type_descriptor::xload(), and structural_type_descriptor::xwrite().

Here is the call graph for this function:

◆ get_port() [1/2]

const structural_objectRef signal_o::get_port ( unsigned int  n) const

Return the ith port bounded to the connection.

Parameters
nis the index of the port.

Definition at line 2435 of file structural_objects.cpp.

References connected_objects, and THROW_ASSERT.

◆ get_port() [2/2]

structural_objectRef signal_o::get_port ( unsigned int  n)

Return the ith port bounded to the connection.

Parameters
nis the index of the port.

Definition at line 2441 of file structural_objects.cpp.

References connected_objects, structural_object::get_path(), STR, and THROW_ASSERT.

Here is the call graph for this function:

◆ get_positional_signal()

const structural_objectRef signal_o::get_positional_signal ( unsigned int  n) const

Return the ith port of the vector with respect to lsb.

It also checks if the port exists

Parameters
nis the index of the port

Definition at line 2848 of file structural_objects.cpp.

References lsb, signals_, and THROW_ASSERT.

◆ get_signal()

const structural_objectRef signal_o::get_signal ( unsigned int  n) const

Return the ith port of the vector.

It checks that a port exists at position n.

Parameters
nis the index of the port

Definition at line 2840 of file structural_objects.cpp.

References structural_object::get_path(), signals_, STR, and THROW_ASSERT.

Here is the call graph for this function:

◆ get_signals_size()

unsigned int signal_o::get_signals_size ( ) const

Return the number of ports.

When the port_vector has not yet specialized 0 is returned.

Definition at line 2854 of file structural_objects.cpp.

References signals_, and THROW_ASSERT.

◆ is_connected()

bool signal_o::is_connected ( structural_objectRef  s) const

Definition at line 2465 of file structural_objects.cpp.

References connected_objects, and THROW_ASSERT.

◆ is_full_connected()

bool signal_o::is_full_connected ( ) const

Return if signal has both input and output.

Returns
true if signal has both input and output

Definition at line 2529 of file structural_objects.cpp.

References connected_objects, and structural_object::get_owner().

Here is the call graph for this function:

◆ print()

void signal_o::print ( std::ostream &  os) const
overridevirtual

Print the signal (for debug purpose)

Parameters
osis an output stream

Reimplemented from structural_object.

Definition at line 2791 of file structural_objects.cpp.

References connected_objects, structural_object::convert_so_short(), structural_object::PP, structural_object::print(), and signals_.

Here is the call graph for this function:

◆ remove_port()

void signal_o::remove_port ( structural_objectRef  s)

remove the connection of this signal with a port

Parameters
sis the connection

Definition at line 2447 of file structural_objects.cpp.

References connected_objects, and THROW_ASSERT.

◆ set_critical()

void signal_o::set_critical ( )

set the signal as critical with respect to the timing path

Definition at line 2411 of file structural_objects.cpp.

References is_critical.

Referenced by copy().

Here is the caller graph for this function:

◆ substitute_port()

void signal_o::substitute_port ( structural_objectRef  old_conn,
structural_objectRef  new_conn 
)

Definition at line 2483 of file structural_objects.cpp.

References connected_objects, and THROW_ASSERT.

◆ xload()

void signal_o::xload ( const xml_element Enode,
structural_objectRef  owner,
structural_managerRef const &  CM 
)
overridevirtual

Load a structural_object starting from an xml file.

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

someone has to take care of the connected_objects

Reimplemented from structural_object.

Definition at line 2714 of file structural_objects.cpp.

References add_port(), component_o_K, structural_object::find_member(), xml_child::get_children(), GET_CLASS_NAME, structural_manager::get_debug_level(), structural_object::get_id(), structural_object::get_kind(), structural_object::get_owner(), legalize(), lsb, max, min, port_o_K, port_vector_o_K, structural_object::set_id(), signal_o(), signal_o_K, signal_type, signal_vector_o_K, signals_, THROW_ASSERT, and structural_object::xload().

Here is the call graph for this function:

◆ xwrite()

void signal_o::xwrite ( xml_element rootnode)
overridevirtual

Add a structural_object to an xml tree.

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

Reimplemented from structural_object.

Definition at line 2776 of file structural_objects.cpp.

References xml_child::add_child_element(), connected_objects, get_kind_text(), structural_object::get_path(), test_panda::lock, signals_, WRITE_XNVM2, and structural_object::xwrite().

Here is the call graph for this function:

Field Documentation

◆ connected_objects

std::vector<Wrefcount<structural_object> > signal_o::connected_objects
private

List of ports bound to the signal object.

Definition at line 1738 of file structural_objects.hpp.

Referenced by add_port(), find_member(), get_connected_objects_size(), get_port(), is_connected(), is_full_connected(), print(), remove_port(), substitute_port(), and xwrite().

◆ is_critical

bool signal_o::is_critical
private

when true the signal is involved into the critical path of the netlist

Definition at line 1741 of file structural_objects.hpp.

Referenced by copy(), get_critical(), and set_critical().

◆ lsb

unsigned int signal_o::lsb
private

Definition at line 1746 of file structural_objects.hpp.

Referenced by copy(), get_positional_signal(), and xload().

◆ PARAMETRIC_SIGNAL

const unsigned int signal_o::PARAMETRIC_SIGNAL = static_cast<unsigned int>(-1)
static

Definition at line 1579 of file structural_objects.hpp.

Referenced by add_n_signals(), and structural_manager::add_sign_vector().

◆ signal_type

so_kind signal_o::signal_type
private

port type

Definition at line 1749 of file structural_objects.hpp.

Referenced by add_n_signals(), and xload().

◆ signals_

std::vector<structural_objectRef> signal_o::signals_
private

The list of signals associated with the vector of signals.

Definition at line 1744 of file structural_objects.hpp.

Referenced by add_n_signals(), copy(), find_isomorphic(), find_member(), get_positional_signal(), get_signal(), get_signals_size(), print(), xload(), and xwrite().


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

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