mirror of
https://github.com/retroSoC/retroSoC.git
synced 2026-11-06 14:55:14 +00:00
feat: add RIBP Timer V2 support with formal verification and tests
- Updated filelist to include new timer peripheral files. - Enhanced formal file generation script to support timer target. - Created timer formal design and properties for formal verification. - Modified formal makefile to include timer targets and source files. - Added timer-related source files to software makefile. - Updated core and management wrappers to include debug halted signal. - Implemented timer testbench for RTL simulation. - Added regression tests for timer functionality in Python. - Introduced timer helper functions in C tests for validation.
This commit is contained in:
46 files changed
+1877
-465
No files matched your search
@@ -5,6 +5,7 @@
|
||||
#include <retrosoc/core/wait.h>
|
||||
#include <retrosoc/hal/lcd.h>
|
||||
#include <retrosoc/hal/spisd.h>
|
||||
#include <retrosoc/hal/timer.h>
|
||||
#include <retrosoc/hal/ws2812.h>
|
||||
#include <retrosoc/lib/printf.h>
|
||||
#include <retrosoc/lib/stdlib.h>
|
||||
@@ -186,6 +187,27 @@ static int test_ws2812_helpers(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int test_timer_helpers(void)
|
||||
{
|
||||
rs_timer_period_t period;
|
||||
|
||||
if ((rs_timer_period_from_ms(72000000U, 1U, &period) != RS_OK) ||
|
||||
(period.prescale != 0U) || (period.load != 71999U)) {
|
||||
return 1;
|
||||
}
|
||||
if ((rs_timer_period_from_ms(72000000U, 1000U, &period) != RS_OK) ||
|
||||
(period.prescale != 0U) || (period.load != 71999999U)) {
|
||||
return 2;
|
||||
}
|
||||
if ((rs_timer_period_from_ms(0U, 1U, &period) != RS_EINVAL) ||
|
||||
(rs_timer_period_from_ms(72000000U, 0U, &period) != RS_EINVAL) ||
|
||||
(rs_timer_period_from_ms(72000000U, 1U, NULL) != RS_EINVAL) ||
|
||||
(rs_timer_period_from_ms(UINT32_MAX, UINT32_MAX, &period) != RS_EINVAL)) {
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int test_wav_parser(void)
|
||||
{
|
||||
static const uint8_t wav[] = {
|
||||
@@ -235,6 +257,7 @@ int main(void)
|
||||
test_compiler_helpers(),
|
||||
test_wait_helper(),
|
||||
test_ws2812_helpers(),
|
||||
test_timer_helpers(),
|
||||
test_wav_parser(),
|
||||
test_video_parser(),
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user