From 9cd354b822e31a6084b4178f274bd3806e94cd83 Mon Sep 17 00:00:00 2001 From: mariusmonton Date: Mon, 19 Nov 2018 17:22:18 +0100 Subject: [PATCH] C examples halts simulation --- src/Execute.cpp | 4 ++-- tests/C/trace/trace.c | 2 ++ tests/C/trace2/trace2.c | 3 +++ tests/C/trace3/trace3.c | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Execute.cpp b/src/Execute.cpp index 01d8d6f..ecbdd42 100644 --- a/src/Execute.cpp +++ b/src/Execute.cpp @@ -213,7 +213,7 @@ void Execute::BLTU(Instruction &inst) { } log->SC_log(Log::INFO) << "BLTU x" - << rs1 << "(" << regs->getValue(rs1) << ") < x" + << dec << rs1 << "(" << regs->getValue(rs1) << ") < x" << rs2 << "(" << regs->getValue(rs2) << ")? -> PC (0x" << hex << new_pc << ")" << dec << endl; } @@ -784,7 +784,7 @@ void Execute::FENCE(Instruction &inst) { void Execute::ECALL(Instruction &inst) { log->SC_log(Log::INFO) << "ECALL" << endl; - std::cout << "ECALL Instruction called, stopping simulation" << endl; + std::cout << endl << "ECALL Instruction called, stopping simulation" << endl; regs->dump(); cout << "Simulation time " << sc_time_stamp() << endl; perf->dump(); diff --git a/tests/C/trace/trace.c b/tests/C/trace/trace.c index 7597464..c1727c0 100644 --- a/tests/C/trace/trace.c +++ b/tests/C/trace/trace.c @@ -4,4 +4,6 @@ void main(void) { TRACE = 'H'; TRACE = 'e'; + + asm volatile ("ecall"); } diff --git a/tests/C/trace2/trace2.c b/tests/C/trace2/trace2.c index 18274f7..1e537f9 100644 --- a/tests/C/trace2/trace2.c +++ b/tests/C/trace2/trace2.c @@ -6,4 +6,7 @@ void main(void) { for(i=0;i<10;i++) { TRACE = 'a' + i; } + + asm volatile ("ecall"); + } diff --git a/tests/C/trace3/trace3.c b/tests/C/trace3/trace3.c index 3a7483d..c93921b 100644 --- a/tests/C/trace3/trace3.c +++ b/tests/C/trace3/trace3.c @@ -7,4 +7,6 @@ void main(void) { for (i=0; i<5; i++) { TRACE = msg[i]; } + + asm volatile ("ecall"); }