aboutsummaryrefslogtreecommitdiff
path: root/rv64cpu/tb/unit/tb_decoder.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-03-16 14:57:03 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-03-16 15:02:06 +0800
commitac1bfb6ae8253d71904a273b20a1d0e5d4803fd4 (patch)
tree61bd790dcf30dfd3435c7738c1f9e63f3ac121dd /rv64cpu/tb/unit/tb_decoder.cc
parent1554746fd79d51c6bd2281820520a4e2d2c16301 (diff)
downloadrcc-project-ac1bfb6ae8253d71904a273b20a1d0e5d4803fd4.tar.gz
rcc-project-ac1bfb6ae8253d71904a273b20a1d0e5d4803fd4.tar.xz
expand tests and format output
Diffstat (limited to 'rv64cpu/tb/unit/tb_decoder.cc')
-rw-r--r--rv64cpu/tb/unit/tb_decoder.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/rv64cpu/tb/unit/tb_decoder.cc b/rv64cpu/tb/unit/tb_decoder.cc
index e55bbb6..1fbb7be 100644
--- a/rv64cpu/tb/unit/tb_decoder.cc
+++ b/rv64cpu/tb/unit/tb_decoder.cc
@@ -31,10 +31,10 @@ static int fail_count = 0;
uint64_t _got = (uint64_t)(dut->signal); \
uint64_t _exp = (uint64_t)(expected); \
if (_got != _exp) { \
- std::cerr << "\033[31m[FAIL]\033[0m " << test_name \
+ std::cerr << "\033[31m[FAIL] " << test_name \
<< " | " << #signal << " expected: 0x" \
<< std::hex << _exp << " got: 0x" << _got \
- << std::dec << std::endl; \
+ << std::dec << "\033[0m" << std::endl; \
fail_count++; \
} \
} while(0)
@@ -43,9 +43,9 @@ void decode(Vdecoder* dut, uint32_t instr, const char* name) {
dut->instr = instr;
dut->eval();
test_count++;
- std::cout << "[TEST " << std::setw(2) << test_count << "] " << name
+ std::cout << "\033[32m[PASS] [TEST " << std::setw(2) << test_count << "] " << name
<< " (0x" << std::hex << std::setw(8) << std::setfill('0')
- << instr << std::dec << std::setfill(' ') << ")" << std::endl;
+ << instr << std::dec << std::setfill(' ') << ")\033[0m" << std::endl;
}
int main(int argc, char** argv) {