Skip to content
bsc-locaPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

38 Commits

Folders and files

Repository files navigation

RVChowder

This repository contans a port of the Microbenchmark Generator, included in the Clammicrobench benchmark suite, to the environment used by the risc-v tests repository from RISC-V International, which is based on the RISC-V's proxy kernel runtime environment for baremetal.

The Microbenchmark Generator, written in C#, instantiates a set of benchmarks in Assembler+C language aimed at characterization of several parameters of a CPU (sizes of ROB buffer, LD/ST queues, BTB buffers, ...).

The repository includes the follwing modifications to the Microbenchmark Generator:

  • All dependencies with Linux/POSIX have been removed, allowing the resulting generated benchmarks to be compiled for baremetal.
  • The data structures originally allocated in dynamic memory have been moved to static memory, avoiding dependency on malloc(..).
  • Region of interest of each benchmark has been instrumented with the stats(...) macro used in the risc-v unit tests repository, enabling to obtain cycles and number of instructions, based on RISC-V's mcycle and minstret CSRs.
  • Added an XML-based strategy for configuration of parameter ranges to be tested by each microbenchmark (see AsmGen/test.json), enabling easier integration of the benchmark suite in automated environments, CI, etc.
  • Changes in the size and stride of the chasing pointer (latency list) being used by most benchmarks, in order to speed up execution of the benchmark in lesser powerful environments (e.g., RTL simulation), while keeping the high miss rate needed by each benchmark.
    • Size of the datasets and stride can be controlled by corresponding keys in section dataset of the JSON file, or by modifying value for variables datasetSize, datasetStrideand doubleDatasetSize in AsmGen/Program.cs.
  • Added environment files (common, env) allowing to build binaries of the generated benchmarks targetting the runtime environment used by risc-v tests.

Building

The provided Makefile generates and builds individual elf files for each benchmark, assuming that .NET for Linux is installed. Baremetal binaries for all benchmarks specified in AsmGen/tests.json can be built with:

$ git clone https://github.com/bsc-loca/RVChowder
$ make    

Generated sources for each benchmark will appear in AsmGen/output directory, and their corresponding executable .riscv binaries will be placed in bin.

The Visual Studio solution in AsmGen directory can be opened with Visual Studio 2022. After building with Visual Studio, call the resulting executable with AsmGen <json_file> [output_directory] to generate the benchmark sources.

Test with Spike

The resulting benchmarks can be directly executed in Spike RISC-V ISA emulator. After installing spike, as per https://github.com/riscv-software-src/riscv-isa-sim, execute the benchmarks using Spike with:

$ spike bin\benchmark_name.riscv

Adding tests

Create new tests by adding a new file and C# class inside directory AsmGen/tests. The new class must derive from class UarchTest, and provide value for its properties, plus abstract methods. The class name will become the test name to be instantiated in the JSON file specifying the tests to generate (AsmGen/test.json is provided as example). Parameters to specify in the JSON file for each of the tests, are the arguments that the constructor of that class will accept.

Licenses

The modifications in the code, listed in RVChowder section, are licensed under the Apache 2.0 license (LICENSE 2.0).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages