提交 3d7415d3 编写于 作者: Z Zhou Yaoyang

Add Gzip compressor

上级 1dc7b412
......@@ -67,14 +67,18 @@ INCLUDES = $(addprefix -I, $(INC_DIR))
CFLAGS += -O2 -MMD -Wno-format -Wall \
-ggdb3 $(INCLUDES) \
-D__ENGINE_$(ENGINE)__ \
-D__SIMPOINT \
-D__ISA__=$(ISA) -D__ISA_$(ISA)__ -D_ISA_H_=\"isa/$(ISA).h\"
# -Wc++-compat \
# Files to be compiled
SRCS = $(shell find src/ -name "*.c" | grep -v "isa\|engine")
CPP_SRCS += $(shell find src/ -name "*.cpp" | grep -v "isa\|engine")
SRCS += $(shell find src/isa/$(ISA) -name "*.c")
SRCS += $(shell find src/engine/$(ENGINE) -name "*.c")
OBJS = $(SRCS:src/%.c=$(OBJ_DIR)/%.o)
CPP_OBJS += $(CPP_SRCS:src/%.cpp=$(OBJ_DIR)/%.o)
OBJS += $(CPP_OBJS)
# Compilation patterns
......@@ -87,6 +91,11 @@ $(OBJ_DIR)/%.o: src/%.c
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) $(SO_CFLAGS) -c -o $@ $<
$(OBJ_DIR)/%.o: src/%.cpp
@echo + CC $<
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) $(SO_CFLAGS) -c -o $@ $<
# Depencies
-include $(OBJS:.o=.d)
......@@ -107,7 +116,7 @@ $(BINARY): $(OBJS)
$(call git_commit, "compile")
@echo + LD $@
@echo + LD inputs $^
@$(LD) -O2 -rdynamic $(SO_LDLAGS) -o $@ $^ -lSDL2 -lreadline -ldl
@$(LD) -O2 -rdynamic $(SO_LDLAGS) -o $@ $^ -lSDL2 -lreadline -ldl -lz
run-env: $(BINARY) $(DIFF_REF_SO)
......
//
// Created by zyy on 2020/11/16.
//
#ifndef NEMU_SERIALIZER_H
#define NEMU_SERIALIZER_H
#include <string>
class Serializer
{
public:
void serializePMem();
private:
std::string outputPath{"/tmp/"};
std::string taskName{"helloWorld"};
std::string phaseName{"Simpoint1"};
std::string weightIndicator{"0.23"};
};
extern Serializer serializer;
#endif //NEMU_SERIALIZER_H
......@@ -14,4 +14,6 @@ word_t paddr_read(paddr_t addr, int len);
void paddr_write(paddr_t addr, word_t data, int len);
nemu_bool is_sfence_safe(paddr_t addr, int len);
uint8_t *getPmem();
#endif
......@@ -15,5 +15,6 @@ int main(int argc, char *argv[]) {
/* Start engine. */
engine_start();
return (is_batch_mode() ? !goodtrap() : 0);
}
......@@ -14,7 +14,7 @@ paddr_t host_to_guest(void *addr) { return (uint8_t *)pmem - (uint8_t *)addr; }
IOMap* fetch_mmio_map(paddr_t addr);
void init_mem() {
#ifndef DIFF_TEST
#if !defined(DIFF_TEST) && !defined(__SIMPOINT)
srand(time(0));
uint32_t *p = (uint32_t *)pmem;
int i;
......@@ -24,6 +24,10 @@ void init_mem() {
#endif
}
uint8_t *getPmem() {
return pmem;
}
static inline nemu_bool in_pmem(paddr_t addr) {
return (PMEM_BASE <= addr) && (addr <= PMEM_BASE + PMEM_SIZE - 1);
}
......
#include <isa.h>
#include <memory/paddr.h>
#include <memory/vaddr.h>
#include <checkpoint/serializer.h>
#include "expr.h"
#include "watchpoint.h"
......@@ -140,6 +141,7 @@ static int cmd_x(char *args) {
}
static int cmd_q(char *args) {
serializer.serializePMem();
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册