PandA-2024.02
register_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  */
46 #ifndef REGISTER_HPP
47 #define REGISTER_HPP
48 
49 #include "generic_obj.hpp"
50 #include "refcount.hpp"
51 #include "string_manipulation.hpp"
52 
56 class register_obj : public generic_obj
57 {
59 
60  private:
61  unsigned int register_index;
62 
63  public:
68  explicit register_obj(const unsigned int index) : generic_obj(REGISTER, std::string("reg_") + STR(index))
69  {
70  register_index = index;
71  }
72 
76  ~register_obj() override = default;
77 
84  {
85  return wr_enable;
86  }
87 
91  void set_wr_enable(const generic_objRef& wr_en)
92  {
93  wr_enable = wr_en;
94  }
95 
100  unsigned int get_register_index()
101  {
102  return register_index;
103  }
104 };
105 
108 
109 #endif
unsigned int get_register_index()
Gets the index of the register represented by this object.
void set_wr_enable(const generic_objRef &wr_en)
Sets the write enable for given register.
class modeling a register object
Definition of hash function for EdgeDescriptor.
Definition: graph.hpp:1321
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
Base class for all resources into datapath.
a functional resource
Definition: generic_obj.hpp:73
#define index(x, y)
Definition: Keccak.c:74
Generic class managing all resources into datapath.
Definition: generic_obj.hpp:66
register_obj(const unsigned int index)
This is the constructor of the object class, with a given id.
generic_objRef wr_enable
Template definition of refcount.
unsigned int register_index
generic_objRef get_wr_enable() const
Gets the write enable object for the given register.
~register_obj() override=default
Destructor.

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