Skip to content

Commit

Permalink
Change: Plan EmbeddedSwift Support
Browse files Browse the repository at this point in the history
  • Loading branch information
dpretet committed Oct 8, 2024
1 parent 985562a commit 2a0676b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
3 changes: 1 addition & 2 deletions doc/project_mgt_sw.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# BACKLOG

C Apps

- [ ] Micro kernel
- [ ] Interrupt
- [ ] EIP SIP générée depuis le cpp
Expand All @@ -44,6 +43,7 @@ C Apps
- [ ] 2048

Misc.
- [ ] Support EmbeddedSwift
- [ ] Comment détecter une erreur venant d’une RAM qui cause une fausse donnée ou une mauvaise
instruction (sub -> add) et récupérer l’exécution d’un programme ?
- [ ] Testcase C (Rand access) pour les ORs de memory
Expand All @@ -67,7 +67,6 @@ Minimalistic Unix
# Ideas / Applications

- [ ] Try https://github.com/berry-lang/berry
- [ ] Try
- [ ] Support Linux / FreeBSD / NetBSD
- https://github.com/cnlohr/mini-rv32ima
- https://popovicu.com/posts/789-kb-linux-without-mmu-riscv/
Expand Down
31 changes: 19 additions & 12 deletions test/riscv-tests/svut_h.sv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Copyright 2021 The SVUT Authors
/// Copyright 2024 The SVUT Authors
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to
Expand Down Expand Up @@ -54,29 +54,36 @@
/// and information with an appropriate color.

`define MSG(msg) \
$display("\033[0;37m%s (@ %0t)\033[0m", msg, $realtime)
$display("\033[0;37m%s (@ %0t) (%s:%0d)\033[0m", msg, $realtime, `__FILE__, `__LINE__)

`define INFO(msg) \
$display("\033[0;34mINFO: %s (@ %0t)\033[0m", msg, $realtime)
$display("\033[0;34mINFO: %s (@ %0t) (%s:%0d)\033[0m", msg, $realtime, `__FILE__, `__LINE__)

`define SUCCESS(msg) \
$display("\033[0;32mSUCCESS: %s (@ %0t)\033[0m", msg, $realtime)
$display("\033[0;32mSUCCESS: %s (@ %0t) (%s:%0d)\033[0m", msg, $realtime, `__FILE__, `__LINE__)

`define WARNING(msg) \
begin\
$display("\033[1;33mWARNING: %s (@ %0t)\033[0m", msg, $realtime);\
$display("\033[1;33mWARNING: %s (@ %0t) (%s:%0d)\033[0m", msg, $realtime, `__FILE__, `__LINE__);\
svut_warning += 1;\
end

`define CRITICAL(msg) \
begin\
$display("\033[1;35mCRITICAL: %s (@ %0t)\033[0m", msg, $realtime);\
$display("\033[1;35mCRITICAL: %s (@ %0t) (%s:%0d)\033[0m", msg, $realtime, `__FILE__, `__LINE__);\
svut_critical += 1;\
end

/// This macro will not increment the error counter while displaying a failure
/// message.
`define FAILURE(msg) \
begin\
$display("\033[1;31mFAILURE: %s (@ %0t) (%s:%0d)\033[0m", msg, $realtime, `__FILE__, `__LINE__);\
end

`define ERROR(msg)\
begin\
$display("\033[1;31mERROR: %s (@ %0t)\033[0m", msg, $realtime);\
$display("\033[1;31mERROR: %s (@ %0t) (%s:%0d)\033[0m", msg, $realtime, `__FILE__, `__LINE__);\
svut_error += 1;\
end

Expand Down Expand Up @@ -129,7 +136,7 @@ endfunction
`define FAIL_IF_NOT(exp, message="") \
svut_status = 0; \
svut_msg = create_msg("FAIL_IF_NOT", message); \
if (!exp) begin \
if (!(exp)) begin \
`ERROR(svut_msg); \
svut_status = 1; \
end
Expand All @@ -156,7 +163,7 @@ endfunction
`define ASSERT(exp, message="") \
svut_status = 0; \
svut_msg = create_msg("ASSERT", message); \
if (!exp) begin \
if (!(exp)) begin \
`ERROR(svut_msg); \
svut_status = 1; \
end
Expand Down Expand Up @@ -187,11 +194,11 @@ endfunction
teardown(); \
if (svut_error == 0) begin \
svut_nb_test_success = svut_nb_test_success + 1; \
svut_msg = {"Test ", testnum, " pass"}; \
svut_msg = {"<< ", "Test ", testnum, ": ", svut_test_name, " >>", " pass"}; \
`SUCCESS(svut_msg); \
end else begin \
svut_msg = {"Test ", testnum, " fail"}; \
`ERROR(svut_msg); \
svut_msg = {"<< ", "Test ", testnum, ": ", svut_test_name, " >>", " fail"}; \
`FAILURE(svut_msg); \
svut_fail_list = {svut_fail_list, " '", svut_test_name, "'"}; \
svut_error_total += svut_error; \
end \
Expand Down

0 comments on commit 2a0676b

Please sign in to comment.