-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathrmp_test_tms570lc4357.h
110 lines (100 loc) · 4.19 KB
/
rmp_test_tms570lc4357.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/******************************************************************************
Filename : rmp_test_tms570lc4357.h
Author : pry
Date : 22/07/2017
Licence : The Unlicense; see LICENSE for details.
Description : The testbench for TMS570LC4357.
TICC V20.2.7LTS -O4 -mf5
___ __ ___ ___
/ _ \ / |/ // _ \ Simple real-time kernel
/ , _// /|_/ // ___/ Standard benchmark test
/_/|_|/_/ /_//_/
====================================================
Test (number in CPU cycles) : AVG / MAX / MIN
Yield : 306 / 520 / 304
Mailbox : 493 / 688 / 472
Semaphore : 460 / 696 / 456
FIFO : 193 / 656 / 192
Message queue : 686 / 904 / 672
Blocking message queue : 897 / 1128 / 880
Memory allocation/free pair : 533 / 632 / 520
ISR Mailbox : 480 / 592 / 480
ISR Semaphore : 464 / 704 / 464
ISR Message queue : 592 / 720 / 592
ISR Blocking message queue : 736 / 856 / 736
******************************************************************************/
/* Include *******************************************************************/
#include "rmp.h"
/* End Include ***************************************************************/
/* Define ********************************************************************/
/* Counter read wrapper */
#define RMP_CNT_READ() ((rtiREG1->CNT[0].FRCx)<<3)
/* Memory pool test switch */
#define TEST_MEM_POOL (8192U)
/* Minimal build switch */
/* #define MINIMAL_SIZE */
/* Timestamp data type */
typedef rmp_ptr_t rmp_tim_t;
/* End Define ****************************************************************/
/* Global ********************************************************************/
#ifndef MINIMAL_SIZE
rmp_ptr_t Stack_1[256];
rmp_ptr_t Stack_2[256];
void Timer_Init(void);
void Int_Handler(void);
void Int_Disable(void);
/* End Global ****************************************************************/
/* Function:Timer_Init ********************************************************
Description : Initialize the timer for timing measurements. This function needs
to be adapted to your specific hardware.
Input : None.
Output : None.
Return : None.
******************************************************************************/
void Timer_Init(void)
{
/* RTI/FRC0 clock = 1/8 CPU clock, already initialized. Disable compare 1 */
rtiREG1->INTFLAG = 2U;
}
/* End Function:Timer_Init ***************************************************/
/* Function:Int_Init **********************************************************
Description : Initialize an periodic interrupt source. This function needs
to be adapted to your specific hardware.
Input : None.
Output : None.
Return : None.
******************************************************************************/
void Int_Init(void)
{
/* RTI/FRC1 clock = 1/8 CPU clock */
rtiREG1->INTFLAG = 2U;
rtiStopCounter(rtiREG1, rtiCOUNTER_BLOCK1);
rtiSetPeriod(rtiREG1, rtiCOMPARE1, 3750);
rtiEnableNotification(rtiREG1, rtiNOTIFICATION_COMPARE1);
rtiStartCounter(rtiREG1, rtiCOUNTER_BLOCK1);
}
volatile int Acc_Count=0;
/* The interrupt handler */
void rtiInterrupt(void)
{
Acc_Count++;
Int_Handler();
}
/* End Function:Int_Init *****************************************************/
/* Function:Int_Disable *******************************************************
Description : Disable the periodic interrupt source. This function needs
to be adapted to your specific hardware.
Input : None.
Output : None.
Return : None.
******************************************************************************/
void Int_Disable(void)
{
/* Disable channel 1 interrupt */
rtiDisableNotification(rtiREG1, rtiNOTIFICATION_COMPARE1);
rtiStopCounter(rtiREG1, rtiCOUNTER_BLOCK1);
}
#endif
/* End Function:Int_Disable **************************************************/
/* End Of File ***************************************************************/
/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/