aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/gen-report4
-rw-r--r--src/cpu/riscv/simt_riscv64.c16
2 files changed, 19 insertions, 1 deletions
diff --git a/scripts/gen-report b/scripts/gen-report
index 38e4a47..9b86174 100755
--- a/scripts/gen-report
+++ b/scripts/gen-report
@@ -13,6 +13,8 @@ shift $((OPTIND - 1))
for p in "$@"; do
mkdir -p "reports/${p}"
- timeout --foreground 30s valgrind -q --error-exitcode=1 \
+ timeout --foreground 30s valgrind -q \
+ --leak-check=full \
+ --error-exitcode=1 \
"./${BUILD}/${p}" > "reports/${p}/log"
done
diff --git a/src/cpu/riscv/simt_riscv64.c b/src/cpu/riscv/simt_riscv64.c
index 68e87a5..d6a002b 100644
--- a/src/cpu/riscv/simt_riscv64.c
+++ b/src/cpu/riscv/simt_riscv64.c
@@ -226,6 +226,21 @@ static stat simt_riscv64_clock(struct simt_riscv64 *c)
return r;
}
+static void simt_riscv64_destroy(struct simt_riscv64 *c)
+{
+ foreach(lanes, core, &c->lanes) {
+ if ((*core)->destroy)
+ (*core)->destroy(*core);
+ else
+ free(*core);
+ }
+
+ lanes_destroy(&c->lanes);
+ reqs_destroy(&c->data_rqs);
+ reqs_destroy(&c->inst_rqs);
+ free(c);
+}
+
struct component *create_simt_riscv64(
struct simt_riscv64_conf conf,
struct component *imem,
@@ -236,6 +251,7 @@ struct component *create_simt_riscv64(
return NULL;
new->component.clock = (clock_callback)simt_riscv64_clock;
+ new->component.destroy = (destroy_callback)simt_riscv64_destroy;
new->conf = conf;
new->imem = imem;