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

Initial SST SimEng integration. #271

Merged
merged 55 commits into from
Nov 11, 2022
Merged

Initial SST SimEng integration. #271

merged 55 commits into from
Nov 11, 2022

Conversation

rahahahat
Copy link
Contributor

@rahahahat rahahahat commented Nov 7, 2022

This PR implements the SST wrapper needed for successful integration with SST. It also adds support for conditional compilation through CMake and a custom testing framework used for testing the integration. Documentation for running and building SimEng with the SST integration enabled is temporarily available here. It will be added to the source at a later stage.

The custom SST testing framework exposes two main testing macros (TEST_GROUP and TEST_CASE) along with multiple evaluation macros. The framework runs sst with a config file specified by the TEST_GROUP and captures the stdout of the child process, injecting it to individual test cases and allowing the user to define multiple checks on that captured output through the use of evaluation macros. The testing framework also exposes a parser, which parses the output of the sst simulation and turns the output into structs, which can then be used by the tests. Currently, there are two formats:

[SimEng:SSTDebug] MemRead-read-<type=request|response>-<request ID>-cycle-<cycle count>-data-<value>.

The entire output is parsed into:

struct ParsedMemRead {
  uint64_t reqId_;
  uint64_t startCycle_;
  uint64_t endCycle_;
  uint64_t data_;
  uint64_t numReqs_;
};
[SimEng::SSTDebug] OutputLine-<text>. 

This format is parsed, and <text> is extracted by the parser.

The testing framework adds 2 new compile definitions to the initial CMake configuration command:

  • -DSIMENG_ENABLE_SST_TESTS: This definition enables SST Tests only if -DSIMENG_ENABLE_TESTS is defined.
  • -DSST_TESTS_MODEL_CONFIG_PATH: This definition is optional; using this compile definition, the user can specify a SimEng model config. However, if not provided. All tests will, by default, use a64fx-sst.yaml model configuration.

There are 2 sst configuration files added in the testing framework: fastL1ForBinaries.py and fastL1withParams_config.py.
Arguments can be passed to these sst configuration files via test cases using a key value format, i.e. key=value.
Currently, 6 argument types can be passed by test cases and are replaced in the configuration files, ultimately to be passed to SimEngCoreWrapper:

  • execBin : This is the path to an executable executed by SSTSimEng. Example: execBin=/ab/cd/exec.
  • args: These are all the args passed to the executable. Example: args=10 20 50.
  • withSrc: This signals if the test will pass a string of instructions to be assembled by LLVM. Example: withSrc=<True|False>.
  • source: This contains all instructions to be assembled by LLVM. Example: source=mov x1, #0.
  • heap: This contains comma-separated values, which will be used to initialise the heap. Example: heap=10,20,30.
  • clw: This contains the cache line width in bytes: Example: clw=64.

FinnWilkinson and others added 30 commits August 1, 2022 17:38
…ency, rather than update the VCT register to total cycles completed.
A fix for handling missing system registers in the aarch64 systemRegisterMap_ map. A missing entry will return a -1 and a decoded instruction accessing an unmapped system register will raise a new UnmappedSysReg fatal exception.
Fixes output error present for miniBUDE when compiled with GCC-10.3.0 targeting armv8.4-a+sve, caused by an incorrect implementation of the FNEG sve instruction.

Additionally, other SVE instructions were updated to accomodate for optional patterns.
A new generic branch predictor containing parameterisable BTB and RAS structures, global indexing, and better identification of branch instructions. Additionally, a parameterisable loop buffer has been implemented in the fetch unit and a loop detection scheme in the ROB unit.
* Moved counter timer logic from main into Architecture, allowing the implementation to be architecture agnostic.

* Added test for CNTVCT register.

* Updated sveGetPattern auxiliary function to work for any instruction string.

* Ensured all necessary SVE instructions included pattern recognition.

* Changed specialFiles generation directory to be the build location.

* Fixed AArch64_LD1RQ_D_IMM's invalid increments of its index variable.

* Improved conditional branch not taken target and remove loop closing direction due to emergent bug.

* Resolved LSQ bugs for comparisons against the total req limit and forwarding operands from flushed loads.

* Updated comment in sveGetPattern Aux function.
This pull request updates SimEng to use the Armv9.2-update branch of the UoB-HPC Capstone Fork.

Changes to the CMake files have been changed to reflect build changes in the upstream Capstone:next branch.

A pre-upstreamed update to Capstone has been merged into the Armv9.2-update, which adds support for the AArch64 Armv9.2-a ISA (including SVE2 and SME instructions). As such, minor fixes have been made to accommodate changes to instruction enums, aliasing logic, and other changes.
This PR has reduced the number of unused copies of the memory image and thus reduced the memory requirements of a SimEng simulation. The process memory image is instantiated once through malloc/remalloc calls and shared between simulation objects through shared pointers.
This PR introduces a new CoreInstance class. The class supports the creation of a SimEng core model, storing all the relevant simulation objects within shared pointers.

A key factor in this change being introduced was to improve the ease SimEng's interactions with other frameworks e.g. SST.
This PR adds prefixes to all SimEng outputs to help distinguish between simulated workload outputs and the outputs from the framework.
… cmake. (#231)

This PR implements the `SST` wrapper and `simeng::MemoryInterface` needed for successful integration with SST. It also adds support for conditional compilation through `CMake`.
…ency, rather than update the VCT register to total cycles completed.
A fix for handling missing system registers in the aarch64 systemRegisterMap_ map. A missing entry will return a -1 and a decoded instruction accessing an unmapped system register will raise a new UnmappedSysReg fatal exception.
Fixes output error present for miniBUDE when compiled with GCC-10.3.0 targeting armv8.4-a+sve, caused by an incorrect implementation of the FNEG sve instruction.

Additionally, other SVE instructions were updated to accomodate for optional patterns.
A new generic branch predictor containing parameterisable BTB and RAS structures, global indexing, and better identification of branch instructions. Additionally, a parameterisable loop buffer has been implemented in the fetch unit and a loop detection scheme in the ROB unit.
@rahahahat rahahahat requested review from jj16791, dANW34V3R and FinnWilkinson and removed request for dANW34V3R and FinnWilkinson November 7, 2022 17:04
@rahahahat rahahahat changed the title Initial SST SimEng integration with testing framework. Initial SST SimEng integration. Nov 7, 2022
Copy link
Contributor

@dANW34V3R dANW34V3R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General structure is still looking good. A short PR description needed, you could use the one from #250.

Main points are; the need for the binaries and the need for all of the conditional compilation. I have left comments for both of these.

CMakeLists.txt Outdated Show resolved Hide resolved
sst/Assemble.cc Show resolved Hide resolved
sst/test/include/framework/output.hh Show resolved Hide resolved
sst/test/src/tg5_benchmarks.cc Outdated Show resolved Hide resolved
sst/SimEngCoreWrapper.cc Outdated Show resolved Hide resolved
sst/SimEngCoreWrapper.cc Outdated Show resolved Hide resolved
sst/SimEngCoreWrapper.cc Outdated Show resolved Hide resolved
sst/SimEngCoreWrapper.cc Outdated Show resolved Hide resolved
sst/SimEngCoreWrapper.cc Outdated Show resolved Hide resolved
sst/SimEngCoreWrapper.cc Outdated Show resolved Hide resolved
sst/SimEngCoreWrapper.cc Show resolved Hide resolved
sst/config/a64fx-config.py Outdated Show resolved Hide resolved
sst/config/config.py Outdated Show resolved Hide resolved
sst/SimEngCoreWrapper.cc Outdated Show resolved Hide resolved
sst/test/CMakeLists.txt Outdated Show resolved Hide resolved
sst/test/src/tg5_benchmarks.cc Outdated Show resolved Hide resolved
@FinnWilkinson FinnWilkinson added the enhancement New feature or request label Nov 8, 2022
sst/Assemble.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@dANW34V3R dANW34V3R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. Removal of most of the ifdefs makes the code much more readable

Copy link
Contributor

@jj16791 jj16791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@rahahahat rahahahat merged commit 7e149d0 into dev Nov 11, 2022
FinnWilkinson pushed a commit that referenced this pull request Nov 29, 2022
Adds Integration with SST and a custom framework for testing SST
jj16791 pushed a commit that referenced this pull request May 19, 2023
Adds Integration with SST and a custom framework for testing SST
@FinnWilkinson FinnWilkinson deleted the SST-SimEng branch November 2, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants