asmat


Nameasmat JSON
Version 1.2.1 PyPI version JSON
download
home_pagehttps://github.com/erwanlem/atp
SummaryAssembly Testing and Analysis
upload_time2024-07-01 12:31:56
maintainerNone
docs_urlNone
authorErwan LEMATTRE
requires_python>=3.6
licenseMIT
keywords assembler test analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ASMAT manual

## Name

asmat - Assembly Analysis and Testing

## Description

**ASMAT** is a testing and analysis tool made for checking assembly code efficency. This tool offers three main actions: **generation**, **validation** and **analysis**.
The generation phase generates reference assembly code. This code is stored in a reference folder.
The validation phase compares assembly code generated by the current library version with assembly code in the reference folder.
The analysis of a program gives information about assembly code that a compiler generates. Analysis is **only available for x86 instruction set**.



## Installation

``` shell
pip install asmat
```


## Command line - Options

**-a**, **--analysis**  
Analysis mode. Generates a detailed report of the assembly code generated by a compiler using a specific cpu extension. This mode can't be selected with validation or generation at the same time.

**--build**  
Build default files and directories `settings.json`, `ref/`. 

**-c** *compiler*, **--compiler** *compiler*  
The code is only generated and tested for the given compiler.

**-d**  Deep generation. When generating assembly this option will replace existing files even though they already contain assembly code. Enable this option when you want to update reference files outdated (otherwise reference files are not changed if they already exist).

**-D** *tool*, **--disassembler** *tool*  
Defines the disassembling tool. Available disassembling tools are `standard` (*-S* option of compilers) or `objdump`. Assembly code generated by one of this tool can't be validated by the other. Default value is `objdump`. The *standard* option is only available for *gcc* and *clang* compilers.

**-f** , **--fatal**  
Raises exception. This option interrupts the testing process if there is an assembly mismatch error. Useless for generation.

**--flags** *flags*  
Flags used for compilation. Flags musn't contain dashes. It has the highest priority for the compilation process. It means that if flags are given, *-m* options is ignored even though it's also given. If there are no flags, default flags are used.

**-g**  Generation mode. Generates assembly code and stores it in `ref`. Without this option, the default mode is validation.

**-H** *headers*, **--header** *headers*  
Defines headers for compilation. *`headers`* are paths that will be add in C++ file as follows *#include <**header**>*. If this option is not given, headers are extracted from `settings.json`.

**-i**  Instruction comparison. Compares only instructions and ignores their parameters.

**--input** *files* | *group*  
Defines your own input file or group. Without this option all config files are used. The given file must exist in folder `config`. If a group is given it mist exist in `settings.json`. The priority is *config file*, *group*, *all*. When generating, it only generates those files. When validating, it only compares those files.

**-j** *nbprocess*  
Defines the number of parallel compilations. The default number of parallel processes is equal to the number of processors cores.

**-l**  Log. Generates a log file giving details about errors that occured during the validation. Two types of errors are described: *comparison errors* that occured when assembly code doesn't correspond and *missing reference* that occured when a function doesn't have a reference file.

**--output** *path*  
The path of the output. If this option is not defined, it takes the default path which is the directory *ref*.

**--ref** *reference_path*  
Defines a custom path for the reference folder. When generating it changes the location of the stored files. When validating it changes the place we get the reference files.

**--reset**  
Clears the `ref` directory.

**-s** *setup*, **--setup** *setup*  
The code is only generated and validated for the given simd extension. The given extension name **must** exist in `settings.json`.

**-S** *limit*, **--functionsperfile** *limit*  
Limit the number of functions in *cpp* files. If the number of functions is greater than the limit it creates several *cpp* files that are compiled seperately.

**--settings** *path*  
Defines the path to access the settings file. If not given it takes `settings.json` in the *src* directory. If given, it first searches the path in the *src* directory. If not found it searches *path*.

**-t**  Keeps temporary files after the process. Temporary files are files used to produce assembly code:
- tmp.cpp : Contains generated cpp functions
- tmp.o : Compiled file
- tmp.txt : Contains assembly code extracts from tmp.o.

**-v**  Verbose. Displays information in the command line. At the end of the process it gives the time elapsed since the beginning of the process.


## API - Examples

``` python
import asmat

# Generates requiered files if they do not exist
asmat.build_dependencies()

# Creates user query
s = asmat.setup()
s.verbose = True
s.keep_tmp = True

# Generation of references
asmat.generate(s)

# Validation of references
asmat.validate(s)

# Analysis of assembly code
asmat.analyze(s, "gcc", "sse")
```




### Settings
Settings are stored in `settings.json`. This file can be generated by calling `build_dependencies()` or by using `--build` option in console.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/erwanlem/atp",
    "name": "asmat",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "ASSEMBLER, TEST, ANALYSIS",
    "author": "Erwan LEMATTRE",
    "author_email": "erwanlem4@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b2/31/64d5cfd0d43b506fafebc0d1bd65c1a9c531b3ae8ea8c785ac54a3234dbe/asmat-1.2.1.tar.gz",
    "platform": null,
    "description": "# ASMAT manual\n\n## Name\n\nasmat - Assembly Analysis and Testing\n\n## Description\n\n**ASMAT** is a testing and analysis tool made for checking assembly code efficency. This tool offers three main actions: **generation**, **validation** and **analysis**.\nThe generation phase generates reference assembly code. This code is stored in a reference folder.\nThe validation phase compares assembly code generated by the current library version with assembly code in the reference folder.\nThe analysis of a program gives information about assembly code that a compiler generates. Analysis is **only available for x86 instruction set**.\n\n\n\n## Installation\n\n``` shell\npip install asmat\n```\n\n\n## Command line - Options\n\n**-a**, **--analysis**  \nAnalysis mode. Generates a detailed report of the assembly code generated by a compiler using a specific cpu extension. This mode can't be selected with validation or generation at the same time.\n\n**--build**  \nBuild default files and directories `settings.json`, `ref/`. \n\n**-c** *compiler*, **--compiler** *compiler*  \nThe code is only generated and tested for the given compiler.\n\n**-d**  Deep generation. When generating assembly this option will replace existing files even though they already contain assembly code. Enable this option when you want to update reference files outdated (otherwise reference files are not changed if they already exist).\n\n**-D** *tool*, **--disassembler** *tool*  \nDefines the disassembling tool. Available disassembling tools are `standard` (*-S* option of compilers) or `objdump`. Assembly code generated by one of this tool can't be validated by the other. Default value is `objdump`. The *standard* option is only available for *gcc* and *clang* compilers.\n\n**-f** , **--fatal**  \nRaises exception. This option interrupts the testing process if there is an assembly mismatch error. Useless for generation.\n\n**--flags** *flags*  \nFlags used for compilation. Flags musn't contain dashes. It has the highest priority for the compilation process. It means that if flags are given, *-m* options is ignored even though it's also given. If there are no flags, default flags are used.\n\n**-g**  Generation mode. Generates assembly code and stores it in `ref`. Without this option, the default mode is validation.\n\n**-H** *headers*, **--header** *headers*  \nDefines headers for compilation. *`headers`* are paths that will be add in C++ file as follows *#include <**header**>*. If this option is not given, headers are extracted from `settings.json`.\n\n**-i**  Instruction comparison. Compares only instructions and ignores their parameters.\n\n**--input** *files* | *group*  \nDefines your own input file or group. Without this option all config files are used. The given file must exist in folder `config`. If a group is given it mist exist in `settings.json`. The priority is *config file*, *group*, *all*. When generating, it only generates those files. When validating, it only compares those files.\n\n**-j** *nbprocess*  \nDefines the number of parallel compilations. The default number of parallel processes is equal to the number of processors cores.\n\n**-l**  Log. Generates a log file giving details about errors that occured during the validation. Two types of errors are described: *comparison errors* that occured when assembly code doesn't correspond and *missing reference* that occured when a function doesn't have a reference file.\n\n**--output** *path*  \nThe path of the output. If this option is not defined, it takes the default path which is the directory *ref*.\n\n**--ref** *reference_path*  \nDefines a custom path for the reference folder. When generating it changes the location of the stored files. When validating it changes the place we get the reference files.\n\n**--reset**  \nClears the `ref` directory.\n\n**-s** *setup*, **--setup** *setup*  \nThe code is only generated and validated for the given simd extension. The given extension name **must** exist in `settings.json`.\n\n**-S** *limit*, **--functionsperfile** *limit*  \nLimit the number of functions in *cpp* files. If the number of functions is greater than the limit it creates several *cpp* files that are compiled seperately.\n\n**--settings** *path*  \nDefines the path to access the settings file. If not given it takes `settings.json` in the *src* directory. If given, it first searches the path in the *src* directory. If not found it searches *path*.\n\n**-t**  Keeps temporary files after the process. Temporary files are files used to produce assembly code:\n- tmp.cpp : Contains generated cpp functions\n- tmp.o : Compiled file\n- tmp.txt : Contains assembly code extracts from tmp.o.\n\n**-v**  Verbose. Displays information in the command line. At the end of the process it gives the time elapsed since the beginning of the process.\n\n\n## API - Examples\n\n``` python\nimport asmat\n\n# Generates requiered files if they do not exist\nasmat.build_dependencies()\n\n# Creates user query\ns = asmat.setup()\ns.verbose = True\ns.keep_tmp = True\n\n# Generation of references\nasmat.generate(s)\n\n# Validation of references\nasmat.validate(s)\n\n# Analysis of assembly code\nasmat.analyze(s, \"gcc\", \"sse\")\n```\n\n\n\n\n### Settings\nSettings are stored in `settings.json`. This file can be generated by calling `build_dependencies()` or by using `--build` option in console.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Assembly Testing and Analysis",
    "version": "1.2.1",
    "project_urls": {
        "Download": "https://github.com/erwanlem/atp/archive/refs/tags/v1.0.tar.gz",
        "Homepage": "https://github.com/erwanlem/atp"
    },
    "split_keywords": [
        "assembler",
        " test",
        " analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dc1db6e22a5fbd7b5a62fd406ac2754012c2422abaf2a17616d81f9756fe02a3",
                "md5": "e5500bcda3dddda31a071d5e7aa12c2d",
                "sha256": "4a6e0c314c36e02cee48f166ca049bc9086c5bb3d0862f249be6698802c13211"
            },
            "downloads": -1,
            "filename": "asmat-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e5500bcda3dddda31a071d5e7aa12c2d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 134381,
            "upload_time": "2024-07-01T12:31:54",
            "upload_time_iso_8601": "2024-07-01T12:31:54.814261Z",
            "url": "https://files.pythonhosted.org/packages/dc/1d/b6e22a5fbd7b5a62fd406ac2754012c2422abaf2a17616d81f9756fe02a3/asmat-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b23164d5cfd0d43b506fafebc0d1bd65c1a9c531b3ae8ea8c785ac54a3234dbe",
                "md5": "53c07d41d9667c89e3d376645f73933b",
                "sha256": "e60c6a027807c1c0234f097d077e3aa4d401f4b9056e01decd58c303159f56f6"
            },
            "downloads": -1,
            "filename": "asmat-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "53c07d41d9667c89e3d376645f73933b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 135221,
            "upload_time": "2024-07-01T12:31:56",
            "upload_time_iso_8601": "2024-07-01T12:31:56.781565Z",
            "url": "https://files.pythonhosted.org/packages/b2/31/64d5cfd0d43b506fafebc0d1bd65c1a9c531b3ae8ea8c785ac54a3234dbe/asmat-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-01 12:31:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "erwanlem",
    "github_project": "atp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "asmat"
}
        
Elapsed time: 0.45118s