Rate This Document
Findability
Accuracy
Completeness
Readability

Working Principle

Porting Advisor and Affinity Analyzer

The Porting Advisor and Affinity Analyzer use the same architecture. See Figure 1.

Figure 1 Architecture of the Porting Advisor
Table 1 Modules of the Porting Advisor and Affinity Analyzer

Module

Function

Nginx

An open-source third-party component, which needs to be installed for the tool in WebUI mode.

Nginx processes HTTPS requests from the frontend, provides static pages for the frontend, or transfers user-input data to the backend, and returns the scan result to the user.

Django

An open-source third-party component, which needs to be installed for the tool in WebUI mode.

Django is a RESTful framework that converts HTTP requests into RESTful APIs and drives backend functional modules. It also supports user authentication and management.

Main entry

An entry to the CLI.

This module parses user-input parameters and drives functional modules to complete jobs specified by the user.

Dependency dictionary check

Compares the SO files in the software package scanned with the SO dependency dictionary to obtain the detailed information about all SO libraries.

C/C++/ASM/Fortran/Go/Interpreted language source code check

Scans and analyzes the source file set on which the target binary file of the user software depends. It checks the architecture-related compilation options and macros, built-in functions, attributes, and user-defined macros used in the source code based on the compiler version to identify the source code and source file to be ported. This module provides the following functions:

  • Checks software build configuration files.
  • Checks the source code of C, C++, ASM, Fortran, Go, or interpreted language. Fortran 03, Fortran 77, Fortran 90, and Fortran 95 are supported.
  • Checks x86 assembly code and provides transcoding suggestions.

Compiler check

Identifies the compilation macros and options, built-in functions, and attributes that are different between the x86 and Kunpeng platforms based on the compiler version.

Software porting guide

  1. Generates a software porting evaluation report in CSV or HTML format based on the compiler check, dependency check, and C/C++/ASM/Fortran/Go/interpreted language source code scan results.
  2. Outputs a software porting summary to the terminal.

Software porting assessment

Scans and analyzes software packages (non-source packages) and installed software, and provides porting assessment reports.

Source code porting

Automatically analyzes the source package and provides suggestions on porting to the Kunpeng 916 or Kunpeng 920 platform.

Dedicated software porting

Provides solution-specific software porting methods.

Software package rebuild

Analyzes and rebuilds an x86 software package to make it applicable to the Kunpeng platform.

64-bit running mode check

Identifies the 32-bit applications to be ported from the x86 platform to the 64-bit Kunpeng platform and provides modification suggestions.

Structure byte alignment check

Checks the memory allocation of the structure variables in the software.

Cache line alignment check

Checks the 128-byte alignment of structure variables in the C/C++ source code to improve memory access performance.

Memory consistency check

Checks for or rectifies any memory consistency problems based on user requirements:

  • Checks the user source code, generates alarms for potential memory consistency problems, and provides rectification suggestions.
  • Rectifies the memory consistency problems using the compiler tool during the software compilation process.
  • Demonstrates how to generate a BC file for scanning.
NOTE:

BC is the format of bitcode files of the intermediate representation (IR) in a compiler.