Skip to content

cc4cs/framework

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Framework

A framework has been developed to calculate the CC4CS metrics. You can execute a custom C function using with several ISSs (Instruction Set Simulators) of different processors. The framework has been developed in Python and includes a simple benchmark composed by 10 well-know algorithms. The source code of the algorithms is contained in /framework/benchmark directory.

The framework is structured in three modules: the InputsGenerator, Parser, and the CommandsManager. The InputsGenerator (semi)automatically generates inputs for a function. The parameters of a function are specified in a json file (cmds.json) contained in the same directory of the function. The InputsGenerator reads a range [x; y] that is used to generate the values of the parameters and the number of inputs to be created. Finally, for each function, different data types have been considered (i.e., int8, int16, int32, and float) to analyze the results with respect to the internal architecture of the considered processor.

The number of executed C statements is obtained by profiling the benchmark functions using the gcov profiler for each generated input. It is worth noting that such a profiling is performed one-shot on the host platform since it is independent of the target processor technologies. Instead, the clock cycles needed by the target processor technology to execute each function in the benchmark. Depending on the processor technology there is the need for an Instruction Set Simulator (ISS) or an HDL Simulator.

Screenshots

Installation

The installation of the framework goes through a few simple steps. All that is required is to install the tools exploited by the framework at each step: Profiling, Simulation, and Static Analysis. For a deeper insight of the commands executed to perform each phase, the user can look at the /framework/cmds.json file.

The framework is implemented in Python3 and uses the csv, os, shutil, subprocess, tkinter libraries for internal operations. Thus, Python3 and the above listed libraries should be installed for the framwork to run properly.

Profiling

The profiling phase requires the execution of gcc and gcov.

Static Analysis

This step requires the frama-c software analyzer.

Simulation

The simulation phase involves the execution of the toolchain of each processor supported by the framework. The following is a description of each supported processor and the tools needed to get the information required to calculate CC4CS:

  • Atmega328p:

    • simulavr : the instruction set simulator of the Atmega328p;
    • avr-gcc : the cross-compiler for the AVR ISA;
  • Leon3:

  • 8051:

    • sdcc : the cross-compiler for the 8051;
    • isasim : the simulator of the 8051;

For any bug or doubt, contact me at: vincenzo.stoico@graduate.univaq.it or open an issue

About

A statement-level performance metric for HW/SW Co-Design

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.1%
  • C 26.6%
  • Assembly 3.1%
  • Makefile 1.2%