PandA-2024.02
mux_conn.hpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
46 #ifndef _MUX_CONN_HPP_
47 #define _MUX_CONN_HPP_
48 
49 #include <utility>
50 
51 #include "connection_obj.hpp"
52 #include "generic_obj.hpp"
53 #include "refcount.hpp"
54 
55 #include "op_graph.hpp"
56 
61 class mux_conn : public connection_obj
62 {
66  std::vector<std::pair<generic_objRef, unsigned int>> mux_tree;
67 
68  public:
75  const std::vector<std::pair<generic_objRef, unsigned int>>& _mux_tree)
76  : connection_obj(BY_MUX, _live_variable), mux_tree(_mux_tree)
77  {
78  }
79 
83  ~mux_conn() override = default;
84 
89  const std::string get_string() const override
90  {
91  THROW_ASSERT(mux_tree.size() > 0, "Mux connection without any multiplexer associated");
92  return mux_tree[0].first->get_string() + (mux_tree[0].second == T_COND ? "(T)" : "(F)");
93  }
94 
99  std::vector<std::pair<generic_objRef, unsigned int>> get_mux_tree() const
100  {
101  return mux_tree;
102  }
103 
108  unsigned int get_mux_tree_size() const
109  {
110  return static_cast<unsigned int>(mux_tree.size());
111  }
112 };
115 
116 #endif
This class is used to represent a connection through multiplexers.
Definition: mux_conn.hpp:61
~mux_conn() override=default
Destructor.
Base class for all resources into datapath.
#define T_COND
constant used to represent control edges representing a true edge of a conditional statement...
const std::string get_string() const override
Returns the name associated with the element.
Definition: mux_conn.hpp:89
Generic class managing elements used to interconnect generic objects into datapath.
Template definition of refcount.
mux_conn(const CustomOrderedSet< data_transfer > &_live_variable, const std::vector< std::pair< generic_objRef, unsigned int >> &_mux_tree)
Constructor.
Definition: mux_conn.hpp:74
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
std::vector< std::pair< generic_objRef, unsigned int > > get_mux_tree() const
Returns the mux tree associated with the connection.
Definition: mux_conn.hpp:99
std::vector< std::pair< generic_objRef, unsigned int > > mux_tree
It&#39;s sequence of multiplexer inputs to drive the signal from the source element to the target one...
Definition: mux_conn.hpp:66
unsigned int get_mux_tree_size() const
Returns the number of multiplexers required to implement the connection.
Definition: mux_conn.hpp:108
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...
Definition: exceptions.hpp:289

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