PandA-2024.02
reg_binding_cs.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) 2016-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  */
39 #include "reg_binding_cs.hpp"
40 #include "Parameter.hpp"
41 #include "hls.hpp"
42 #include "hls_device.hpp"
43 #include "hls_manager.hpp"
44 #include "math_function.hpp"
45 #include "omp_functions.hpp"
46 #include "structural_manager.hpp"
47 #include "structural_objects.hpp"
48 #include "technology_manager.hpp"
49 #include "utility.hpp"
50 
52 #include <string>
53 
54 reg_binding_cs::reg_binding_cs(const hlsRef& HLS_, const HLS_managerRef HLSMgr_) : reg_binding(HLS_, HLSMgr_)
55 {
56 }
57 
59 
60 std::string reg_binding_cs::GetRegisterFUName(unsigned int)
61 {
62  return "register_file";
63 }
64 
66 {
68  auto mem_dimension = HLS->Param->getOption<unsigned int>(OPT_context_switch);
69  auto dimension = ceil_log2(HLS->Param->getOption<unsigned long long int>(OPT_context_switch));
70  if(!dimension)
71  {
72  dimension = 1;
73  }
75  if(selector_port != nullptr)
76  {
77  selector_port->type_resize(static_cast<unsigned>(dimension)); // selector
78  }
79  GetPointer<module>(reg)->SetParameter("n_elements", STR(mem_dimension));
80  for(unsigned int j = 0; j < GetPointer<module>(reg)->get_in_port_size();
81  j++) // connect input scheduler with datapath input
82  {
83  structural_objectRef port_i = GetPointer<module>(reg)->get_in_port(j);
84  std::string port_name = GetPointer<port_o>(port_i)->get_id();
85  }
86 }
Data structure representing the entire HLS information.
const ParameterConstRef Param
class containing all the parameters
Definition: hls.hpp:169
Class managing the register binding.
Definition: reg_binding.hpp:70
mathematical utility function not provided by standard libraries
virtual structural_objectRef find_member(const std::string &id, so_kind type, const structural_objectRef owner) const =0
Return the object named id of a given type which belongs to or it is associated with the object...
Class specification of the manager of the technology library data structures.
~reg_binding_cs() override
Destructor.
hlsRef HLS
HLS data-structure.
Definition: reg_binding.hpp:97
#define STR(s)
Macro which performs a lexical_cast to a string.
void specialise_reg(structural_objectRef &reg, unsigned int r) override
Specialise a register according to the type of the variables crossing it.
T ceil_log2(T x)
Return the smallest n such that 2**n >= X.
std::string GetRegisterFUName(unsigned int i) override
return the name of register to be used
virtual void specialise_reg(structural_objectRef &reg, unsigned int r)
Specialise a register according to the type of the variables crossing it.
This file collects some utility functions and macros.
void type_resize(unsigned long long new_bit_size)
Just resize the size of the bits of the object.
reg_binding_cs(const hlsRef &HLS, const HLS_managerRef HLSMgr_)
Constructor.
This class describes all classes used to represent a structural object.
this class is used to manage the command-line or XML options.
#define SELECTOR_REGISTER_FILE
Class implementation of the structural_manager.
Datastructure to describe functions allocation in high-level synthesis.
Data structure definition for high-level synthesis flow.
HLS specialization of generic_device.

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