feat: disable mask

This commit is contained in:
tqcq 2024-10-21 03:14:44 +00:00
parent 96bd340675
commit 138868b66f
2 changed files with 28 additions and 33 deletions

View File

@ -18,7 +18,8 @@
#define ALIGN_std 2 << 20
#define PATT_LEN 1024
#define AGGR_std 2
#define HUGE_YES
// #define HUGE_YES
typedef struct ProfileParams {
uint64_t g_flags = 0;
@ -32,7 +33,7 @@ typedef struct ProfileParams {
size_t rounds = ROUNDS_std;
size_t base_off = 0;
char *huge_file = (char *) HUGETLB_std;
int huge_fd;
int huge_fd = 0;
char *conf_file = (char *) CONFIG_NAME_std;
int aggr = AGGR_std;
} ProfileParams;

View File

@ -1,54 +1,48 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#define STRIPE_SHIFT 0 // not needed anymore
#define O2Z (0b01 << STRIPE_SHIFT) // ONE_TO_ZERO
#define Z2O (0b10 << STRIPE_SHIFT) // ZERO_TO_ONE
#define REVERSE_VAL (O2Z ^ Z2O) // if you xor REVERSE with one of the stripe val it will give you the opposite
#define STRIPE_SHIFT 0 // not needed anymore
#define O2Z (0b01 << STRIPE_SHIFT)// ONE_TO_ZERO
#define Z2O (0b10 << STRIPE_SHIFT)// ZERO_TO_ONE
#define REVERSE_VAL (O2Z ^ Z2O) // if you xor REVERSE with one of the stripe val it will give you the opposite
static const char *config_str[] =
{ "assisted-dbl", "free-triple", "%i_sided"};
static const char *data_str[] = { "random", "i2o", "o2i" };
static const char *config_str[] = {"assisted-dbl", "free-triple", "%i_sided"};
static const char *data_str[] = {"random", "i2o", "o2i"};
typedef enum {
ASSISTED_DOUBLE_SIDED,
FREE_TRIPLE_SIDED,
N_SIDED,
ASSISTED_DOUBLE_SIDED,
FREE_TRIPLE_SIDED,
N_SIDED,
} HammerConfig;
typedef enum {
RANDOM,
ONE_TO_ZERO = O2Z,
ZERO_TO_ONE = Z2O,
REVERSE = REVERSE_VAL
} HammerData;
typedef enum { RANDOM, ONE_TO_ZERO = O2Z, ZERO_TO_ONE = Z2O, REVERSE = REVERSE_VAL } HammerData;
typedef uint64_t physaddr_t;
/* not necessarily page-aligned addresses.
used only to keep track of virt<->phys mapping. */
typedef struct {
char *v_addr;
physaddr_t p_addr;
char *v_addr;
physaddr_t p_addr;
} pte_t;
typedef struct {
HammerConfig h_cfg;
HammerData d_cfg;
size_t h_rows;
size_t h_rounds;
size_t base_off; // offset from the beginning of the contig chunk
int aggr_n;
HammerConfig h_cfg;
HammerData d_cfg;
size_t h_rows;
size_t h_rounds;
size_t base_off;// offset from the beginning of the contig chunk
int aggr_n;
} SessionConfig;
typedef struct {
char *buffer; // base addr
pte_t *physmap; // list of virt<->phys mapping for every page
int fd; // fd in the case of mmap hugetlbfs
uint64_t size; // in bytes
uint64_t align;
uint64_t flags; // from params
char *buffer; // base addr
pte_t *physmap;// list of virt<->phys mapping for every page
int fd; // fd in the case of mmap hugetlbfs
uint64_t size; // in bytes
uint64_t align;
uint64_t flags;// from params
} MemoryBuffer;