PandA-2024.02
adder_conn_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 ADDER_CONN_OBJ_HPP
46 #define ADDER_CONN_OBJ_HPP
47 
48 #include "generic_obj.hpp"
49 
55 {
57  unsigned long long bitsize;
58 
61 
63  unsigned int trimmed_bits;
64 
65  public:
69  adder_conn_obj(const std::string& _name)
70  : generic_obj(ADDER_CONN_OBJ, _name), bitsize(0), is_aligned_adder_p(false), trimmed_bits(0)
71  {
72  }
73 
77  ~adder_conn_obj() override = default;
78 
82  void add_bitsize(unsigned long long _bitsize)
83  {
84  bitsize = _bitsize > bitsize ? _bitsize : bitsize;
85  }
86 
90  unsigned long long get_bitsize() const
91  {
92  return bitsize;
93  }
94 
96  void set_trimmed_bits(unsigned int _trimmed_bits)
97  {
98  is_aligned_adder_p = true;
99  trimmed_bits = _trimmed_bits;
100  }
101 
103  unsigned int get_trimmed_bits() const
104  {
105  return trimmed_bits;
106  }
107 
109  bool is_align_adder() const
110  {
111  return is_aligned_adder_p;
112  }
113 };
114 
115 #endif // ADDER_CONN_OBJ_HPP
an element used for connecting the resources (e.g., muxes)
Definition: generic_obj.hpp:78
unsigned long long bitsize
number of bit of in/out ports
bool is_align_adder() const
return true in case the addition is aligned
unsigned int get_trimmed_bits() const
return the trimmed bits
adder_conn_obj(const std::string &_name)
Constructor.
void set_trimmed_bits(unsigned int _trimmed_bits)
set the multiplication as a multiplication to a constant
bool is_aligned_adder_p
when true the addition can trim the last bits
Base class for all resources into datapath.
Generic class managing all resources into datapath.
Definition: generic_obj.hpp:66
~adder_conn_obj() override=default
Destructor.
unsigned long long get_bitsize() const
return the maximum bitsize associated with the component
void add_bitsize(unsigned long long _bitsize)
add a size to the component
unsigned int trimmed_bits
last bits that can be trimmed
This class is used when pointers arithmetic is implicitly performed.

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