> compile NEMU

ysyx_22040000 李心杨
Linux calcite 6.1.75 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan 25 23:27:52 UTC 2024 x86_64 GNU/Linux
 22:16:25  up   4:17,  2 users,  load average: 0.55, 0.29, 0.26
This commit is contained in:
tracer-ysyx 2024-02-05 22:16:25 +08:00 committed by xinyangli
parent 80c13c3f6b
commit 4a78296ebd
6 changed files with 13 additions and 35 deletions

3
nemu/.metals/metals.log Normal file
View file

@ -0,0 +1,3 @@
2024.02.03 20:20:12 INFO Started: Metals version 1.2.0+12-644090c2-SNAPSHOT in folders '/home/xin/repo/ysyx-workbench/nemu' for client Visual Studio Code 1.85.2.
2024.02.03 20:20:13 WARN Build server is not auto-connectable.
2024.02.03 20:20:13 WARN no build tool detected in workspace '/home/xin/repo/ysyx-workbench/nemu'. The most common cause for this problem is that the editor was opened in the wrong working directory, for example if you use sbt then the workspace directory should contain build.sbt. 

BIN
nemu/.metals/metals.mv.db Normal file

Binary file not shown.

View file

@ -1,3 +1,6 @@
{
"digital-ide.welcome.show": false
"digital-ide.welcome.show": false,
"files.watcherExclude": {
"**/target": true
}
}

View file

@ -21,7 +21,7 @@
#include <cpu/cpu.h>
#include <errno.h>
#include <isa.h>
#include <memory/paddr.h>
#include <memory/vaddr.h>
#include <readline/history.h>
#include <readline/readline.h>
#include <stdint.h>
@ -125,17 +125,13 @@ static word_t parse_uint(const char *arg, bool *success) {
}
}
static paddr_t parse_expr(const char *arg, bool *success) {
static vaddr_t parse_expr(const char *arg, bool *success) {
if (arg == NULL) {
puts("Invalid expr argument.");
*success = false;
return 0;
} else {
// bool res = false;
// FIXME: We cannot use `parse_uint` here, it accept `-1234` as input
// paddr_t addr = parse_uint(arg, &res);
// *success = res;
paddr_t addr;
vaddr_t addr;
yy_scan_string(arg);
*success = !yyparse(&addr);
yylex_destroy();
@ -197,11 +193,11 @@ static int cmd_x(char *args) {
if (!res)
goto wrong_usage;
addr = addr & ~(WORD_BYTES - 1);
for (paddr_t paddr = addr; paddr < addr + n; paddr += WORD_BYTES) {
word_t value = paddr_read(addr, WORD_BYTES);
for (vaddr_t vaddr = addr; vaddr < addr + n; vaddr += WORD_BYTES) {
word_t value = vaddr_read(addr, WORD_BYTES);
printf("\e[1;34m" FMT_PADDR "\e[0m"
" " FMT_WORD "\n",
paddr, value);
vaddr, value);
}
return 0;

View file

@ -18,20 +18,4 @@
#include <common.h>
// TODO: Cache expression evalutation result in ExprResult
enum ExprType {
EXPR_TYPE_MEM_ADDR,
EXPR_TYPE_REG
};
union ExprValue {
word_t addr;
word_t *reg;
};
typedef struct ExprResult {
union ExprValue val;
enum ExprType type;
} ExprResult;
#endif

View file

@ -97,12 +97,4 @@ int wp_remove_by_number(int number) {
return 0;
}
int wp_eval_all() {
WP *wp;
for (wp = head; wp != NULL; wp = wp->next) {
}
return 0;
}
/* TODO: Implement the functionality of watchpoint */