ARM-software / ATP-Engine

BSD 3-Clause Clear License
20 stars 17 forks source link

AMBA ATP Engine

AMBA Adaptive Traffic Profiles (ATP) Engine is a C++11 implementation of the AMBA ATP specification (ARM IHI 0082A). The latter describes Traffic Profiles as definitions of the transaction characteristics of an interface. With AMBA ATP Engine, Traffic Profiles may be defined and composed in order to model master / slave component behaviours within a system.

Description

The following are central concepts to AMBA ATP Engine:

A copy of the official Guide is included in this repository. Please refer to it for further information.

Installation

The Engine may be built as a standalone executable or as part of a host platform, such as gem5. GNU/Linux and macOS environments are supported.

Requirements

If building as part of a host platform, verify host platform requirements are satisfied. For gem5, see requirements.

git clone https://github.com/ARM-software/ATP-Engine

Standalone

cd ATP-Engine/
make -j $(nproc)

An executable atpeng and a static library libatp.a are produced as a result.

Hosted (gem5)

git clone https://github.com/gem5/gem5 -b v20.1.0.2
cd gem5/
scons EXTRAS=../ATP-Engine -j $(nproc) build/ARM/gem5.opt

ATP Engine is integrated in the resulting gem5/build/ARM/gem5.opt binary.

Usage

Traffic Profiles Definition

Traffic Profiles are defined in ATP files (.atp), which are later loaded into the Engine through TPM. Several example ATP files may be found under configs/. See Appendix A - AMBA ATP Engine Configuration in the official Guide for documentation on .atp syntax.

Standalone

Basic use

./atpeng [.atp file, ...] <rate> <latency>

This will instantiate and activate the Traffic Profiles defined in those files along with a default Slave Traffic Profile defined by rate and latency.

Interactive mode (experimental)

./atpeng -i

This will spawn an interactive shell. Type help from within for more information.

Output

At the end of a usage, the Engine produces a set of statistics, both global and per maste / slave component. See 3.4 - Statistics in the official Guide.

Hosted (gem5)

The gem5/ directory contains models and configurations for integration with the gem5 simulator, in particular:

Basic use

gem5 may parse, configure, instantiate and run the simulation from atp.py as follows:

gem5/build/ARM/gem5.opt ATP-Engine/gem5/atp.py

The following are some examples of atp.py usage:

# Load and activate standard.atp
[...]/atp.py --config_files ATP-Engine/configs/example.atp
# Configure a STREAM_A read Stream and STREAM_B write Stream each on its own master; provide base, range and simulation ID
# Note: these Streams are required to exist within the Engine, i.e. loaded via "config_files" or "config-paths"
[...]/atp.py --streams STREAM_A,MASTER_A,R,0x1000,0x2000,123456 STREAM_B,MASTER_B,R,0x5000,0x2000,123457
# Load all ATP files and activate Traffic Profiles under gui_examples/
[...]/atp.py --config-paths ATP-Engine/configs/gui_examples

Output

Engine statistics are combined into gem5 statistics when running along it. See Understanding gem5 statistics and output for more information.

Testing

Engine unit tests are based on the cppunit library. To run all tests:

./atpeng

Authors and acknowledgment

License

AMBA ATP Engine code is licensed under the Clear BSD License, see LICENSE for details.