PandA-2024.02
Public Member Functions | Protected Member Functions | Protected Attributes
CreateAddressTranslation Class Reference

Class which creates source code of hdl module to translate addresses from pci address space to bambu address space. More...

#include <create_address_translation.hpp>

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

Public Member Functions

 CreateAddressTranslation (const application_managerRef AppM, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
 Constructor. More...
 
 ~CreateAddressTranslation () override
 Destructor. More...
 
DesignFlowStep_Status Exec () override
 Execute this step. More...
 
- Public Member Functions inherited from ApplicationFrontendFlowStep
 ApplicationFrontendFlowStep (const application_managerRef AppM, const FrontendFlowStepType frontend_flow_step_type, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
 Constructor. More...
 
 ~ApplicationFrontendFlowStep () override
 Destructor. More...
 
std::string GetSignature () const override
 Return the signature of this step. More...
 
std::string GetName () const override
 Return the name of this design step. More...
 
- Public Member Functions inherited from FrontendFlowStep
 FrontendFlowStep (const application_managerRef AppM, const FrontendFlowStepType frontend_flow_step_type, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
 Constructor. More...
 
 ~FrontendFlowStep () override
 Destructor. More...
 
void ComputeRelationships (DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override
 Compute the relationships of a step with other steps. More...
 
virtual std::string GetKindText () const
 Return the name of the type of this frontend flow step. More...
 
DesignFlowStepFactoryConstRef CGetDesignFlowStepFactory () const override
 Return the factory to create this type of steps. More...
 
void PrintTreeManager (const bool before) const
 Dump the tree manager. More...
 
void PrintInitialIR () const override
 Dump the initial intermediate representation. More...
 
void PrintFinalIR () const override
 Dump the final intermediate representation. More...
 
- Public Member Functions inherited from DesignFlowStep
 DesignFlowStep (const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
 Constructor. More...
 
virtual ~DesignFlowStep ()
 Destructor. More...
 
DesignFlowStep_Status GetStatus () const
 Return the status of this design step. More...
 
virtual void WriteDot (std::ostream &out) const
 Write the label for a dot graph. More...
 
bool IsComposed () const
 Returns if this step is composed. More...
 
int CGetDebugLevel () const
 Return the debug level of the step. More...
 

Protected Member Functions

void ComputeAddress (const AsnTypeRef asn_type, const unsigned int tree_parameter_type, unsigned long long &bambu_address, unsigned long long int &taste_address, unsigned int &registers, const bool first_level, const bool little_endianess)
 Compute the addresses and add them to the writers. More...
 
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > ComputeFrontendRelationships (const DesignFlowStep::RelationshipType relationship_type) const override
 Return the set of analyses in relationship with this design step. More...
 
void Initialize () override
 Initialize the step (i.e., like a constructor, but executed just before exec. More...
 
bool HasToBeExecuted () const override
 Check if this step has actually to be executed. More...
 

Protected Attributes

IndentedOutputStreamRef address_translation
 The address translation stream. More...
 
IndentedOutputStreamRef memory_enabling
 The memory enabling stream. More...
 
IndentedOutputStreamRef data_size
 The data size stream. More...
 
IndentedOutputStreamRef endianess_check
 The endianess check stream. More...
 
tree_managerConstRef TreeM
 The tree manager. More...
 
const AadlInformationRef aadl_information
 The asn information. More...
 
bool already_executed {false}
 True if it was already executed. More...
 
- Protected Attributes inherited from FrontendFlowStep
const application_managerRef AppM
 The application manager. More...
 
const FrontendFlowStepType frontend_flow_step_type
 The type of this step. More...
 
unsigned int print_counter
 Print counter. More...
 
- Protected Attributes inherited from DesignFlowStep
bool composed
 True if this step represents a composition of design flow steps (e.g., a flow); must be set by specialized constructors. More...
 
const Wrefcount< const DesignFlowManagerdesign_flow_manager
 The design flow manager. More...
 
const ParameterConstRef parameters
 Set of input parameters. More...
 
int debug_level
 The debug level. More...
 
const int output_level
 The output level. More...
 

Additional Inherited Members

- Public Types inherited from FrontendFlowStep
using FunctionRelationship = enum { ALL_FUNCTIONS, CALLED_FUNCTIONS, CALLING_FUNCTIONS, SAME_FUNCTION, WHOLE_APPLICATION }
 The different relationship type between function analysis. More...
 
- Public Types inherited from DesignFlowStep
enum  RelationshipType { DEPENDENCE_RELATIONSHIP, INVALIDATION_RELATIONSHIP, PRECEDENCE_RELATIONSHIP }
 The relationship type. More...
 
- Static Public Member Functions inherited from ApplicationFrontendFlowStep
static const std::string ComputeSignature (const FrontendFlowStepType frontend_flow_step_type)
 Compute the signature of a function frontend flow step. More...
 
- Static Public Member Functions inherited from FrontendFlowStep
static void CreateSteps (const DesignFlowManagerConstRef design_flow_manager, const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship >> &frontend_relationships, const application_managerConstRef application_manager, DesignFlowStepSet &relationships)
 Create the relationship steps of a step with other steps starting from already specified dependencies between frontend flow steps. More...
 
static const std::string EnumToKindText (const FrontendFlowStepType frontend_flow_step_type)
 Given a frontend flow step type, return the name of the type. More...
 

Detailed Description

Class which creates source code of hdl module to translate addresses from pci address space to bambu address space.

Definition at line 53 of file create_address_translation.hpp.

Constructor & Destructor Documentation

◆ CreateAddressTranslation()

CreateAddressTranslation::CreateAddressTranslation ( const application_managerRef  AppM,
const DesignFlowManagerConstRef  design_flow_manager,
const ParameterConstRef  parameters 
)

Constructor.

Parameters
AppMis the application manager
design_flow_manageris the design flow manager
parametersis the set of input parameters

Definition at line 58 of file create_address_translation.cpp.

References DesignFlowStep::debug_level, GET_CLASS, DesignFlowStep::parameters, and ~CreateAddressTranslation().

Here is the call graph for this function:

◆ ~CreateAddressTranslation()

CreateAddressTranslation::~CreateAddressTranslation ( )
overridedefault

Destructor.

Referenced by CreateAddressTranslation().

Here is the caller graph for this function:

Member Function Documentation

◆ ComputeAddress()

void CreateAddressTranslation::ComputeAddress ( const AsnTypeRef  asn_type,
const unsigned int  tree_parameter_type,
unsigned long long &  bambu_address,
unsigned long long int &  taste_address,
unsigned int &  registers,
const bool  first_level,
const bool  little_endianess 
)
protected

Compute the addresses and add them to the writers.

Parameters
asn_typeis the type of the asn parameter
tree_parameter_typeis the index of the type
bambu_addressis the current starting address for bambu interface
taste_addressis the current starting address for taste interface
registersis the number of registers to be allocated for this parameter
first_levelis true if we are analyzing a parameter and not something inside a parameter
little_endianesstells if the parameter has little endianess

Definition at line 99 of file create_address_translation.cpp.

References aadl_information, address_translation, IndentedOutputStream::Append(), BOOLEAN, tree_helper::CGetPointedType(), tree_manager::CGetTreeNode(), tree_manager::CGetTreeReindex(), tree_helper::CGetType(), CHOICE, counter, data_size, DesignFlowStep::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, endianess_check, ENUMERATED, GET_NODE, tree_manager::get_tree_node_const(), tree_helper::GetConstValue(), AsnType::GetKind(), INDENT_DBG_MEX, index, tree_node::index, INTEGER, memory_enabling, OCTET_STRING, REAL, REDEFINE, SEQUENCE, SEQUENCEOF, SET, SETOF, tree_helper::Size(), STR, THROW_ASSERT, THROW_ERROR, THROW_UNREACHABLE, and TreeM.

Referenced by Exec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeFrontendRelationships()

const CustomUnorderedSet< std::pair< FrontendFlowStepType, FrontendFlowStep::FunctionRelationship > > CreateAddressTranslation::ComputeFrontendRelationships ( const DesignFlowStep::RelationshipType  relationship_type) const
overrideprotectedvirtual

Return the set of analyses in relationship with this design step.

Parameters
relationship_typeis the type of relationship to be considered

Implements FrontendFlowStep.

Definition at line 71 of file create_address_translation.cpp.

References DesignFlowStep::DEPENDENCE_RELATIONSHIP, DesignFlowStep::design_flow_manager, ApplicationFrontendFlowStep::GetSignature(), DesignFlowStep::INVALIDATION_RELATIONSHIP, Wrefcount< T >::lock(), DesignFlowStep::PRECEDENCE_RELATIONSHIP, SUCCESS, THROW_UNREACHABLE, and WHOLE_APPLICATION.

Here is the call graph for this function:

◆ Exec()

DesignFlowStep_Status CreateAddressTranslation::Exec ( )
overridevirtual

Execute this step.

Returns
the exit status of this step

The taste address of return (if any)

Taste address starts from 4, since first 4 bytes are reserved to status register

Build the map between parameter name and index type

Starting address of the parameter

Storing starting coming from outside

We are running if we receive the start and we were not running or if we were running and we didn't receive done

We ended if (we ended in the past or we just ended) and we were not starting

We are starting if we start and we are not running

Implements ApplicationFrontendFlowStep.

Definition at line 406 of file create_address_translation.cpp.

References aadl_information, address_translation, already_executed, IndentedOutputStream::Append(), FrontendFlowStep::AppM, test_panda::arg, tree_helper::CGetType(), ComputeAddress(), data_size, DesignFlowStep::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, endianess_check, refcount< T >::get(), GET_CONST_NODE, GET_NODE, tree_manager::GetFunction(), INDENT_DBG_MEX, tree_node::index, tree_helper::is_a_pointer(), memory_enabling, DesignFlowStep::parameters, STR, STR_CST_string_separator, STR_CST_taste_address_translation, STR_CST_taste_data_size, STR_CST_taste_endianess_check, STR_CST_taste_endianess_inversion, STR_CST_taste_memory_enabling, STR_CST_taste_output_multiplexer, STR_CST_taste_reg_status, SUCCESS, THROW_ASSERT, TreeM, UNCHANGED, and IndentedOutputStream::WriteFile().

Here is the call graph for this function:

◆ HasToBeExecuted()

bool CreateAddressTranslation::HasToBeExecuted ( ) const
overrideprotectedvirtual

Check if this step has actually to be executed.

Returns
true if the step has to be executed

Reimplemented from ApplicationFrontendFlowStep.

Definition at line 619 of file create_address_translation.cpp.

References already_executed.

◆ Initialize()

void CreateAddressTranslation::Initialize ( )
overrideprotectedvirtual

Initialize the step (i.e., like a constructor, but executed just before exec.

Reimplemented from DesignFlowStep.

Definition at line 613 of file create_address_translation.cpp.

References FrontendFlowStep::AppM, DesignFlowStep::Initialize(), and TreeM.

Here is the call graph for this function:

Field Documentation

◆ aadl_information

const AadlInformationRef CreateAddressTranslation::aadl_information
protected

The asn information.

Definition at line 72 of file create_address_translation.hpp.

Referenced by ComputeAddress(), and Exec().

◆ address_translation

IndentedOutputStreamRef CreateAddressTranslation::address_translation
protected

The address translation stream.

Definition at line 57 of file create_address_translation.hpp.

Referenced by ComputeAddress(), and Exec().

◆ already_executed

bool CreateAddressTranslation::already_executed {false}
protected

True if it was already executed.

Definition at line 75 of file create_address_translation.hpp.

Referenced by Exec(), and HasToBeExecuted().

◆ data_size

IndentedOutputStreamRef CreateAddressTranslation::data_size
protected

The data size stream.

Definition at line 63 of file create_address_translation.hpp.

Referenced by ComputeAddress(), and Exec().

◆ endianess_check

IndentedOutputStreamRef CreateAddressTranslation::endianess_check
protected

The endianess check stream.

Definition at line 66 of file create_address_translation.hpp.

Referenced by ComputeAddress(), and Exec().

◆ memory_enabling

IndentedOutputStreamRef CreateAddressTranslation::memory_enabling
protected

The memory enabling stream.

Definition at line 60 of file create_address_translation.hpp.

Referenced by ComputeAddress(), and Exec().

◆ TreeM

tree_managerConstRef CreateAddressTranslation::TreeM
protected

The tree manager.

Definition at line 69 of file create_address_translation.hpp.

Referenced by ComputeAddress(), Exec(), and Initialize().


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

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