##// END OF EJS Templates
compliance with ICD 4.3...
paul -
r299:7f467c56a168 R3_plus draft
parent child
Show More
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 94f0f2fccbcb8030d9437ffbb69ee0eefaaea188 header/lfr_common_headers
2 5cf0bac6095ff491d937622f8253c6f05095cb39 header/lfr_common_headers
@@ -1,125 +1,133
1 TEMPLATE = app
1 TEMPLATE = app
2 CONFIG += console
3 CONFIG -= app_bundle
4 CONFIG -= qt
5
6 include(sparc.pri)
7
8 INCLUDEPATH += ./
9
10 OBJECTS_DIR=obj
11 DESTDIR=bin
12
2 # CONFIG += console v8 sim
13 # CONFIG += console v8 sim
3 # CONFIG options =
14 # CONFIG options =
4 # verbose
15 # verbose
5 # boot_messages
16 # boot_messages
6 # debug_messages
17 # debug_messages
7 # cpu_usage_report
18 # cpu_usage_report
8 # stack_report
19 # stack_report
9 # vhdl_dev
20 # vhdl_dev
10 # debug_tch
21 # debug_tch
11 # lpp_dpu_destid /!\ REMOVE BEFORE DELIVERY TO LESIA /!\
22 # lpp_dpu_destid /!\ REMOVE BEFORE DELIVERY TO LESIA /!\
12 # debug_watchdog
23 # debug_watchdog
13 CONFIG += console verbose lpp_dpu_destid cpu_usage_report
24 CONFIG += console verbose lpp_dpu_destid cpu_usage_report
14 CONFIG -= qt
15
16 include(./sparc.pri)
17
25
18 INCLUDEPATH += /opt/rtems-4.10/sparc-rtems/leon3/lib/include
26 INCLUDEPATH += /opt/rtems-4.10/sparc-rtems/leon3/lib/include
19
27
20 # flight software version
28 # flight software version
21 SWVERSION=-1-0
29 SWVERSION=-1-0
22 DEFINES += SW_VERSION_N1=3 # major
30 DEFINES += SW_VERSION_N1=3 # major
23 DEFINES += SW_VERSION_N2=1 # minor
31 DEFINES += SW_VERSION_N2=1 # minor
24 DEFINES += SW_VERSION_N3=0 # patch
32 DEFINES += SW_VERSION_N3=0 # patch
25 DEFINES += SW_VERSION_N4=4 # internal
33 DEFINES += SW_VERSION_N4=4 # internal
26
34
27 # <GCOV>
35 # <GCOV>
28 #QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage
36 #QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage
29 #LIBS += -lgcov /opt/GCOV/01A/lib/overload.o -lc
37 #LIBS += -lgcov /opt/GCOV/01A/lib/overload.o -lc
30 # </GCOV>
38 # </GCOV>
31
39
32 # <CHANGE BEFORE FLIGHT>
40 # <CHANGE BEFORE FLIGHT>
33 contains( CONFIG, lpp_dpu_destid ) {
41 contains( CONFIG, lpp_dpu_destid ) {
34 DEFINES += LPP_DPU_DESTID
42 DEFINES += LPP_DPU_DESTID
35 }
43 }
36 # </CHANGE BEFORE FLIGHT>
44 # </CHANGE BEFORE FLIGHT>
37
45
38 contains( CONFIG, debug_tch ) {
46 contains( CONFIG, debug_tch ) {
39 DEFINES += DEBUG_TCH
47 DEFINES += DEBUG_TCH
40 }
48 }
41 DEFINES += MSB_FIRST_TCH
49 DEFINES += MSB_FIRST_TCH
42
50
43 contains( CONFIG, vhdl_dev ) {
51 contains( CONFIG, vhdl_dev ) {
44 DEFINES += VHDL_DEV
52 DEFINES += VHDL_DEV
45 }
53 }
46
54
47 contains( CONFIG, verbose ) {
55 contains( CONFIG, verbose ) {
48 DEFINES += PRINT_MESSAGES_ON_CONSOLE
56 DEFINES += PRINT_MESSAGES_ON_CONSOLE
49 }
57 }
50
58
51 contains( CONFIG, debug_messages ) {
59 contains( CONFIG, debug_messages ) {
52 DEFINES += DEBUG_MESSAGES
60 DEFINES += DEBUG_MESSAGES
53 }
61 }
54
62
55 contains( CONFIG, cpu_usage_report ) {
63 contains( CONFIG, cpu_usage_report ) {
56 DEFINES += PRINT_TASK_STATISTICS
64 DEFINES += PRINT_TASK_STATISTICS
57 }
65 }
58
66
59 contains( CONFIG, stack_report ) {
67 contains( CONFIG, stack_report ) {
60 DEFINES += PRINT_STACK_REPORT
68 DEFINES += PRINT_STACK_REPORT
61 }
69 }
62
70
63 contains( CONFIG, boot_messages ) {
71 contains( CONFIG, boot_messages ) {
64 DEFINES += BOOT_MESSAGES
72 DEFINES += BOOT_MESSAGES
65 }
73 }
66
74
67 contains( CONFIG, debug_watchdog ) {
75 contains( CONFIG, debug_watchdog ) {
68 DEFINES += DEBUG_WATCHDOG
76 DEFINES += DEBUG_WATCHDOG
69 }
77 }
70
78
71 #doxygen.target = doxygen
79 #doxygen.target = doxygen
72 #doxygen.commands = doxygen ../doc/Doxyfile
80 #doxygen.commands = doxygen ../doc/Doxyfile
73 #QMAKE_EXTRA_TARGETS += doxygen
81 #QMAKE_EXTRA_TARGETS += doxygen
74
82
75 TARGET = fsw
83 TARGET = fsw
76
84
77 INCLUDEPATH += \
85 INCLUDEPATH += \
78 $${PWD}/../src \
86 $${PWD}/../src \
79 $${PWD}/../header \
87 $${PWD}/../header \
80 $${PWD}/../header/lfr_common_headers \
88 $${PWD}/../header/lfr_common_headers \
81 $${PWD}/../header/processing \
89 $${PWD}/../header/processing \
82 $${PWD}/../LFR_basic-parameters
90 $${PWD}/../LFR_basic-parameters
83
91
84 SOURCES += \
92 SOURCES += \
85 ../src/wf_handler.c \
93 ../src/wf_handler.c \
86 ../src/tc_handler.c \
94 ../src/tc_handler.c \
87 ../src/fsw_misc.c \
95 ../src/fsw_misc.c \
88 ../src/fsw_init.c \
96 ../src/fsw_init.c \
89 ../src/fsw_globals.c \
97 ../src/fsw_globals.c \
90 ../src/fsw_spacewire.c \
98 ../src/fsw_spacewire.c \
91 ../src/tc_load_dump_parameters.c \
99 ../src/tc_load_dump_parameters.c \
92 ../src/tm_lfr_tc_exe.c \
100 ../src/tm_lfr_tc_exe.c \
93 ../src/tc_acceptance.c \
101 ../src/tc_acceptance.c \
94 ../src/processing/fsw_processing.c \
102 ../src/processing/fsw_processing.c \
95 ../src/processing/avf0_prc0.c \
103 ../src/processing/avf0_prc0.c \
96 ../src/processing/avf1_prc1.c \
104 ../src/processing/avf1_prc1.c \
97 ../src/processing/avf2_prc2.c \
105 ../src/processing/avf2_prc2.c \
98 ../src/lfr_cpu_usage_report.c \
106 ../src/lfr_cpu_usage_report.c \
99 ../LFR_basic-parameters/basic_parameters.c
107 ../LFR_basic-parameters/basic_parameters.c
100
108
101 HEADERS += \
109 HEADERS += \
102 ../header/wf_handler.h \
110 ../header/wf_handler.h \
103 ../header/tc_handler.h \
111 ../header/tc_handler.h \
104 ../header/grlib_regs.h \
112 ../header/grlib_regs.h \
105 ../header/fsw_misc.h \
113 ../header/fsw_misc.h \
106 ../header/fsw_init.h \
114 ../header/fsw_init.h \
107 ../header/fsw_spacewire.h \
115 ../header/fsw_spacewire.h \
108 ../header/tc_load_dump_parameters.h \
116 ../header/tc_load_dump_parameters.h \
109 ../header/tm_lfr_tc_exe.h \
117 ../header/tm_lfr_tc_exe.h \
110 ../header/tc_acceptance.h \
118 ../header/tc_acceptance.h \
111 ../header/processing/fsw_processing.h \
119 ../header/processing/fsw_processing.h \
112 ../header/processing/avf0_prc0.h \
120 ../header/processing/avf0_prc0.h \
113 ../header/processing/avf1_prc1.h \
121 ../header/processing/avf1_prc1.h \
114 ../header/processing/avf2_prc2.h \
122 ../header/processing/avf2_prc2.h \
115 ../header/fsw_params_wf_handler.h \
123 ../header/fsw_params_wf_handler.h \
116 ../header/lfr_cpu_usage_report.h \
124 ../header/lfr_cpu_usage_report.h \
117 ../header/lfr_common_headers/ccsds_types.h \
125 ../header/lfr_common_headers/ccsds_types.h \
118 ../header/lfr_common_headers/fsw_params.h \
126 ../header/lfr_common_headers/fsw_params.h \
119 ../header/lfr_common_headers/fsw_params_nb_bytes.h \
127 ../header/lfr_common_headers/fsw_params_nb_bytes.h \
120 ../header/lfr_common_headers/fsw_params_processing.h \
128 ../header/lfr_common_headers/fsw_params_processing.h \
121 ../header/lfr_common_headers/tm_byte_positions.h \
129 ../header/lfr_common_headers/tm_byte_positions.h \
122 ../LFR_basic-parameters/basic_parameters.h \
130 ../LFR_basic-parameters/basic_parameters.h \
123 ../LFR_basic-parameters/basic_parameters_params.h \
131 ../LFR_basic-parameters/basic_parameters_params.h \
124 ../header/GscMemoryLPP.hpp
132 ../header/GscMemoryLPP.hpp
125
133
@@ -1,99 +1,69
1 CONFIG += console
1
2 CONFIG -= qt
3 QMAKE_CC=sparc-rtems-gcc
2 QMAKE_CC=sparc-rtems-gcc
4 message(C compiler forced to: $$QMAKE_CC)
3 message(C compiler forced to: $$QMAKE_CC)
5 QMAKE_CXX=sparc-rtems-g++
4 QMAKE_CXX=sparc-rtems-g++
6 message(C++ compiler forced to: $$QMAKE_CXX)
5 message(C++ compiler forced to: $$QMAKE_CXX)
7 QMAKE_AR=sparc-rtems-ar rcs
6 QMAKE_AR=sparc-rtems-ar rcs
8 message(Archiver forced to: $$QMAKE_AR)
7 message(Archiver forced to: $$QMAKE_AR)
9 QMAKE_LINK=sparc-rtems-g++
8 QMAKE_LINK=sparc-rtems-g++
10 message(Linker forced to: $$QMAKE_LINK)
9 message(Linker forced to: $$QMAKE_LINK)
11 QMAKE_LINK_SHLIB=sparc-rtems-g++
10 QMAKE_LINK_SHLIB=sparc-rtems-g++
12 QMAKE_OBJCOPY= sparc-rtems-objcopy
11 QMAKE_OBJCOPY= sparc-rtems-objcopy
13 QMAKE_STRIP=sparc-rtems-strip
12 QMAKE_STRIP=sparc-rtems-strip
14 QMAKE_GDB=sparc-rtems-gdb
13 QMAKE_GDB=sparc-rtems-gdb
15
14
16 #INCLUDEPATH += /opt/rtems-4.10
15 QMAKE_CFLAGS_APP=""
17 INCLUDEPATH += /opt/rtems-4.10/sparc-rtems/leon3/lib/include
16 QMAKE_CXXFLAGS_APP=""
18
17 QMAKE_CFLAGS=
19 QMAKE_CFLAGS_DEBUG= -g
18 QMAKE_CFLAGS_DEBUG= -g
20 QMAKE_CFLAGS_RELEASE=""
19 QMAKE_CFLAGS_RELEASE=""
21 QMAKE_CXXFLAGS_DEBUG= -g
20 QMAKE_CXXFLAGS_DEBUG= -g
22 QMAKE_CXXFLAGS_RELEASE=""
21 QMAKE_CXXFLAGS_RELEASE=""
23 QMAKE_LFLAGS_RELEASE=""
22 QMAKE_LFLAGS_RELEASE=
24 QMAKE_LFLAGS_DEBUG= -g
23 QMAKE_LFLAGS_DEBUG= -g
25 QMAKE_CXXFLAGS_DEPS =
24 QMAKE_CXXFLAGS_DEPS =
26 QMAKE_CXXFLAGS_WARN_ON = -Wall
25 QMAKE_CXXFLAGS_WARN_ON = -Wall
27 QMAKE_CXXFLAGS_WARN_OFF = -w
26 QMAKE_CXXFLAGS_WARN_OFF = -w
28 QMAKE_CXXFLAGS_RELEASE =
27 QMAKE_CXXFLAGS_RELEASE =
29 QMAKE_CXXFLAGS_DEBUG =
28 QMAKE_CXXFLAGS_DEBUG =
30 QMAKE_CXXFLAGS_YACC =
29 QMAKE_CXXFLAGS_YACC =
31 QMAKE_CXXFLAGS_THREAD =
30 QMAKE_CXXFLAGS_THREAD =
32 QMAKE_CXXFLAGS_RTTI_ON =
31 QMAKE_CXXFLAGS_RTTI_ON =
33 QMAKE_CXXFLAGS_RTTI_OFF =
32 QMAKE_CXXFLAGS_RTTI_OFF =
34 QMAKE_CXXFLAGS_EXCEPTIONS_ON =
33 QMAKE_CXXFLAGS_EXCEPTIONS_ON =
35 QMAKE_CXXFLAGS_EXCEPTIONS_OFF =
34 QMAKE_CXXFLAGS_EXCEPTIONS_OFF =
36 QMAKE_CFLAGS_WARN_ON = -Wall
35 QMAKE_CFLAGS_WARN_ON = -Wall
37 QMAKE_CFLAGS_WARN_OFF = -w
36 QMAKE_CFLAGS_WARN_OFF = -w
38 QMAKE_CFLAGS_RELEASE =
37 QMAKE_CFLAGS_RELEASE =
39 QMAKE_CFLAGS_YACC =
38 QMAKE_CFLAGS_YACC =
40 QMAKE_LFLAGS_EXCEPTIONS_ON =
39 QMAKE_LFLAGS_EXCEPTIONS_ON =
41 QMAKE_LFLAGS_EXCEPTIONS_OFF =
40 QMAKE_LFLAGS_EXCEPTIONS_OFF =
42 QMAKE_LFLAGS_RELEASE = -Xlinker -Map=output.map
43 QMAKE_LFLAGS_CONSOLE =
41 QMAKE_LFLAGS_CONSOLE =
44 QMAKE_LFLAGS_WINDOWS =
42 QMAKE_LFLAGS_WINDOWS =
45 QMAKE_LFLAGS_DLL =
43 QMAKE_LFLAGS_DLL =
46 QMAKE_INCDIR_QT =
44 QMAKE_INCDIR_QT =
47 QMAKE_INCDIR =
45 QMAKE_INCDIR =
48 QMAKE_CFLAGS_SHLIB =
46 QMAKE_CFLAGS_SHLIB =
49 QMAKE_CFLAGS_STATIC_LIB =
47 QMAKE_CFLAGS_STATIC_LIB =
50 QMAKE_CXXFLAGS_SHLIB =
48 QMAKE_CXXFLAGS_SHLIB =
51 QMAKE_CXXFLAGS_STATIC_LIB =
49 QMAKE_CXXFLAGS_STATIC_LIB =
52 QMAKE_LIBS=""
50 QMAKE_LIBS=""
53 INCLUDEPATH=""
51 INCLUDEPATH=""
54 DEFINES=""
52 DEFINES=""
55
53
56 contains( TEMPLATE, app ) {
57 OBJECTS_DIR=obj
58 DESTDIR=bin
59 }
60
61 #QMAKE_CFLAGS_RELEASE += -O0
62 #QMAKE_CFLAGS_DEBUG += -O0
63 #QMAKE_CXXFLAGS_RELEASE += -O0
64 #QMAKE_CXXFLAGS_DEBUG += -O0
65
54
66 QMAKE_CFLAGS_RELEASE += -O3
55 QMAKE_CFLAGS_RELEASE += -O3
67 QMAKE_CFLAGS_DEBUG += -O3
56 QMAKE_CFLAGS_DEBUG += -O3
68 QMAKE_CXXFLAGS_RELEASE += -O3
57 QMAKE_CXXFLAGS_RELEASE += -O3
69 QMAKE_CXXFLAGS_DEBUG += -O3
58 QMAKE_CXXFLAGS_DEBUG += -O3
70
59
71 #QMAKE_CFLAGS_RELEASE += -O3 -std=c99
60 #QMAKE_CFLAGS_RELEASE += -O0
72 #QMAKE_CFLAGS_DEBUG += -O3 -std=c99
61 #QMAKE_CFLAGS_DEBUG += -O0
73 #QMAKE_CXXFLAGS_RELEASE += -O3 -std=c99
62 #QMAKE_CXXFLAGS_RELEASE += -O0
74 #QMAKE_CXXFLAGS_DEBUG += -O3 -std=c99
63 #QMAKE_CXXFLAGS_DEBUG += -O0
75
76 contains( TEMPLATE, app ) {
77 grmon.target = grmon
78 grmon.commands = cd $$DESTDIR && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
79 QMAKE_EXTRA_TARGETS += grmon
80 }
81
82
83
84
64
85
65
86
66 #QMAKE_CFLAGS_RELEASE+= -O3 -std=c99
87
67 #QMAKE_CFLAGS_DEBUG+= -O3 -std=c99
88
68 #QMAKE_CXXFLAGS_RELEASE+= -O3 -std=c99
89
69 #QMAKE_CXXFLAGS_DEBUG+= -O3 -std=c99
90
91
92
93
94
95
96
97
98
99
@@ -1,64 +1,59
1 #ifndef FSW_INIT_H_INCLUDED
1 #ifndef FSW_INIT_H_INCLUDED
2 #define FSW_INIT_H_INCLUDED
2 #define FSW_INIT_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <leon.h>
5 #include <leon.h>
6
6
7 #include "fsw_params.h"
7 #include "fsw_params.h"
8 #include "fsw_misc.h"
8 #include "fsw_misc.h"
9 #include "fsw_processing.h"
9 #include "fsw_processing.h"
10
10
11 #include "tc_handler.h"
11 #include "tc_handler.h"
12 #include "wf_handler.h"
12 #include "wf_handler.h"
13 #include "fsw_spacewire.h"
13 #include "fsw_spacewire.h"
14
14
15 #include "avf0_prc0.h"
15 #include "avf0_prc0.h"
16 #include "avf1_prc1.h"
16 #include "avf1_prc1.h"
17 #include "avf2_prc2.h"
17 #include "avf2_prc2.h"
18
18
19 extern rtems_name Task_name[]; /* array of task names */
19 extern rtems_name Task_name[]; /* array of task names */
20 extern rtems_id Task_id[]; /* array of task ids */
20 extern rtems_id Task_id[]; /* array of task ids */
21 extern rtems_name timecode_timer_name;
21 extern rtems_name timecode_timer_name;
22 extern rtems_id timecode_timer_id;
22 extern rtems_id timecode_timer_id;
23 extern unsigned char pa_bia_status_info;
23 extern unsigned char pa_bia_status_info;
24 extern unsigned char cp_rpw_sc_rw_f_flags;
24 extern unsigned char cp_rpw_sc_rw1_rw2_f_flags;
25 extern float cp_rpw_sc_rw1_f1;
25 extern unsigned char cp_rpw_sc_rw3_rw4_f_flags;
26 extern float cp_rpw_sc_rw1_f2;
26
27 extern float cp_rpw_sc_rw2_f1;
28 extern float cp_rpw_sc_rw2_f2;
29 extern float cp_rpw_sc_rw3_f1;
30 extern float cp_rpw_sc_rw3_f2;
31 extern float cp_rpw_sc_rw4_f1;
32 extern float cp_rpw_sc_rw4_f2;
33 extern filterPar_t filterPar;
27 extern filterPar_t filterPar;
28 extern rw_f_t rw_f;
34
29
35 // RTEMS TASKS
30 // RTEMS TASKS
36 rtems_task Init( rtems_task_argument argument);
31 rtems_task Init( rtems_task_argument argument);
37
32
38 // OTHER functions
33 // OTHER functions
39 void create_names( void );
34 void create_names( void );
40 int create_all_tasks( void );
35 int create_all_tasks( void );
41 int start_all_tasks( void );
36 int start_all_tasks( void );
42 //
37 //
43 rtems_status_code create_message_queues( void );
38 rtems_status_code create_message_queues( void );
44 rtems_status_code create_timecode_timer( void );
39 rtems_status_code create_timecode_timer( void );
45 rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
40 rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
46 rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
41 rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
47 rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id );
42 rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id );
48 rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
43 rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
49 rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id );
44 rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id );
50 void update_queue_max_count( rtems_id queue_id, unsigned char*fifo_size_max );
45 void update_queue_max_count( rtems_id queue_id, unsigned char*fifo_size_max );
51 void init_ring(ring_node ring[], unsigned char nbNodes, volatile int buffer[], unsigned int bufferSize );
46 void init_ring(ring_node ring[], unsigned char nbNodes, volatile int buffer[], unsigned int bufferSize );
52 //
47 //
53 int start_recv_send_tasks( void );
48 int start_recv_send_tasks( void );
54 //
49 //
55 void init_local_mode_parameters( void );
50 void init_local_mode_parameters( void );
56 void reset_local_time( void );
51 void reset_local_time( void );
57
52
58 extern void rtems_cpu_usage_report( void );
53 extern void rtems_cpu_usage_report( void );
59 extern void rtems_cpu_usage_reset( void );
54 extern void rtems_cpu_usage_reset( void );
60 extern void rtems_stack_checker_report_usage( void );
55 extern void rtems_stack_checker_report_usage( void );
61
56
62 extern int sched_yield( void );
57 extern int sched_yield( void );
63
58
64 #endif // FSW_INIT_H_INCLUDED
59 #endif // FSW_INIT_H_INCLUDED
@@ -1,83 +1,85
1 #ifndef TC_LOAD_DUMP_PARAMETERS_H
1 #ifndef TC_LOAD_DUMP_PARAMETERS_H
2 #define TC_LOAD_DUMP_PARAMETERS_H
2 #define TC_LOAD_DUMP_PARAMETERS_H
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <stdio.h>
5 #include <stdio.h>
6
6
7 #include "fsw_params.h"
7 #include "fsw_params.h"
8 #include "wf_handler.h"
8 #include "wf_handler.h"
9 #include "tm_lfr_tc_exe.h"
9 #include "tm_lfr_tc_exe.h"
10 #include "fsw_misc.h"
10 #include "fsw_misc.h"
11 #include "basic_parameters_params.h"
11 #include "basic_parameters_params.h"
12 #include "avf0_prc0.h"
12 #include "avf0_prc0.h"
13
13
14 #define FLOAT_EQUAL_ZERO 0.001
14 #define FLOAT_EQUAL_ZERO 0.001
15
15
16 extern unsigned short sequenceCounterParameterDump;
16 extern unsigned short sequenceCounterParameterDump;
17 extern unsigned short sequenceCounters_TM_DUMP[];
17 extern unsigned short sequenceCounters_TM_DUMP[];
18 extern float k_coeff_intercalib_f0_norm[ ];
18 extern float k_coeff_intercalib_f0_norm[ ];
19 extern float k_coeff_intercalib_f0_sbm[ ];
19 extern float k_coeff_intercalib_f0_sbm[ ];
20 extern float k_coeff_intercalib_f1_norm[ ];
20 extern float k_coeff_intercalib_f1_norm[ ];
21 extern float k_coeff_intercalib_f1_sbm[ ];
21 extern float k_coeff_intercalib_f1_sbm[ ];
22 extern float k_coeff_intercalib_f2[ ];
22 extern float k_coeff_intercalib_f2[ ];
23 extern fbins_masks_t fbins_masks;
23 extern fbins_masks_t fbins_masks;
24
24
25 int action_load_common_par( ccsdsTelecommandPacket_t *TC );
25 int action_load_common_par( ccsdsTelecommandPacket_t *TC );
26 int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
26 int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
27 int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
27 int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
28 int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
28 int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
29 int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
29 int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
30 int action_load_kcoefficients(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
30 int action_load_kcoefficients(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
31 int action_load_fbins_mask(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
31 int action_load_fbins_mask(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
32 int action_load_filter_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
32 int action_load_filter_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
33 int action_dump_kcoefficients(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
33 int action_dump_kcoefficients(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
34 int action_dump_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
34 int action_dump_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
35
35
36 // NORMAL
36 // NORMAL
37 int check_normal_par_consistency( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
37 int check_normal_par_consistency( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
38 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC );
38 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC );
39 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC );
39 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC );
40 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC );
40 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC );
41 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC );
41 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC );
42 int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC );
42 int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC );
43 int set_sy_lfr_n_cwf_long_f3( ccsdsTelecommandPacket_t *TC );
43 int set_sy_lfr_n_cwf_long_f3( ccsdsTelecommandPacket_t *TC );
44
44
45 // BURST
45 // BURST
46 int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC );
46 int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC );
47 int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC );
47 int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC );
48
48
49 // SBM1
49 // SBM1
50 int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC );
50 int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC );
51 int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC );
51 int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC );
52
52
53 // SBM2
53 // SBM2
54 int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC );
54 int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC );
55 int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC );
55 int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC );
56
56
57 // TC_LFR_UPDATE_INFO
57 // TC_LFR_UPDATE_INFO
58 unsigned int check_update_info_hk_lfr_mode( unsigned char mode );
58 unsigned int check_update_info_hk_lfr_mode( unsigned char mode );
59 unsigned int check_update_info_hk_tds_mode( unsigned char mode );
59 unsigned int check_update_info_hk_tds_mode( unsigned char mode );
60 unsigned int check_update_info_hk_thr_mode( unsigned char mode );
60 unsigned int check_update_info_hk_thr_mode( unsigned char mode );
61 void set_hk_lfr_sc_rw_f_flag( unsigned char wheel, unsigned char freq, float value );
62 void set_hk_lfr_sc_rw_f_flags( void );
61 void getReactionWheelsFrequencies( ccsdsTelecommandPacket_t *TC );
63 void getReactionWheelsFrequencies( ccsdsTelecommandPacket_t *TC );
62 void setFBinMask(unsigned char *fbins_mask, float rw_f, unsigned char deltaFreq, unsigned char flag );
64 void setFBinMask(unsigned char *fbins_mask, float rw_f, unsigned char deltaFreq, unsigned char flag );
63 void build_sy_lfr_rw_mask( unsigned int channel );
65 void build_sy_lfr_rw_mask( unsigned int channel );
64 void build_sy_lfr_rw_masks();
66 void build_sy_lfr_rw_masks();
65 void merge_fbins_masks( void );
67 void merge_fbins_masks( void );
66
68
67 // FBINS_MASK
69 // FBINS_MASK
68 int set_sy_lfr_fbins( ccsdsTelecommandPacket_t *TC );
70 int set_sy_lfr_fbins( ccsdsTelecommandPacket_t *TC );
69
71
70 // TC_LFR_LOAD_PARS_FILTER_PAR
72 // TC_LFR_LOAD_PARS_FILTER_PAR
71 int check_sy_lfr_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
73 int check_sy_lfr_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
72
74
73 // KCOEFFICIENTS
75 // KCOEFFICIENTS
74 int set_sy_lfr_kcoeff(ccsdsTelecommandPacket_t *TC , rtems_id queue_id);
76 int set_sy_lfr_kcoeff(ccsdsTelecommandPacket_t *TC , rtems_id queue_id);
75 void copyFloatByChar( unsigned char *destination, unsigned char *source );
77 void copyFloatByChar( unsigned char *destination, unsigned char *source );
76 void floatToChar( float value, unsigned char* ptr);
78 void floatToChar( float value, unsigned char* ptr);
77
79
78 void init_parameter_dump( void );
80 void init_parameter_dump( void );
79 void init_kcoefficients_dump( void );
81 void init_kcoefficients_dump( void );
80 void init_kcoefficients_dump_packet( Packet_TM_LFR_KCOEFFICIENTS_DUMP_t *kcoefficients_dump, unsigned char pkt_nr, unsigned char blk_nr );
82 void init_kcoefficients_dump_packet( Packet_TM_LFR_KCOEFFICIENTS_DUMP_t *kcoefficients_dump, unsigned char pkt_nr, unsigned char blk_nr );
81 void increment_seq_counter_destination_id_dump( unsigned char *packet_sequence_control, unsigned char destination_id );
83 void increment_seq_counter_destination_id_dump( unsigned char *packet_sequence_control, unsigned char destination_id );
82
84
83 #endif // TC_LOAD_DUMP_PARAMETERS_H
85 #endif // TC_LOAD_DUMP_PARAMETERS_H
@@ -1,14 +1,14
1 # LOAD FSW USING LINK 1
1 # LOAD FSW USING LINK 1
2 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
2 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
3
3
4 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
4 dsu3plugin0.openFile("/home/pleroy/DEV/DEV_PLE/FSW-qt/bin/fsw")
5 #dsu3plugin0.openFile("/opt/LFR/LFR-FSW/2.0.2.3/fsw")
5 #dsu3plugin0.openFile("/opt/LFR/LFR-FSW/2.0.2.3/fsw")
6 dsu3plugin0.loadFile()
6 dsu3plugin0.loadFile()
7
7
8 dsu3plugin0.run()
8 dsu3plugin0.run()
9
9
10 # START SENDING TIMECODES AT 1 Hz
10 # START SENDING TIMECODES AT 1 Hz
11 #SpwPlugin0.StarDundeeStartTimecodes( 1 )
11 #SpwPlugin0.StarDundeeStartTimecodes( 1 )
12
12
13 # it is possible to change the time code frequency
13 # it is possible to change the time code frequency
14 #RMAPPlugin0.changeTimecodeFrequency(2)
14 #RMAPPlugin0.changeTimecodeFrequency(2)
@@ -1,98 +1,92
1 /** Global variables of the LFR flight software.
1 /** Global variables of the LFR flight software.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * Among global variables, there are:
6 * Among global variables, there are:
7 * - RTEMS names and id.
7 * - RTEMS names and id.
8 * - APB configuration registers.
8 * - APB configuration registers.
9 * - waveforms global buffers, used by the waveform picker hardware module to store data.
9 * - waveforms global buffers, used by the waveform picker hardware module to store data.
10 * - spectral matrices buffesr, used by the hardware module to store data.
10 * - spectral matrices buffesr, used by the hardware module to store data.
11 * - variable related to LFR modes parameters.
11 * - variable related to LFR modes parameters.
12 * - the global HK packet buffer.
12 * - the global HK packet buffer.
13 * - the global dump parameter buffer.
13 * - the global dump parameter buffer.
14 *
14 *
15 */
15 */
16
16
17 #include <rtems.h>
17 #include <rtems.h>
18 #include <grspw.h>
18 #include <grspw.h>
19
19
20 #include "ccsds_types.h"
20 #include "ccsds_types.h"
21 #include "grlib_regs.h"
21 #include "grlib_regs.h"
22 #include "fsw_params.h"
22 #include "fsw_params.h"
23 #include "fsw_params_wf_handler.h"
23 #include "fsw_params_wf_handler.h"
24
24
25 // RTEMS GLOBAL VARIABLES
25 // RTEMS GLOBAL VARIABLES
26 rtems_name misc_name[5];
26 rtems_name misc_name[5];
27 rtems_name Task_name[20]; /* array of task names */
27 rtems_name Task_name[20]; /* array of task names */
28 rtems_id Task_id[20]; /* array of task ids */
28 rtems_id Task_id[20]; /* array of task ids */
29 rtems_name timecode_timer_name;
29 rtems_name timecode_timer_name;
30 rtems_id timecode_timer_id;
30 rtems_id timecode_timer_id;
31 int fdSPW = 0;
31 int fdSPW = 0;
32 int fdUART = 0;
32 int fdUART = 0;
33 unsigned char lfrCurrentMode;
33 unsigned char lfrCurrentMode;
34 unsigned char pa_bia_status_info;
34 unsigned char pa_bia_status_info;
35 unsigned char thisIsAnASMRestart = 0;
35 unsigned char thisIsAnASMRestart = 0;
36 unsigned char oneTcLfrUpdateTimeReceived = 0;
36 unsigned char oneTcLfrUpdateTimeReceived = 0;
37
37
38 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes = 24584
38 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes = 24584
39 // 97 * 256 = 24832 => delta = 248 bytes = 62 words
39 // 97 * 256 = 24832 => delta = 248 bytes = 62 words
40 // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264
40 // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264
41 // 127 * 256 = 32512 => delta = 248 bytes = 62 words
41 // 127 * 256 = 32512 => delta = 248 bytes = 62 words
42 // F0 F1 F2 F3
42 // F0 F1 F2 F3
43 volatile int wf_buffer_f0[ NB_RING_NODES_F0 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
43 volatile int wf_buffer_f0[ NB_RING_NODES_F0 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
44 volatile int wf_buffer_f1[ NB_RING_NODES_F1 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
44 volatile int wf_buffer_f1[ NB_RING_NODES_F1 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
45 volatile int wf_buffer_f2[ NB_RING_NODES_F2 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
45 volatile int wf_buffer_f2[ NB_RING_NODES_F2 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
46 volatile int wf_buffer_f3[ NB_RING_NODES_F3 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
46 volatile int wf_buffer_f3[ NB_RING_NODES_F3 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
47
47
48 //***********************************
48 //***********************************
49 // SPECTRAL MATRICES GLOBAL VARIABLES
49 // SPECTRAL MATRICES GLOBAL VARIABLES
50
50
51 // alignment constraints for the spectral matrices buffers => the first data after the time (8 bytes) shall be aligned on 0x00
51 // alignment constraints for the spectral matrices buffers => the first data after the time (8 bytes) shall be aligned on 0x00
52 volatile int sm_f0[ NB_RING_NODES_SM_F0 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
52 volatile int sm_f0[ NB_RING_NODES_SM_F0 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
53 volatile int sm_f1[ NB_RING_NODES_SM_F1 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
53 volatile int sm_f1[ NB_RING_NODES_SM_F1 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
54 volatile int sm_f2[ NB_RING_NODES_SM_F2 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
54 volatile int sm_f2[ NB_RING_NODES_SM_F2 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
55
55
56 // APB CONFIGURATION REGISTERS
56 // APB CONFIGURATION REGISTERS
57 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
57 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
58 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
58 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
59 waveform_picker_regs_0_1_18_t *waveform_picker_regs = (waveform_picker_regs_0_1_18_t*) REGS_ADDR_WAVEFORM_PICKER;
59 waveform_picker_regs_0_1_18_t *waveform_picker_regs = (waveform_picker_regs_0_1_18_t*) REGS_ADDR_WAVEFORM_PICKER;
60 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
60 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
61
61
62 // MODE PARAMETERS
62 // MODE PARAMETERS
63 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
63 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
64 struct param_local_str param_local;
64 struct param_local_str param_local;
65 unsigned int lastValidEnterModeTime;
65 unsigned int lastValidEnterModeTime;
66
66
67 // HK PACKETS
67 // HK PACKETS
68 Packet_TM_LFR_HK_t housekeeping_packet;
68 Packet_TM_LFR_HK_t housekeeping_packet;
69 unsigned char cp_rpw_sc_rw_f_flags;
69 unsigned char cp_rpw_sc_rw1_rw2_f_flags;
70 unsigned char cp_rpw_sc_rw3_rw4_f_flags;
70 // message queues occupancy
71 // message queues occupancy
71 unsigned char hk_lfr_q_sd_fifo_size_max;
72 unsigned char hk_lfr_q_sd_fifo_size_max;
72 unsigned char hk_lfr_q_rv_fifo_size_max;
73 unsigned char hk_lfr_q_rv_fifo_size_max;
73 unsigned char hk_lfr_q_p0_fifo_size_max;
74 unsigned char hk_lfr_q_p0_fifo_size_max;
74 unsigned char hk_lfr_q_p1_fifo_size_max;
75 unsigned char hk_lfr_q_p1_fifo_size_max;
75 unsigned char hk_lfr_q_p2_fifo_size_max;
76 unsigned char hk_lfr_q_p2_fifo_size_max;
76 // sequence counters are incremented by APID (PID + CAT) and destination ID
77 // sequence counters are incremented by APID (PID + CAT) and destination ID
77 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
78 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
78 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
79 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
79 unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
80 unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
80 unsigned short sequenceCounters_TM_DUMP[SEQ_CNT_NB_DEST_ID];
81 unsigned short sequenceCounters_TM_DUMP[SEQ_CNT_NB_DEST_ID];
81 unsigned short sequenceCounterHK;
82 unsigned short sequenceCounterHK;
82 spw_stats grspw_stats;
83 spw_stats grspw_stats;
83
84
84 // TC_LFR_UPDATE_INFO
85 // TC_LFR_UPDATE_INFO
85 float cp_rpw_sc_rw1_f1;
86 rw_f_t rw_f;
86 float cp_rpw_sc_rw1_f2;
87 float cp_rpw_sc_rw2_f1;
88 float cp_rpw_sc_rw2_f2;
89 float cp_rpw_sc_rw3_f1;
90 float cp_rpw_sc_rw3_f2;
91 float cp_rpw_sc_rw4_f1;
92 float cp_rpw_sc_rw4_f2;
93
87
94 // TC_LFR_LOAD_FILTER_PAR
88 // TC_LFR_LOAD_FILTER_PAR
95 filterPar_t filterPar;
89 filterPar_t filterPar;
96
90
97 fbins_masks_t fbins_masks;
91 fbins_masks_t fbins_masks;
98 unsigned int acquisitionDurations[3] = {ACQUISITION_DURATION_F0, ACQUISITION_DURATION_F1, ACQUISITION_DURATION_F2};
92 unsigned int acquisitionDurations[3] = {ACQUISITION_DURATION_F0, ACQUISITION_DURATION_F1, ACQUISITION_DURATION_F2};
@@ -1,955 +1,968
1 /** This is the RTEMS initialization module.
1 /** This is the RTEMS initialization module.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * This module contains two very different information:
6 * This module contains two very different information:
7 * - specific instructions to configure the compilation of the RTEMS executive
7 * - specific instructions to configure the compilation of the RTEMS executive
8 * - functions related to the fligth softwre initialization, especially the INIT RTEMS task
8 * - functions related to the fligth softwre initialization, especially the INIT RTEMS task
9 *
9 *
10 */
10 */
11
11
12 //*************************
12 //*************************
13 // GPL reminder to be added
13 // GPL reminder to be added
14 //*************************
14 //*************************
15
15
16 #include <rtems.h>
16 #include <rtems.h>
17
17
18 /* configuration information */
18 /* configuration information */
19
19
20 #define CONFIGURE_INIT
20 #define CONFIGURE_INIT
21
21
22 #include <bsp.h> /* for device driver prototypes */
22 #include <bsp.h> /* for device driver prototypes */
23
23
24 /* configuration information */
24 /* configuration information */
25
25
26 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
26 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
27 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
27 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
28
28
29 #define CONFIGURE_MAXIMUM_TASKS 21 // number of tasks concurrently active including INIT
29 #define CONFIGURE_MAXIMUM_TASKS 21 // number of tasks concurrently active including INIT
30 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
30 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
31 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
31 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
32 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
32 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
33 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
33 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
34 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
34 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
35 #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
35 #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
36 #define CONFIGURE_MAXIMUM_DRIVERS 16
36 #define CONFIGURE_MAXIMUM_DRIVERS 16
37 #define CONFIGURE_MAXIMUM_PERIODS 5 // [hous] [load] [avgv]
37 #define CONFIGURE_MAXIMUM_PERIODS 5 // [hous] [load] [avgv]
38 #define CONFIGURE_MAXIMUM_TIMERS 5 // [spiq] [link] [spacewire_reset_link]
38 #define CONFIGURE_MAXIMUM_TIMERS 5 // [spiq] [link] [spacewire_reset_link]
39 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5
39 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5
40 #ifdef PRINT_STACK_REPORT
40 #ifdef PRINT_STACK_REPORT
41 #define CONFIGURE_STACK_CHECKER_ENABLED
41 #define CONFIGURE_STACK_CHECKER_ENABLED
42 #endif
42 #endif
43
43
44 #include <rtems/confdefs.h>
44 #include <rtems/confdefs.h>
45
45
46 /* If --drvmgr was enabled during the configuration of the RTEMS kernel */
46 /* If --drvmgr was enabled during the configuration of the RTEMS kernel */
47 #ifdef RTEMS_DRVMGR_STARTUP
47 #ifdef RTEMS_DRVMGR_STARTUP
48 #ifdef LEON3
48 #ifdef LEON3
49 /* Add Timer and UART Driver */
49 /* Add Timer and UART Driver */
50
50
51 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
51 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
52 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
52 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
53 #endif
53 #endif
54
54
55 #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
55 #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
56 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
56 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
57 #endif
57 #endif
58
58
59 #endif
59 #endif
60 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */
60 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */
61
61
62 #include <drvmgr/drvmgr_confdefs.h>
62 #include <drvmgr/drvmgr_confdefs.h>
63 #endif
63 #endif
64
64
65 #include "fsw_init.h"
65 #include "fsw_init.h"
66 #include "fsw_config.c"
66 #include "fsw_config.c"
67 #include "GscMemoryLPP.hpp"
67 #include "GscMemoryLPP.hpp"
68
68
69 void initCache()
69 void initCache()
70 {
70 {
71 // ASI 2 contains a few control registers that have not been assigned as ancillary state registers.
71 // ASI 2 contains a few control registers that have not been assigned as ancillary state registers.
72 // These should only be read and written using 32-bit LDA/STA instructions.
72 // These should only be read and written using 32-bit LDA/STA instructions.
73 // All cache registers are accessed through load/store operations to the alternate address space (LDA/STA), using ASI = 2.
73 // All cache registers are accessed through load/store operations to the alternate address space (LDA/STA), using ASI = 2.
74 // The table below shows the register addresses:
74 // The table below shows the register addresses:
75 // 0x00 Cache control register
75 // 0x00 Cache control register
76 // 0x04 Reserved
76 // 0x04 Reserved
77 // 0x08 Instruction cache configuration register
77 // 0x08 Instruction cache configuration register
78 // 0x0C Data cache configuration register
78 // 0x0C Data cache configuration register
79
79
80 // Cache Control Register Leon3 / Leon3FT
80 // Cache Control Register Leon3 / Leon3FT
81 // 31..30 29 28 27..24 23 22 21 20..19 18 17 16
81 // 31..30 29 28 27..24 23 22 21 20..19 18 17 16
82 // RFT PS TB DS FD FI FT ST IB
82 // RFT PS TB DS FD FI FT ST IB
83 // 15 14 13..12 11..10 9..8 7..6 5 4 3..2 1..0
83 // 15 14 13..12 11..10 9..8 7..6 5 4 3..2 1..0
84 // IP DP ITE IDE DTE DDE DF IF DCS ICS
84 // IP DP ITE IDE DTE DDE DF IF DCS ICS
85
85
86 unsigned int cacheControlRegister;
86 unsigned int cacheControlRegister;
87
87
88 CCR_resetCacheControlRegister();
88 CCR_resetCacheControlRegister();
89 ASR16_resetRegisterProtectionControlRegister();
89 ASR16_resetRegisterProtectionControlRegister();
90
90
91 cacheControlRegister = CCR_getValue();
91 cacheControlRegister = CCR_getValue();
92 PRINTF1("(0) CCR - Cache Control Register = %x\n", cacheControlRegister);
92 PRINTF1("(0) CCR - Cache Control Register = %x\n", cacheControlRegister);
93 PRINTF1("(0) ASR16 = %x\n", *asr16Ptr);
93 PRINTF1("(0) ASR16 = %x\n", *asr16Ptr);
94
94
95 CCR_enableInstructionCache(); // ICS bits
95 CCR_enableInstructionCache(); // ICS bits
96 CCR_enableDataCache(); // DCS bits
96 CCR_enableDataCache(); // DCS bits
97 CCR_enableInstructionBurstFetch(); // IB bit
97 CCR_enableInstructionBurstFetch(); // IB bit
98
98
99 faultTolerantScheme();
99 faultTolerantScheme();
100
100
101 cacheControlRegister = CCR_getValue();
101 cacheControlRegister = CCR_getValue();
102 PRINTF1("(1) CCR - Cache Control Register = %x\n", cacheControlRegister);
102 PRINTF1("(1) CCR - Cache Control Register = %x\n", cacheControlRegister);
103 PRINTF1("(1) ASR16 Register protection control register = %x\n", *asr16Ptr);
103 PRINTF1("(1) ASR16 Register protection control register = %x\n", *asr16Ptr);
104
104
105 PRINTF("\n");
105 PRINTF("\n");
106 }
106 }
107
107
108 rtems_task Init( rtems_task_argument ignored )
108 rtems_task Init( rtems_task_argument ignored )
109 {
109 {
110 /** This is the RTEMS INIT taks, it is the first task launched by the system.
110 /** This is the RTEMS INIT taks, it is the first task launched by the system.
111 *
111 *
112 * @param unused is the starting argument of the RTEMS task
112 * @param unused is the starting argument of the RTEMS task
113