Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Manager Redesign #5

Closed
10 tasks done
KGergo88 opened this issue Jul 9, 2019 · 3 comments
Closed
10 tasks done

Memory Manager Redesign #5

KGergo88 opened this issue Jul 9, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request high prio This issue shall be prioritised

Comments

@KGergo88
Copy link
Member

KGergo88 commented Jul 9, 2019

Preconditions

  • We need to have functional tests for the test_project with Emma (see Testing #3) before we change anything in order to be sure that the same values will come out from Emma after the changes

Postconditions

  • Unused imports needs to be removed
  • Integrate individual mapfile paths feature (issue Add paths for map files in configID #16 )
  • Document added with description how to add support for new compilers
    • Evaluate where this would belong: separate document or in the contributions document? It was described in the doc/contribution.md
    • Add description to the doc/contribution.md about the compiler specific configuration design hints
    • Add instructions to the contribution.md which documents and tests need to be added for the new compiler supprt
    • Make it clear in the doc/readme.md which parts of the configuration is general and which is compiler specific
    • Move the current specific parts into a GHS configuration chapter

Branch

  • The issue needs to be developed on the ISSUE_#5_MemoryManagerRedesign branch

Necessary configuration changes:

  • The globalConfig.json needs to contain a new key for every configId that specifies the used compiler. This is needed to be able to instantiate the compiler dependent Compiler and MapfileProcessor objects. This can not be a command line argument because it is possible to have configurations where the configIds have different compilers.

Motivation

  • The MemoryManager class is:
    • simply too big to develop unit test​s for it
    • way too complex to integrate the future changes, like the gcc compiler into it
    • the compiler specific parts are not separated from the generic ones

New design

UML Diagram

Description of the new classes (a slightly different design was implemented, see UML Diagram)

  • MemoryManager:
    • Organizing the process of creating CVS files from the configuration files and the mapfiles
    • It executes each task trough registered objects to be independent from the implementation details of these
    • It contains as minimal code as possible, it only serves the purpose of organization and providing it´s components with data
    • List of registered objects:
      • A specialized configuration object
      • A specialized mapfile processor object
      • MemoryMap
  • Configuration

    • A superclass of compiler specific configuration processors
    • Processes the generic parts of the configuration
    • Provides an interface to use the processed information
    • Tasks that are realized in the superclass:
      • Processing the global_config.json
      • Processing the addressSpaces_*.json
      • Processing the "mapfile" object in the patterns_*.json
      • Processing the categoriesObjects.json
      • Processing the categoriesObjectsKeywords.json
      • Processing the categoriesSections.json
      • Processing the categoriesSectionsKeywords.json
      • List of functions:
        readGlobalConfigJson()
        __addFilesPerConfigID()
        __addMapfilesToGlobalConfig()
        __validateConfigIDs()
        removeUnmatchedFromCategoriesJson()
        createCategoriesJson()
    • Tasks that are realized in the subclasses:
      • Processing the rest of the patterns_*.json (the "mapfile" object is processed in the superclass)
      • Processing of virtualSections_*.json (because we do not know the VAS-es are with other compilers)
      • List of functions:
        checkMonolithSections()
        __addTabularisedMonoliths()
        __addMonolithsToGlobalConfig()
  • MapfileProcessor

    • Superclass of compiler specific mapfile processors
    • Tasks that are realized in the superclass:
      • Doing generic tasks during the mapfile content processing
      • Produces a list of ObjectEntry and a list of SectionEntry objects
      • List of functions:
        __evalMemRegion()
        __addMemEntry()
        __categoriseByKeyword()
        __searchCategoriesJson()
        __evalCategory()
        __evalRegexPattern()
    • Tasks that are realized in the subclasses:
      • Doing specific tasks during the mapfile content processing
      • List of functions:
        __translateAddress()
        importData()
  • MemoryMap

    • Receives a list of ObjectEntry objects and a list of SectionEntry objects
    • Resolves the duplication, containment and overlap of these lists
    • After the resolving it creates the ObjectsInSections MemEntry object list
    • From these three lists it creates the ObjectSummary, the ImageSummary and the ObjectsInSections CVS tables
    • Writes the CVS tables to the HDD
    • List of fuctions:
      writeSummary()
      createMemStatsFilepath()
      consumerCollectionToCSV()
      resolveDuplicateContainmentOverlap()
      calculateObjectsInSections()
      memoryMapToCSV()
@KGergo88 KGergo88 added enhancement New feature or request high prio This issue shall be prioritised labels Jul 9, 2019
@KGergo88 KGergo88 self-assigned this Jul 9, 2019
@KGergo88 KGergo88 mentioned this issue Jul 9, 2019
26 tasks
@KGergo88 KGergo88 changed the title Re-Design of the MemoryManager class Redesign of the MemoryManager class Jul 9, 2019
@KGergo88 KGergo88 changed the title Redesign of the MemoryManager class Memory Manager Redesign Jul 10, 2019
@holzkohlengrill
Copy link
Collaborator

holzkohlengrill commented Jul 15, 2019

Regarding the flags for the compiler options I would comply with the names defined here: https://cmake.org/cmake/help/git-master/variable/CMAKE_LANG_COMPILER_ID.html

Please add this also in the developer documentation ("technical details") that for future implementations those names should be used.

@holzkohlengrill
Copy link
Collaborator

Please update version to 3.0

holzkohlengrill referenced this issue Jul 23, 2019
	Details:
		- Adding constants that define the compiler names
		- Updating the test_project global config with the new compiler names
		- Updating the factories with the new compiler names
@holzkohlengrill
Copy link
Collaborator

New TODO: Include #16 into redesign.

KGergo88 added a commit that referenced this issue Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high prio This issue shall be prioritised
Projects
None yet
Development

No branches or pull requests

2 participants