init: HW1
This commit is contained in:
20 files changed
+1197
No files matched your search
@@ -0,0 +1,37 @@
|
||||
#ifndef LOGGER_H_
|
||||
#define LOGGER_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <vector>
|
||||
#include <string.h>
|
||||
using namespace std;
|
||||
|
||||
#define MAX_INST_LEN 32
|
||||
|
||||
struct __pp_mask;
|
||||
|
||||
struct Log {
|
||||
char instruction[MAX_INST_LEN];
|
||||
unsigned long long mask; // support vector width up to 64
|
||||
};
|
||||
|
||||
struct Statistics {
|
||||
unsigned long long utilized_lane;
|
||||
unsigned long long total_lane;
|
||||
unsigned long long total_instructions;
|
||||
};
|
||||
|
||||
class Logger {
|
||||
private:
|
||||
vector<Log> log;
|
||||
Statistics stats;
|
||||
|
||||
public:
|
||||
void addLog(const char * instruction, __pp_mask mask, int N = 0);
|
||||
void printStats();
|
||||
void printLog();
|
||||
void refresh();
|
||||
unsigned long long getTotalInstrs();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user