Polymorphic Register Files Simulator
This program aims at simulating the Polymorphic Register Files behaviour, as described in "On Implementability of Polymorphic Register Files"
utility.h
Go to the documentation of this file.
1 //
3 // PRF_Sim
4 //
6 // Utility
7 //
8 // Created by Giulio Stramondo on 10/05/16.
9 // Copyright © 2016 UVA. All rights reserved.
10 //
11 
12 #ifndef UTILITY_H
13 #define UTILITY_H
14 
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <math.h>
18 #include <string.h>
19 #include "prf.h"
20 
22 typedef struct options{
24  int p;
25  int q;
26  int N;
27  int M;
28  int error;
29 } Options;
30 
32 
38 Options parseArguments(int argc, char** argv);
39 
41 
46 void printMatrix(int **inputMatrix, int dim1, int dim2);
47 
49 
54 void printConflicts(int **inputMatrix, int dim1, int dim2);
55 
57 
66 void printMatrixHighlight(int **inputMatrix,int dim1,int dim2, int **highlightMatrix, int dimH1, int dimH2);
67 
69 
73 void printUsage(char *programName);
74 
76 
84 void performBlockRead(int index_i, int index_j, acc_type type,int ** data_elements1, PolymorphicRegister* pR, int mode);
85 
86 char *accessStringFromAccessType(acc_type type);
87 
88 int compareAddress(void *a, void *b);
89 #endif
int error
Variable used when the user arguments generate errors.
Definition: utility.h:28
int N
Horizontal size of the input matrix.
Definition: utility.h:26
scheme s
The mapping scheme used by the PRF.
Definition: utility.h:23
void printUsage(char *programName)
Prints in the console the usage informations.
int M
Vertical size of the input matrix.
Definition: utility.h:27
void printMatrixHighlight(int **inputMatrix, int dim1, int dim2, int **highlightMatrix, int dimH1, int dimH2)
Prints in the console a matrix, highlighing certain elements.
scheme
Enum containing all the available mapping scheme.
Definition: prf.h:43
void printMatrix(int **inputMatrix, int dim1, int dim2)
Prints in the console a formatted 2D matrix.
Data structure used for representing a Polymorphic Register.
Definition: prf.h:73
void performBlockRead(int index_i, int index_j, acc_type type, int **data_elements1, PolymorphicRegister *pR, int mode)
Prints the report information of a block read.
acc_type
Enum containing all the available access types.
Definition: prf.h:57
Data structure used to store the user&#39;s given arguments.
Definition: utility.h:22
void printConflicts(int **inputMatrix, int dim1, int dim2)
Prints in the console a conflict matrix, highlighting the conflicts.
int p
Horizontal size of the PRF.
Definition: utility.h:24
int q
Vertical size of the PRF.
Definition: utility.h:25
Options parseArguments(int argc, char **argv)
Parses the user arguments.