board: nsim: add nsim.props and fix libraries

Signed-off-by: Jingru <jingru@synopsys.com>
This commit is contained in:
Jingru
2020-03-23 21:33:23 +08:00
parent 7d7f67e32f
commit bfe3ee1964
10 changed files with 185 additions and 50 deletions

View File

@@ -1,28 +1,7 @@
#include "cmsis_os.h"
#include "embARC.h"
#include "embARC_debug.h"
static uint32_t cyc_hz_count = (BOARD_CPU_CLOCK / BOARD_SYS_TIMER_HZ);
#define APPLICATION_TASK_STK_SIZE 1024*64
static void board_timer_isr(void *ptr)
{
timer_int_clear(BOARD_SYS_TIMER_ID);
board_timer_update(BOARD_SYS_TIMER_HZ);
}
static void board_timer_init(void)
{
if (timer_present(BOARD_SYS_TIMER_ID)) {
int_disable(BOARD_SYS_TIMER_INTNO); /* disable first then enable */
int_handler_install(BOARD_SYS_TIMER_INTNO, board_timer_isr);
timer_start(BOARD_SYS_TIMER_ID, TIMER_CTRL_IE | TIMER_CTRL_NH, cyc_hz_count); /* start 1ms timer interrupt */
int_enable(BOARD_SYS_TIMER_INTNO);
}
}
#define APPLICATION_TASK_STK_SIZE 4096
extern void application_entry(void *arg);
osThreadDef(application_entry, osPriorityNormal, 1, APPLICATION_TASK_STK_SIZE);
@@ -36,14 +15,8 @@ EMBARC_WEAK void application_entry(void *arg)
int main(void)
{
exc_int_init();
arc_cache_init();
board_init();
board_timer_init();
xprintf_setup();
printf("Welcome to TencentOS tiny\r\n");
osKernelInitialize(); // TOS Tiny kernel initialize
osThreadCreate(osThread(application_entry), NULL); // Create TOS Tiny task
osKernelStart(); // Start TOS Tiny
}