PandA-2024.02
memory.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  */
43 #ifndef _MEMORY_HPP_
44 #define _MEMORY_HPP_
45 
46 #include "custom_map.hpp"
47 #include "custom_set.hpp"
48 #include "refcount.hpp"
49 #include <map>
50 #include <string>
51 
64 class xml_element;
65 
66 class memory
67 {
68  private:
71 
73  std::map<unsigned int, memory_symbolRef> external;
74 
76  std::map<unsigned int, std::map<unsigned int, memory_symbolRef>> internal;
77 
79  std::map<unsigned int, CustomOrderedSet<unsigned int>> internal_variable_proxy;
80 
83 
85 
87  std::map<unsigned int, memory_symbolRef> in_vars;
88 
90  std::map<unsigned int, unsigned long long int> rangesize;
91 
93  std::map<unsigned int, std::map<unsigned int, memory_symbolRef>> parameter;
95  std::map<unsigned int, memory_symbolRef> params;
97  std::map<unsigned int, memory_symbolRef> callSites;
98 
101 
103  std::map<unsigned int, unsigned int> same_data_size_accesses;
104 
106  std::map<unsigned int, CustomOrderedSet<unsigned int>> source_values;
107 
110 
113 
116 
118  unsigned long long int next_base_address;
119 
121  unsigned long long int internal_base_address_start;
122 
124  unsigned long long int maximum_private_memory_size;
125 
127  unsigned long long int total_amount_of_private_memory;
128 
130  unsigned long long int total_amount_of_parameter_memory;
131 
133  unsigned long long int off_base_address;
134 
136  unsigned long long int next_off_base_address;
137 
139  unsigned long long bus_data_bitsize;
140 
142  unsigned long long bus_size_bitsize;
143 
145  unsigned long long bram_bitsize;
146 
148  unsigned int maxbram_bitsize;
149 
152 
155 
158 
161 
164 
167 
170 
172  const unsigned long long parameter_alignment;
173 
175  std::map<unsigned int, unsigned int> n_mem_operations_per_var;
176 
179 
181  std::map<unsigned int, size_t> maximum_references;
182 
184  std::map<unsigned int, size_t> maximum_loads;
185 
188 
191 
192  const unsigned int& bus_addr_bitsize;
193 
195 
196  public:
200  memory(const tree_managerConstRef TreeM, unsigned long long int off_base_address, unsigned int max_bram,
201  bool null_pointer_check, bool initial_internal_address_p, unsigned long long initial_internal_address,
202  const unsigned int& _bus_addr_bitsize);
203 
207  virtual ~memory();
208 
209  static memoryRef create_memory(const ParameterConstRef _parameters, const tree_managerConstRef _TreeM,
210  unsigned long long int _off_base_address, unsigned int max_bram,
211  bool _null_pointer_check, bool initial_internal_address_p,
212  unsigned int initial_internal_address, const unsigned int& _address_bitsize);
213 
217  std::map<unsigned int, memory_symbolRef> get_ext_memory_variables() const;
218 
222  void add_external_variable(unsigned int var, const std::string& var_name);
223 
228  void add_external_symbol(unsigned int var, const memory_symbolRef m_sym);
229 
233  void add_internal_variable(unsigned int funID_scope, unsigned int var, const std::string& var_name);
234 
240  void add_internal_variable_proxy(unsigned int funID_scope, unsigned int var);
241 
249  unsigned long long compute_next_base_address(unsigned long long address, unsigned int var,
250  unsigned long long int alignment) const;
251 
257  const CustomOrderedSet<unsigned int>& get_proxied_internal_variables(unsigned int funID_scope) const;
258 
264  bool has_proxied_internal_variables(unsigned int funID_scope) const;
265 
271  bool is_a_proxied_variable(unsigned int var) const;
272 
277  void add_read_only_variable(unsigned var);
278 
284  bool is_read_only_variable(unsigned var) const;
285 
290  void add_internal_symbol(unsigned int funID_scope, unsigned int var, const memory_symbolRef m_sym);
291 
296  void add_private_memory(unsigned int var);
297 
303  void set_sds_var(unsigned int var, bool value);
304 
310  void add_source_value(unsigned int var, unsigned int value);
311 
318  {
319  return source_values[var];
320  }
321 
325  void add_parameter(unsigned int funID_scope, unsigned int var, const std::string& var_name, bool is_last);
326 
330  void add_parameter_symbol(unsigned int funID_scope, unsigned int var, const memory_symbolRef m_sym);
331 
335  bool is_internal_variable(unsigned int funID_scope, unsigned int var) const;
336 
340  bool is_external_variable(unsigned int var) const;
341 
347  bool is_private_memory(unsigned int var) const;
348 
354  bool is_sds_var(unsigned int var) const;
355 
361  bool has_sds_var(unsigned int var) const;
362 
366  bool is_parameter(unsigned int funID_scope, unsigned int var) const;
367 
371  const std::map<unsigned int, memory_symbolRef> get_callSites() const
372  {
373  return callSites;
374  }
375 
379  unsigned long long get_callSite_base_address(unsigned int var) const;
380 
384  unsigned long long int get_internal_base_address(unsigned int var) const;
385 
389  unsigned long long get_external_base_address(unsigned int var) const;
390 
394  unsigned long long int get_parameter_base_address(unsigned int funId, unsigned int var) const;
395 
399  unsigned long long int get_base_address(unsigned int var, unsigned int funId) const;
400 
404  unsigned long long get_first_address(unsigned int funId) const;
405 
409  unsigned long long get_last_address(unsigned int funId, const application_managerRef AppM) const;
410 
414  memory_symbolRef get_symbol(unsigned int var, unsigned int funId) const;
415 
420  unsigned long long get_rangesize(unsigned int var) const;
421 
425  bool has_callSite_base_address(unsigned int var) const;
426 
430  bool has_internal_base_address(unsigned int var) const;
431 
435  unsigned int get_n_mem_operations(unsigned int var) const
436  {
437  return n_mem_operations_per_var.find(var)->second;
438  }
439 
440  void increment_n_mem_operations(unsigned int var)
441  {
442  if(n_mem_operations_per_var.find(var) == n_mem_operations_per_var.end())
443  {
444  n_mem_operations_per_var[var] = 1;
445  }
446  else
447  {
448  ++n_mem_operations_per_var[var];
449  }
450  }
451 
455  bool has_external_base_address(unsigned int var) const;
456 
460  bool has_parameter_base_address(unsigned int var, unsigned int funId) const;
461 
465  bool has_base_address(unsigned int var) const;
466 
470  bool is_parm_decl_copied(unsigned int var) const;
471 
475  void add_parm_decl_copied(unsigned int var);
476 
480  bool is_parm_decl_stored(unsigned int var) const;
481 
485  void add_parm_decl_stored(unsigned int var);
486 
490  bool is_actual_parm_loaded(unsigned int var) const;
491 
495  void add_actual_parm_loaded(unsigned int var);
496 
500  std::map<unsigned int, memory_symbolRef> get_function_vars(unsigned int funID_scope) const;
501 
505  std::map<unsigned int, memory_symbolRef> get_function_parameters(unsigned int funID_scope) const;
506 
510  unsigned long long get_memory_address() const;
511 
515  void reserve_space(unsigned long long space);
516 
520  void reserve_internal_space(unsigned long long int space);
521 
525  unsigned long long get_allocated_space() const;
526 
530  unsigned long long get_allocated_parameters_memory() const;
531 
535  unsigned long long int get_allocated_internal_memory() const;
536 
540  unsigned long long int get_next_internal_base_address() const;
541 
545  unsigned long long int get_max_address() const;
546 
550  void set_bus_data_bitsize(unsigned long long bitsize)
551  {
552  bus_data_bitsize = bitsize;
553  }
554 
558  unsigned long long get_bus_data_bitsize() const
559  {
560  return bus_data_bitsize;
561  }
562 
566  void set_bus_size_bitsize(unsigned long long bitsize)
567  {
568  bus_size_bitsize = bitsize;
569  }
570 
574  unsigned long long get_bus_size_bitsize() const
575  {
576  return bus_size_bitsize;
577  }
578 
582  void set_bram_bitsize(unsigned long long bitsize)
583  {
584  bram_bitsize = bitsize;
585  }
586 
590  unsigned long long get_bram_bitsize() const
591  {
592  return bram_bitsize;
593  }
594 
598  void set_maxbram_bitsize(unsigned int bitsize)
599  {
600  maxbram_bitsize = bitsize;
601  }
602 
606  unsigned int get_maxbram_bitsize() const
607  {
608  return maxbram_bitsize;
609  }
610 
614  void set_intern_shared_data(bool has_accesses)
615  {
616  intern_shared_data = has_accesses;
617  }
618 
623  {
624  return intern_shared_data;
625  }
626 
632  void set_maximum_references(unsigned int var, size_t n_refs)
633  {
634  maximum_references[var] = n_refs;
635  }
636 
642  size_t get_maximum_references(unsigned int var) const
643  {
644  return maximum_references.find(var) != maximum_references.end() ? maximum_references.find(var)->second : 0;
645  }
646 
652  void set_maximum_loads(unsigned int var, size_t n_refs)
653  {
654  maximum_loads[var] = n_refs;
655  }
656 
662  size_t get_maximum_loads(unsigned int var) const
663  {
664  return maximum_loads.find(var) != maximum_loads.end() ? maximum_loads.find(var)->second : 0;
665  }
666 
671  void add_need_bus(unsigned int var)
672  {
673  need_bus.insert(var);
674  }
675 
681  bool does_need_addr(unsigned int var) const
682  {
683  return need_bus.find(var) != need_bus.end();
684  }
688  void set_use_unknown_addresses(bool accesses)
689  {
690  use_unknown_addresses = accesses;
691  }
692 
697  {
698  return use_unknown_addresses;
699  }
703  void set_unaligned_accesses(bool accesses)
704  {
705  unaligned_accesses = accesses;
706  }
707 
712  {
713  return unaligned_accesses;
714  }
715 
719  void set_all_pointers_resolved(bool resolved)
720  {
721  all_pointers_resolved = resolved;
722  }
723 
728  {
729  return all_pointers_resolved;
730  }
731 
736  void set_packed_vars(bool packed)
737  {
738  packed_vars = packed_vars || packed;
739  }
740 
744  bool has_packed_vars() const
745  {
746  return packed_vars;
747  }
748 
752  void set_implicit_memcpy(bool cond)
753  {
754  implicit_memcpy = cond;
755  }
756 
760  bool has_implicit_memcpy() const
761  {
762  return implicit_memcpy;
763  }
764 
768  unsigned long long get_internal_base_address_alignment() const
769  {
771  }
772 
776  unsigned long long get_parameter_alignment() const
777  {
778  return parameter_alignment;
779  }
780 
785  void set_internal_base_address_alignment(unsigned long long _internal_base_address_alignment);
786 
791 
795  static void add_memory_parameter(const structural_managerRef SM, const std::string& name, const std::string& value);
796 
800  void xwrite(xml_element* node);
801 
805  void xwrite2(xml_element* node);
806 
810  void xwrite(const std::string& filename);
811 
815  unsigned int count_non_private_internal_symbols() const;
816 
818  bool notEQ(refcount<memory> ref) const;
819 
820  void set_enable_hls_bit_value(bool value)
821  {
822  enable_hls_bit_value = value;
823  }
824 
826  {
827  return enable_hls_bit_value;
828  }
829 };
832 
833 #endif
static void propagate_memory_parameters(const structural_objectRef src, const structural_managerRef tgt)
Propagates the memory parameters from the source (innermost) module to the target (outermost) one...
Definition: memory.cpp:654
unsigned long long int off_base_address
it represents the base address of the external memory
Definition: memory.hpp:133
unsigned long long int next_base_address
it represents the next address that is available for internal allocation
Definition: memory.hpp:118
void reserve_space(unsigned long long space)
Explicitly allocate a certain space in the external memory.
Definition: memory.cpp:577
void xwrite(xml_element *node)
Writes the current memory allocation into an XML description.
Definition: memory.cpp:751
unsigned int count_non_private_internal_symbols() const
Definition: memory.cpp:273
unsigned long long int get_next_internal_base_address() const
Returns next free address of memory allocated internally but not private.
Definition: memory.cpp:604
bool null_pointer_check
when false object could be allocated starting from address 0
Definition: memory.hpp:178
void set_bram_bitsize(unsigned long long bitsize)
set the BRAM bitsize
Definition: memory.hpp:582
std::map< unsigned int, memory_symbolRef > external
set of variables allocated outside the top module
Definition: memory.hpp:73
std::map< unsigned int, memory_symbolRef > get_function_parameters(unsigned int funID_scope) const
Return parameters allocated in register of the interface.
Definition: memory.cpp:427
void set_bus_size_bitsize(unsigned long long bitsize)
set the bus size bitsize
Definition: memory.hpp:566
unsigned int get_maxbram_bitsize() const
return the BRAM bitsize
Definition: memory.hpp:606
std::map< unsigned int, memory_symbolRef > callSites
set of call sites for __builtin_wait_call
Definition: memory.hpp:97
bool is_parameter(unsigned int funID_scope, unsigned int var) const
Test if a variable is into the set of interface registers.
Definition: memory.cpp:386
void set_implicit_memcpy(bool cond)
define if there exist an implicit call of memcpy
Definition: memory.hpp:752
unsigned long long int get_parameter_base_address(unsigned int funId, unsigned int var) const
Get the current base address of the given variable.
Definition: memory.cpp:410
bool get_enable_hls_bit_value()
Definition: memory.hpp:825
std::string filename
unsigned long long external_base_address_alignment
external address alignment
Definition: memory.hpp:169
bool does_need_addr(unsigned int var) const
check if a load or a store of the variable is done trough the bus
Definition: memory.hpp:681
void add_parm_decl_stored(unsigned int var)
add a parm_decl to the set of parm_decl that has to be initialized
Definition: memory.cpp:629
This class manages the tree structures extracted from the raw file.
bool has_sds_var(unsigned int var) const
return true if the var has been classified in term of same data size relation
Definition: memory.cpp:381
bool implicit_memcpy
when true an implicit memcpy is called
Definition: memory.hpp:163
std::map< unsigned int, unsigned long long int > rangesize
for each var store the address space rangesize associated with it
Definition: memory.hpp:90
This class manages the circuit structures.
bool notEQ(refcount< memory > ref) const
return true in case the current memory object and the passed one are different
Definition: memory.cpp:840
const CustomOrderedSet< unsigned int > & get_source_values(unsigned int var)
return the set of values used to write a given memory variable
Definition: memory.hpp:317
CustomOrderedSet< unsigned int > private_memories
store the objects that does not need to be attached to the bus
Definition: memory.hpp:100
unsigned long long get_parameter_alignment() const
return the parameter alignment
Definition: memory.hpp:776
bool is_read_only_variable(unsigned var) const
return true when the variable is only read
Definition: memory.cpp:229
void set_sds_var(unsigned int var, bool value)
set if a variable is always accessed with the same data size or not
Definition: memory.cpp:313
bool has_external_base_address(unsigned int var) const
Check if there is a base address for the given variable.
Definition: memory.cpp:446
bool has_packed_vars() const
Definition: memory.hpp:744
unsigned long long get_allocated_space() const
Returns the amount of memory allocated internally to the module.
Definition: memory.cpp:589
const tree_managerConstRef TreeM
data-structure containing tree information
Definition: memory.hpp:70
std::map< unsigned int, CustomOrderedSet< unsigned int > > source_values
ssa_names assigned to a given memory variable
Definition: memory.hpp:106
unsigned long long get_bus_size_bitsize() const
return the bitsize of the size bus
Definition: memory.hpp:574
std::map< unsigned int, memory_symbolRef > get_function_vars(unsigned int funID_scope) const
Return the variables allocated within the space of a given function.
Definition: memory.cpp:417
size_t get_maximum_references(unsigned int var) const
return the maximum number of references for a given variable
Definition: memory.hpp:642
CustomOrderedSet< unsigned int > parm_decl_copied
parm_decl that has to be copied from the caller
Definition: memory.hpp:109
virtual ~memory()
Destructor.
bool has_implicit_memcpy() const
return true in case the specification has an implicit call of memcpy
Definition: memory.hpp:760
void add_internal_variable(unsigned int funID_scope, unsigned int var, const std::string &var_name)
Allocates a variable to the set of variables allocated internally to the given function.
Definition: memory.cpp:175
bool has_intern_shared_data() const
return true in case the specification has data that can be externally accessed
Definition: memory.hpp:622
const CustomOrderedSet< unsigned int > & get_proxied_internal_variables(unsigned int funID_scope) const
return the proxied internal variables associated with the function
Definition: memory.cpp:208
unsigned long long int get_base_address(unsigned int var, unsigned int funId) const
Get the current base address of the given variable.
Definition: memory.cpp:467
unsigned long long get_external_base_address(unsigned int var) const
Get the current base address of the given variable.
Definition: memory.cpp:404
CustomOrderedSet< unsigned int > actual_parm_loaded
actual parameter that has to be loaded from a stored value
Definition: memory.hpp:115
redefinition of map to manage ordered/unordered structures
bool is_external_variable(unsigned int var) const
Test if a variable is into the set of variables out of the top function.
Definition: memory.cpp:365
bool is_a_proxied_variable(unsigned int var) const
return true if the variable is a proxied variable
Definition: memory.cpp:219
const unsigned int & bus_addr_bitsize
Definition: memory.hpp:192
std::map< unsigned int, memory_symbolRef > in_vars
set of all the internal variables
Definition: memory.hpp:87
static void add_memory_parameter(const structural_managerRef SM, const std::string &name, const std::string &value)
Adds the given memory parameter to the corresponding object.
Definition: memory.cpp:725
unsigned long long get_callSite_base_address(unsigned int var) const
Get the current base address of the given call site.
Definition: memory.cpp:392
CustomOrderedSet< unsigned int > parm_decl_stored
parm_decl storage has to be initialized from the formal parameter
Definition: memory.hpp:112
void set_bus_data_bitsize(unsigned long long bitsize)
set the bus data bitsize
Definition: memory.hpp:550
bool enable_hls_bit_value
Definition: memory.hpp:194
unsigned long long get_allocated_parameters_memory() const
Return the total amount of memory allocated for the memory mapped parameters.
Definition: memory.cpp:594
unsigned long long get_first_address(unsigned int funId) const
Get the first address of the function address space.
Definition: memory.cpp:485
REF_FORWARD_DECL(application_manager)
void set_all_pointers_resolved(bool resolved)
define if all pointers have statically resolved
Definition: memory.hpp:719
bool all_pointers_resolved
is true when all pointers are resolved statically
Definition: memory.hpp:160
unsigned long long get_rangesize(unsigned int var) const
return the address space rangesize associated with the given var
Definition: memory.cpp:571
void add_read_only_variable(unsigned var)
add a read only variable
Definition: memory.cpp:224
void increment_n_mem_operations(unsigned int var)
Definition: memory.hpp:440
void add_private_memory(unsigned int var)
add a var that safely cannot be attached to the bus
Definition: memory.cpp:308
memory_symbolRef get_symbol(unsigned int var, unsigned int funId) const
Return the symbol associated with the given variable.
Definition: memory.cpp:553
void xwrite2(xml_element *node)
Writes the current memory allocation into an XML description.
Definition: memory.cpp:1062
static memoryRef create_memory(const ParameterConstRef _parameters, const tree_managerConstRef _TreeM, unsigned long long int _off_base_address, unsigned int max_bram, bool _null_pointer_check, bool initial_internal_address_p, unsigned int initial_internal_address, const unsigned int &_address_bitsize)
Definition: memory.cpp:132
unsigned long long int total_amount_of_parameter_memory
total amount of parameter memory
Definition: memory.hpp:130
const unsigned long long parameter_alignment
parameter alignment
Definition: memory.hpp:172
std::map< unsigned int, size_t > maximum_loads
define for each variable the number of loads whenever it is possible
Definition: memory.hpp:184
const std::map< unsigned int, memory_symbolRef > get_callSites() const
Get call sites map.
Definition: memory.hpp:371
void set_use_unknown_addresses(bool accesses)
define if there exist an object used by the Spec with an address not known at compile time ...
Definition: memory.hpp:688
unsigned long long get_bus_data_bitsize() const
return the bitsize of the data bus
Definition: memory.hpp:558
void set_maximum_loads(unsigned int var, size_t n_refs)
define the maximum number of loads for a given variable
Definition: memory.hpp:652
unsigned long long internal_base_address_alignment
internal address alignment
Definition: memory.hpp:166
std::map< unsigned int, memory_symbolRef > params
set of all the internal parameters
Definition: memory.hpp:95
void add_parameter_symbol(unsigned int funID_scope, unsigned int var, const memory_symbolRef m_sym)
Allocates a parameter to the set of the interface registers.
Definition: memory.cpp:336
redefinition of set to manage ordered/unordered structures
unsigned int maxbram_bitsize
maximum bram bitsize
Definition: memory.hpp:148
unsigned long long int get_internal_base_address(unsigned int var) const
Get the current base address of the given variable.
Definition: memory.cpp:398
bool has_unaligned_accesses() const
return true in case of unaligned accesses
Definition: memory.hpp:711
bool has_parameter_base_address(unsigned int var, unsigned int funId) const
Check if there is a base address for the given parameter.
Definition: memory.cpp:451
bool is_parm_decl_stored(unsigned int var) const
return true in case the parm_decl parameter has to be initialized from the formal value ...
Definition: memory.cpp:624
bool is_parm_decl_copied(unsigned int var) const
return true in case the parm_decl parameter has to be copied from the caller
Definition: memory.cpp:614
std::map< unsigned int, CustomOrderedSet< unsigned int > > internal_variable_proxy
set of variable proxies accessed by a function
Definition: memory.hpp:79
unsigned long long bus_data_bitsize
bus data bitsize
Definition: memory.hpp:139
bool is_private_memory(unsigned int var) const
Return true in case the variable is private.
Definition: memory.cpp:370
void set_unaligned_accesses(bool accesses)
set if LOADs or STOREs perform unaligned accesses
Definition: memory.hpp:703
void set_packed_vars(bool packed)
update the the packed variables status
Definition: memory.hpp:736
void set_maximum_references(unsigned int var, size_t n_refs)
define the maximum number of references for a given variable
Definition: memory.hpp:632
void set_enable_hls_bit_value(bool value)
Definition: memory.hpp:820
bool has_unknown_addresses() const
return true in case the specification use addresses not known at compile time
Definition: memory.hpp:696
unsigned long long get_bram_bitsize() const
return the BRAM bitsize
Definition: memory.hpp:590
bool has_all_pointers_resolved() const
return true in case all pointers have been statically resolved
Definition: memory.hpp:727
void add_external_variable(unsigned int var, const std::string &var_name)
Allocates a variable to the set of variables allocated outside to outermost function.
Definition: memory.cpp:286
Template definition of refcount.
std::map< unsigned int, size_t > maximum_references
define for each variable the number of references whenever it is possible
Definition: memory.hpp:181
unsigned long long compute_next_base_address(unsigned long long address, unsigned int var, unsigned long long int alignment) const
Compute the new base address based on the size of the given variable and align the memory as needed...
Definition: memory.cpp:154
unsigned long long bus_size_bitsize
bus size bitsize
Definition: memory.hpp:142
memory(const tree_managerConstRef TreeM, unsigned long long int off_base_address, unsigned int max_bram, bool null_pointer_check, bool initial_internal_address_p, unsigned long long initial_internal_address, const unsigned int &_bus_addr_bitsize)
Constructor.
Definition: memory.cpp:89
void add_source_value(unsigned int var, unsigned int value)
add a value to the set of values written in a given memory variable
Definition: memory.cpp:318
void add_parm_decl_copied(unsigned int var)
add a parm_decl to the set of parm_decl written
Definition: memory.cpp:619
bool has_base_address(unsigned int var) const
Check if there is a base address for the given variable.
Definition: memory.cpp:461
void set_intern_shared_data(bool has_accesses)
define if the Spec has data that can be externally accessed
Definition: memory.hpp:614
bool is_sds_var(unsigned int var) const
check if the variable is always accessed with the same data size
Definition: memory.cpp:375
CustomOrderedSet< unsigned int > read_only_vars
Definition: memory.hpp:84
unsigned long long int get_max_address() const
return the maximum address allocated
Definition: memory.cpp:609
void add_actual_parm_loaded(unsigned int var)
add an actual parameter to the set of parameter that has to be initialized from a stored value ...
Definition: memory.cpp:639
unsigned long long get_memory_address() const
Return the first memory address not yet allocated.
Definition: memory.cpp:354
unsigned long long get_internal_base_address_alignment() const
return the internal base address alignment.
Definition: memory.hpp:768
bool use_unknown_addresses
Spec accesses data having an address unknown at compile time.
Definition: memory.hpp:154
CustomOrderedSet< unsigned int > need_bus
define for each variable the number of loads whenever it is possible
Definition: memory.hpp:187
unsigned long long int maximum_private_memory_size
is the maximum amount of private memory allocated
Definition: memory.hpp:124
unsigned int get_n_mem_operations(unsigned int var) const
Definition: memory.hpp:435
std::map< unsigned int, unsigned int > n_mem_operations_per_var
number of LOAD/STORE per var
Definition: memory.hpp:175
bool has_internal_base_address(unsigned int var) const
Check if there is a base address for the given variable.
Definition: memory.cpp:441
void add_external_symbol(unsigned int var, const memory_symbolRef m_sym)
Allocates a variable to the set of variables allocated outside to outermost function.
Definition: memory.cpp:293
CustomOrderedSet< unsigned int > proxied_variables
is the set of proxied variables
Definition: memory.hpp:82
unsigned long long int get_allocated_internal_memory() const
Returns the amount of memory allocated internally but not private.
Definition: memory.cpp:599
unsigned long long int total_amount_of_private_memory
total amount of internal memory allocated
Definition: memory.hpp:127
unsigned long long get_last_address(unsigned int funId, const application_managerRef AppM) const
Get the last address of the function address space.
Definition: memory.cpp:515
bool packed_vars
true when packed vars are used
Definition: memory.hpp:190
unsigned long long int internal_base_address_start
is the start internal address
Definition: memory.hpp:121
void set_maxbram_bitsize(unsigned int bitsize)
set the maximum BRAM bitsize
Definition: memory.hpp:598
bool is_actual_parm_loaded(unsigned int var) const
return true in case the actual parameter has to be initialized from a stored value ...
Definition: memory.cpp:634
bool is_internal_variable(unsigned int funID_scope, unsigned int var) const
Test if a variable is allocated into the specified function.
Definition: memory.cpp:359
unsigned long long bram_bitsize
bram bitsize
Definition: memory.hpp:145
bool intern_shared_data
define if the Spec has data that can be externally accessed
Definition: memory.hpp:151
void reserve_internal_space(unsigned long long int space)
Explicitly allocate a certain space in the internal memory.
Definition: memory.cpp:583
bool has_callSite_base_address(unsigned int var) const
Check if there is a base address for the given call site.
Definition: memory.cpp:436
bool has_proxied_internal_variables(unsigned int funID_scope) const
check if the function has proxied variables
Definition: memory.cpp:214
std::map< unsigned int, memory_symbolRef > get_ext_memory_variables() const
Return variables allocated out of the top module.
Definition: memory.cpp:149
void set_internal_base_address_alignment(unsigned long long _internal_base_address_alignment)
set the internal base address alignment
Definition: memory.cpp:644
void add_need_bus(unsigned int var)
the variable is read or written through the bus
Definition: memory.hpp:671
Base object for all the structural objects.
bool unaligned_accesses
true when LOADs or STOREs perform unaligned accesses
Definition: memory.hpp:157
std::map< unsigned int, std::map< unsigned int, memory_symbolRef > > parameter
set of variables allocated in registers of the interface
Definition: memory.hpp:93
void add_parameter(unsigned int funID_scope, unsigned int var, const std::string &var_name, bool is_last)
Allocates a parameter to the set of the interface registers.
Definition: memory.cpp:323
CONSTREF_FORWARD_DECL(tree_manager)
void add_internal_symbol(unsigned int funID_scope, unsigned int var, const memory_symbolRef m_sym)
Allocates a variable to the set of variables allocated internally to the given function.
Definition: memory.cpp:234
unsigned long long int next_off_base_address
it represents the next address that is available to allocate a variable out of the top module ...
Definition: memory.hpp:136
std::map< unsigned int, unsigned int > same_data_size_accesses
store if a given variable is accessed always with the same data_size or not
Definition: memory.hpp:103
size_t get_maximum_loads(unsigned int var) const
return the maximum number of loads for a given variable
Definition: memory.hpp:662
void add_internal_variable_proxy(unsigned int funID_scope, unsigned int var)
allocate a proxy for the variable for the specified function
Definition: memory.cpp:202

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