CohereSim: A Bus-based Cache Simulator  v3.3
A tool for education in computing - learn about coherence protocols, replacement policies, and SMP vs DSM
Macros | Functions
extractor.c File Reference

This program will intercept the output of gem5 and redirect the traces to a binary file. More...

#include <endian.h>
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
Include dependency graph for extractor.c:

Macros

#define NCPU   16
 The number of CPU cores in the current gem5 run (defined externally)
 

Functions

void fprintfcomma (FILE *file, uint64_t n, int width)
 Like fprintf, but specifically for integers and with the standard thousands separator. More...
 
int main (int argc, char const *argv[])
 The main function intercepts the output of gem5, saving the memory traces to a binary file and memory operation statistics to a stat file. More...
 

Detailed Description

This program will intercept the output of gem5 and redirect the traces to a binary file.

Function Documentation

◆ fprintfcomma()

void fprintfcomma ( FILE *  file,
uint64_t  n,
int  width 
)

Like fprintf, but specifically for integers and with the standard thousands separator.

Parameters
fileThe file to print to
nThe number to print to the file
widthThe character width of the number, like the n in nd

◆ main()

int main ( int  argc,
char const *  argv[] 
)

The main function intercepts the output of gem5, saving the memory traces to a binary file and memory operation statistics to a stat file.

Parameters
argcThe number of command line arguments
argvAn array to the ocmmand line arguments
Returns
The program exit code