PandA-2024.02
Public Member Functions | Private Attributes
memory_cs Class Reference

#include <memory_cs.hpp>

Inheritance diagram for memory_cs:
Inheritance graph
[legend]
Collaboration diagram for memory_cs:
Collaboration graph
[legend]

Public Member Functions

 memory_cs (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)
 Constructor. More...
 
 ~memory_cs () override=default
 Destructor. More...
 
void set_bus_tag_bitsize (unsigned int bitsize)
 set the bus tag bitsize More...
 
unsigned int get_bus_tag_bitsize () const
 return the bitsize of the tag bus More...
 
- Public Member Functions inherited from memory
 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. More...
 
virtual ~memory ()
 Destructor. More...
 
std::map< unsigned int, memory_symbolRefget_ext_memory_variables () const
 Return variables allocated out of the top module. More...
 
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. More...
 
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. More...
 
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. More...
 
void add_internal_variable_proxy (unsigned int funID_scope, unsigned int var)
 allocate a proxy for the variable for the specified function More...
 
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. More...
 
const CustomOrderedSet< unsigned int > & get_proxied_internal_variables (unsigned int funID_scope) const
 return the proxied internal variables associated with the function More...
 
bool has_proxied_internal_variables (unsigned int funID_scope) const
 check if the function has proxied variables More...
 
bool is_a_proxied_variable (unsigned int var) const
 return true if the variable is a proxied variable More...
 
void add_read_only_variable (unsigned var)
 add a read only variable More...
 
bool is_read_only_variable (unsigned var) const
 return true when the variable is only read More...
 
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. More...
 
void add_private_memory (unsigned int var)
 add a var that safely cannot be attached to the bus More...
 
void set_sds_var (unsigned int var, bool value)
 set if a variable is always accessed with the same data size or not More...
 
void add_source_value (unsigned int var, unsigned int value)
 add a value to the set of values written in a given memory variable More...
 
const CustomOrderedSet< unsigned int > & get_source_values (unsigned int var)
 return the set of values used to write a given memory variable More...
 
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. More...
 
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. More...
 
bool is_internal_variable (unsigned int funID_scope, unsigned int var) const
 Test if a variable is allocated into the specified function. More...
 
bool is_external_variable (unsigned int var) const
 Test if a variable is into the set of variables out of the top function. More...
 
bool is_private_memory (unsigned int var) const
 Return true in case the variable is private. More...
 
bool is_sds_var (unsigned int var) const
 check if the variable is always accessed with the same data size More...
 
bool has_sds_var (unsigned int var) const
 return true if the var has been classified in term of same data size relation More...
 
bool is_parameter (unsigned int funID_scope, unsigned int var) const
 Test if a variable is into the set of interface registers. More...
 
const std::map< unsigned int, memory_symbolRefget_callSites () const
 Get call sites map. More...
 
unsigned long long get_callSite_base_address (unsigned int var) const
 Get the current base address of the given call site. More...
 
unsigned long long int get_internal_base_address (unsigned int var) const
 Get the current base address of the given variable. More...
 
unsigned long long get_external_base_address (unsigned int var) const
 Get the current base address of the given variable. More...
 
unsigned long long int get_parameter_base_address (unsigned int funId, unsigned int var) const
 Get the current base address of the given variable. More...
 
unsigned long long int get_base_address (unsigned int var, unsigned int funId) const
 Get the current base address of the given variable. More...
 
unsigned long long get_first_address (unsigned int funId) const
 Get the first address of the function address space. More...
 
unsigned long long get_last_address (unsigned int funId, const application_managerRef AppM) const
 Get the last address of the function address space. More...
 
memory_symbolRef get_symbol (unsigned int var, unsigned int funId) const
 Return the symbol associated with the given variable. More...
 
unsigned long long get_rangesize (unsigned int var) const
 return the address space rangesize associated with the given var More...
 
bool has_callSite_base_address (unsigned int var) const
 Check if there is a base address for the given call site. More...
 
bool has_internal_base_address (unsigned int var) const
 Check if there is a base address for the given variable. More...
 
unsigned int get_n_mem_operations (unsigned int var) const
 
void increment_n_mem_operations (unsigned int var)
 
bool has_external_base_address (unsigned int var) const
 Check if there is a base address for the given variable. More...
 
bool has_parameter_base_address (unsigned int var, unsigned int funId) const
 Check if there is a base address for the given parameter. More...
 
bool has_base_address (unsigned int var) const
 Check if there is a base address for the given variable. More...
 
bool is_parm_decl_copied (unsigned int var) const
 return true in case the parm_decl parameter has to be copied from the caller More...
 
void add_parm_decl_copied (unsigned int var)
 add a parm_decl to the set of parm_decl written More...
 
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 More...
 
void add_parm_decl_stored (unsigned int var)
 add a parm_decl to the set of parm_decl that has to be initialized More...
 
bool is_actual_parm_loaded (unsigned int var) const
 return true in case the actual parameter has to be initialized from a stored value More...
 
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 More...
 
std::map< unsigned int, memory_symbolRefget_function_vars (unsigned int funID_scope) const
 Return the variables allocated within the space of a given function. More...
 
std::map< unsigned int, memory_symbolRefget_function_parameters (unsigned int funID_scope) const
 Return parameters allocated in register of the interface. More...
 
unsigned long long get_memory_address () const
 Return the first memory address not yet allocated. More...
 
void reserve_space (unsigned long long space)
 Explicitly allocate a certain space in the external memory. More...
 
void reserve_internal_space (unsigned long long int space)
 Explicitly allocate a certain space in the internal memory. More...
 
unsigned long long get_allocated_space () const
 Returns the amount of memory allocated internally to the module. More...
 
unsigned long long get_allocated_parameters_memory () const
 Return the total amount of memory allocated for the memory mapped parameters. More...
 
unsigned long long int get_allocated_internal_memory () const
 Returns the amount of memory allocated internally but not private. More...
 
unsigned long long int get_next_internal_base_address () const
 Returns next free address of memory allocated internally but not private. More...
 
unsigned long long int get_max_address () const
 return the maximum address allocated More...
 
void set_bus_data_bitsize (unsigned long long bitsize)
 set the bus data bitsize More...
 
unsigned long long get_bus_data_bitsize () const
 return the bitsize of the data bus More...
 
void set_bus_size_bitsize (unsigned long long bitsize)
 set the bus size bitsize More...
 
unsigned long long get_bus_size_bitsize () const
 return the bitsize of the size bus More...
 
void set_bram_bitsize (unsigned long long bitsize)
 set the BRAM bitsize More...
 
unsigned long long get_bram_bitsize () const
 return the BRAM bitsize More...
 
void set_maxbram_bitsize (unsigned int bitsize)
 set the maximum BRAM bitsize More...
 
unsigned int get_maxbram_bitsize () const
 return the BRAM bitsize More...
 
void set_intern_shared_data (bool has_accesses)
 define if the Spec has data that can be externally accessed More...
 
bool has_intern_shared_data () const
 return true in case the specification has data that can be externally accessed More...
 
void set_maximum_references (unsigned int var, size_t n_refs)
 define the maximum number of references for a given variable More...
 
size_t get_maximum_references (unsigned int var) const
 return the maximum number of references for a given variable More...
 
void set_maximum_loads (unsigned int var, size_t n_refs)
 define the maximum number of loads for a given variable More...
 
size_t get_maximum_loads (unsigned int var) const
 return the maximum number of loads for a given variable More...
 
void add_need_bus (unsigned int var)
 the variable is read or written through the bus More...
 
bool does_need_addr (unsigned int var) const
 check if a load or a store of the variable is done trough the bus More...
 
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 More...
 
bool has_unknown_addresses () const
 return true in case the specification use addresses not known at compile time More...
 
void set_unaligned_accesses (bool accesses)
 set if LOADs or STOREs perform unaligned accesses More...
 
bool has_unaligned_accesses () const
 return true in case of unaligned accesses More...
 
void set_all_pointers_resolved (bool resolved)
 define if all pointers have statically resolved More...
 
bool has_all_pointers_resolved () const
 return true in case all pointers have been statically resolved More...
 
void set_packed_vars (bool packed)
 update the the packed variables status More...
 
bool has_packed_vars () const
 
void set_implicit_memcpy (bool cond)
 define if there exist an implicit call of memcpy More...
 
bool has_implicit_memcpy () const
 return true in case the specification has an implicit call of memcpy More...
 
unsigned long long get_internal_base_address_alignment () const
 return the internal base address alignment. More...
 
unsigned long long get_parameter_alignment () const
 return the parameter alignment More...
 
void set_internal_base_address_alignment (unsigned long long _internal_base_address_alignment)
 set the internal base address alignment More...
 
void xwrite (xml_element *node)
 Writes the current memory allocation into an XML description. More...
 
void xwrite2 (xml_element *node)
 Writes the current memory allocation into an XML description. More...
 
void xwrite (const std::string &filename)
 Writes the current memory allocation into an XML description. More...
 
unsigned int count_non_private_internal_symbols () const
 
bool notEQ (refcount< memory > ref) const
 return true in case the current memory object and the passed one are different More...
 
void set_enable_hls_bit_value (bool value)
 
bool get_enable_hls_bit_value ()
 

Private Attributes

unsigned int bus_tag_bitsize
 bus data bitsize More...
 

Additional Inherited Members

- Static Public Member Functions inherited from memory
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)
 
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. More...
 
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. More...
 

Detailed Description

Definition at line 45 of file memory_cs.hpp.

Constructor & Destructor Documentation

◆ memory_cs()

memory_cs::memory_cs ( 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 
)
inline

Constructor.

Definition at line 54 of file memory_cs.hpp.

References ~memory_cs().

Here is the call graph for this function:

◆ ~memory_cs()

memory_cs::~memory_cs ( )
overridedefault

Destructor.

Referenced by memory_cs().

Here is the caller graph for this function:

Member Function Documentation

◆ get_bus_tag_bitsize()

unsigned int memory_cs::get_bus_tag_bitsize ( ) const
inline

return the bitsize of the tag bus

Definition at line 79 of file memory_cs.hpp.

References bus_tag_bitsize.

◆ set_bus_tag_bitsize()

void memory_cs::set_bus_tag_bitsize ( unsigned int  bitsize)
inline

set the bus tag bitsize

Definition at line 71 of file memory_cs.hpp.

Field Documentation

◆ bus_tag_bitsize

unsigned int memory_cs::bus_tag_bitsize
private

bus data bitsize

Definition at line 48 of file memory_cs.hpp.

Referenced by get_bus_tag_bitsize().


The documentation for this class was generated from the following file:

Generated on Mon Feb 12 2024 13:03:57 for PandA-2024.02 by doxygen 1.8.13