mirror of
https://github.com/retroSoC/retroSoC.git
synced 2026-11-04 22:32:36 +00:00
- 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.
37 lines
973 B
C
37 lines
973 B
C
#ifndef RETROSOC_HAL_CLOCK_H
|
|
#define RETROSOC_HAL_CLOCK_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include <retrosoc/core/status.h>
|
|
|
|
typedef enum {
|
|
RS_CLOCK_FREQ_24MHZ = 0,
|
|
RS_CLOCK_FREQ_48MHZ = 1,
|
|
RS_CLOCK_FREQ_72MHZ = 2,
|
|
RS_CLOCK_FREQ_96MHZ = 3,
|
|
RS_CLOCK_FREQ_120MHZ = 4,
|
|
RS_CLOCK_FREQ_144MHZ = 5,
|
|
RS_CLOCK_FREQ_168MHZ = 6,
|
|
RS_CLOCK_FREQ_192MHZ = 7,
|
|
} rs_clock_frequency_t;
|
|
|
|
typedef struct {
|
|
rs_clock_frequency_t requested_frequency;
|
|
rs_clock_frequency_t active_frequency;
|
|
uint8_t error_reason;
|
|
bool active_valid;
|
|
bool busy;
|
|
bool safe_clock;
|
|
bool pll_locked;
|
|
bool capable;
|
|
} rs_clock_status_t;
|
|
|
|
rs_status_t rs_clock_get_status(rs_clock_status_t *status);
|
|
rs_status_t rs_clock_frequency_hz(rs_clock_frequency_t frequency, uint32_t *frequency_hz);
|
|
rs_status_t rs_clock_get_active_hz(uint32_t *frequency_hz);
|
|
rs_status_t rs_clock_set_frequency(rs_clock_frequency_t frequency, rs_timeout_t timeout);
|
|
|
|
#endif
|