PandA-2024.02
mux_obj.cpp
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  */
44 #include "mux_obj.hpp"
45 
46 mux_obj::mux_obj(const generic_objRef _first, const generic_objRef _second, unsigned int _level,
47  const std::string& _name, const generic_objRef overall_target)
48  : generic_obj(CONNECTION_ELEMENT, _name),
49  bitsize(0),
50  first(_first),
51  second(_second),
52  tree_target(overall_target),
53  level(_level)
54 {
55 }
56 
57 mux_obj::~mux_obj() = default;
58 
60 {
61  target = tgt;
62 }
63 
65 {
66  return tree_target;
67 }
68 
70 {
71  return selector;
72 }
73 
75 {
76  selector = sel;
77 }
78 
79 unsigned int mux_obj::get_level() const
80 {
81  return level;
82 }
83 unsigned int mux_obj::get_bitsize() const
84 {
85  return bitsize;
86 }
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
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
unsigned int get_level() const
Return the level of the multiplexer.
Definition: mux_obj.cpp:79
~mux_obj() override
Destructor.
Base class for multiplexer 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
unsigned int bitsize
number of bit of in/out ports
Definition: mux_obj.hpp:60
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
int level
Definition: main.c:98
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

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