PandA-2024.02
mux_obj.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  */
45 #ifndef MUX_OBJ_HPP
46 #define MUX_OBJ_HPP
47 
48 #include "refcount.hpp"
49 
50 #include "generic_obj.hpp"
51 #include "graph.hpp"
52 
57 class mux_obj : public generic_obj
58 {
60  unsigned int bitsize;
61 
64 
67 
70 
73 
76 
78  unsigned int level;
79 
80  public:
89  mux_obj(const generic_objRef first, const generic_objRef second, unsigned int level, const std::string& name,
90  const generic_objRef overall_target);
91 
95  ~mux_obj() override;
96 
101  void set_target(const generic_objRef tgt);
102 
108 
113  generic_objRef GetSelector() const;
114 
119  void set_selector(const generic_objRef sel);
120 
124  unsigned int get_level() const;
125 
129  void add_bitsize(unsigned int _bitsize)
130  {
131  bitsize = _bitsize > bitsize ? _bitsize : bitsize;
132  }
133 
137  unsigned int get_bitsize() const;
138 };
139 
142 
143 #endif
generic_objRef get_final_target()
Returns the object which will receive the mux tree result.
Definition: mux_obj.cpp:64
generic_objRef target
reference to generic_obj associated with the multiplexer
Definition: mux_obj.hpp:69
generic_objRef tree_target
reference to generic_obj target of the mux tree&#39;s dataflow
Definition: mux_obj.hpp:72
Class specification of the graph structures.
mux_obj(const generic_objRef first, const generic_objRef second, unsigned int level, const std::string &name, const generic_objRef overall_target)
This is the constructor of the object class.
Definition: mux_obj.cpp:46
std::string name
connection obj id
unsigned int get_level() const
Return the level of the multiplexer.
Definition: mux_obj.cpp:79
~mux_obj() override
Destructor.
Base class for all resources into datapath.
unsigned int level
depth level of the mux
Definition: mux_obj.hpp:78
Generic class managing all resources into datapath.
Definition: generic_obj.hpp:66
unsigned int get_bitsize() const
return the maximum bitsize associated with the component
Definition: mux_obj.cpp:83
Template definition of refcount.
const generic_objRef second
reference to generic_obj associated with second input (when selector is FALSE, it&#39;s connected to out)...
Definition: mux_obj.hpp:66
unsigned int bitsize
number of bit of in/out ports
Definition: mux_obj.hpp:60
void add_bitsize(unsigned int _bitsize)
add a size to the component
Definition: mux_obj.hpp:129
void set_target(const generic_objRef tgt)
Sets target object for multiplexer.
Definition: mux_obj.cpp:59
generic_objRef GetSelector() const
Gets the selector.
Definition: mux_obj.cpp:69
generic_objRef selector
selector object. It can be both a port or the root of a logic gate
Definition: mux_obj.hpp:75
void set_selector(const generic_objRef sel)
Sets the element representing the selector.
Definition: mux_obj.cpp:74
const generic_objRef first
reference to generic_obj associated with first input (when selector is TRUE, it&#39;s connected to out) ...
Definition: mux_obj.hpp:63
This class is a specialization of generic_obj class to represent a multiplexer into the datapath...
Definition: mux_obj.hpp:57

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