feat: update
This commit is contained in:
parent
1664f69810
commit
247d35ecb1
@ -1,36 +1,40 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
// #include <x86intrin.h> /* for rdtsc, rdtscp, clflush */
|
// #include <x86intrin.h> /* for rdtsc, rdtscp, clflush */
|
||||||
#include <stdint.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <sched.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <getopt.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <getopt.h>
|
||||||
|
#include <sched.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "include/utils.h"
|
|
||||||
#include "include/types.h"
|
|
||||||
#include "include/allocator.h"
|
#include "include/allocator.h"
|
||||||
#include "include/memory.h"
|
|
||||||
#include "include/dram-address.h"
|
#include "include/dram-address.h"
|
||||||
#include "include/hammer-suite.h"
|
#include "include/hammer-suite.h"
|
||||||
|
#include "include/memory.h"
|
||||||
#include "include/params.h"
|
#include "include/params.h"
|
||||||
|
#include "include/types.h"
|
||||||
|
#include "include/utils.h"
|
||||||
|
|
||||||
ProfileParams *p;
|
ProfileParams *p;
|
||||||
|
|
||||||
// DRAMLayout g_mem_layout = {{{0x4080,0x88000,0x110000,0x220000,0x440000,0x4b300}, 6}, 0xffff80000, ((1<<13)-1)};
|
// DRAMLayout g_mem_layout = {{{0x4080,0x88000,0x110000,0x220000,0x440000,0x4b300}, 6}, 0xffff80000, ((1<<13)-1)};
|
||||||
// DRAMLayout g_mem_layout = { {{0x2040, 0x44000, 0x88000, 0x110000, 0x220000}, 5}, 0xffffc0000, ((1 << 13) - 1) };
|
// DRAMLayout g_mem_layout = { {{0x2040, 0x44000, 0x88000, 0x110000, 0x220000}, 5}, 0xffffc0000, ((1 << 13) - 1) };
|
||||||
// DRAMLayout g_mem_layout = {{{0x2040,0x24000,0x48000,0x90000},4}, 0xffffe0000, ((1<<13)-1)};
|
// DRAMLayout g_mem_layout = {{{0x2040,0x24000,0x48000,0x90000},4}, 0xffffe0000, ((1<<13)-1)};
|
||||||
DRAMLayout g_mem_layout = {{{0x4080,0x48000,0x90000,0x120000,0x1b300}, 5}, 0xffffc0000, ROW_SIZE-1};
|
DRAMLayout g_mem_layout = {
|
||||||
|
{{0x5400, 0x82600}, 2},
|
||||||
|
0xffff00000,
|
||||||
|
ROW_SIZE - 1
|
||||||
|
};
|
||||||
|
|
||||||
void read_config(SessionConfig * cfg, char *f_name)
|
void
|
||||||
|
read_config(SessionConfig *cfg, char *f_name)
|
||||||
{
|
{
|
||||||
FILE *fp = fopen(f_name, "rb");
|
FILE *fp = fopen(f_name, "rb");
|
||||||
int p_size;
|
int p_size;
|
||||||
@ -42,7 +46,8 @@ void read_config(SessionConfig * cfg, char *f_name)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gmem_dump()
|
void
|
||||||
|
gmem_dump()
|
||||||
{
|
{
|
||||||
FILE *fp = fopen("g_mem_dump.bin", "wb+");
|
FILE *fp = fopen("g_mem_dump.bin", "wb+");
|
||||||
fwrite(&g_mem_layout, sizeof(DRAMLayout), 1, fp);
|
fwrite(&g_mem_layout, sizeof(DRAMLayout), 1, fp);
|
||||||
@ -62,16 +67,17 @@ void gmem_dump()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
srand(time(NULL));
|
srand(time(NULL));
|
||||||
p = (ProfileParams*)malloc(sizeof(ProfileParams));
|
p = (ProfileParams *) malloc(sizeof(ProfileParams));
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
fprintf(stderr, "[ERROR] Memory allocation\n");
|
fprintf(stderr, "[ERROR] Memory allocation\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(process_argv(argc, argv, p) == -1) {
|
if (process_argv(argc, argv, p) == -1) {
|
||||||
free(p);
|
free(p);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -82,8 +88,7 @@ int main(int argc, char **argv)
|
|||||||
.fd = p->huge_fd,
|
.fd = p->huge_fd,
|
||||||
.size = p->m_size,
|
.size = p->m_size,
|
||||||
.align = p->m_align,
|
.align = p->m_align,
|
||||||
.flags = p->g_flags & MEM_MASK
|
.flags = p->g_flags & MEM_MASK};
|
||||||
};
|
|
||||||
|
|
||||||
alloc_buffer(&mem);
|
alloc_buffer(&mem);
|
||||||
set_physmap(&mem);
|
set_physmap(&mem);
|
||||||
|
Loading…
Reference in New Issue
Block a user