提交 717142d6 编写于 作者: Z Zihao Yu

device: perform diff test at map_read/map_write

上级 2d57399f
#include "memory/memory.h"
#include "device/map.h"
#include "monitor/diff-test.h"
#define IO_SPACE_MAX (1024 * 1024)
......@@ -17,6 +18,9 @@ uint8_t* new_space(int size) {
uint32_t map_read(paddr_t addr, int len, IOMap *map) {
assert(len >= 1 && len <= 4);
#if defined(DIFF_TEST)
difftest_skip_ref();
#endif
uint32_t offset = addr - map->low;
invoke_callback(map->callback, offset, len, false); // prepare data to read
......@@ -26,6 +30,9 @@ uint32_t map_read(paddr_t addr, int len, IOMap *map) {
void map_write(paddr_t addr, int len, uint32_t data, IOMap *map) {
assert(len >= 1 && len <= 4);
#if defined(DIFF_TEST)
difftest_skip_ref();
#endif
uint32_t offset = addr - map->low;
uint8_t *p = map->space + offset;
......
......@@ -77,10 +77,6 @@ make_EHelper(in) {
rtl_li(&s0, val);
operand_write(id_dest, &s0);
#if defined(DIFF_TEST)
difftest_skip_ref();
#endif
print_asm_template2(in);
}
......@@ -94,9 +90,5 @@ make_EHelper(out) {
default: assert(0);
}
#if defined(DIFF_TEST)
difftest_skip_ref();
#endif
print_asm_template2(out);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册