##// END OF EJS Templates
Integration of basic parameters functions in the flight software...
paul -
r179:f0fdfd2b8c4c VHDL_0_1_28
parent child
Show More
@@ -0,0 +1,191
1 # This file was generated by an application wizard of Qt Creator.
2 # The code below handles deployment to Android and Maemo, aswell as copying
3 # of the application data to shadow build directories on desktop.
4 # It is recommended not to modify this file, since newer versions of Qt Creator
5 # may offer an updated version of it.
6
7 defineTest(qtcAddDeployment) {
8 for(deploymentfolder, DEPLOYMENTFOLDERS) {
9 item = item$${deploymentfolder}
10 greaterThan(QT_MAJOR_VERSION, 4) {
11 itemsources = $${item}.files
12 } else {
13 itemsources = $${item}.sources
14 }
15 $$itemsources = $$eval($${deploymentfolder}.source)
16 itempath = $${item}.path
17 $$itempath= $$eval($${deploymentfolder}.target)
18 export($$itemsources)
19 export($$itempath)
20 DEPLOYMENT += $$item
21 }
22
23 MAINPROFILEPWD = $$PWD
24
25 android-no-sdk {
26 for(deploymentfolder, DEPLOYMENTFOLDERS) {
27 item = item$${deploymentfolder}
28 itemfiles = $${item}.files
29 $$itemfiles = $$eval($${deploymentfolder}.source)
30 itempath = $${item}.path
31 $$itempath = /data/user/qt/$$eval($${deploymentfolder}.target)
32 export($$itemfiles)
33 export($$itempath)
34 INSTALLS += $$item
35 }
36
37 target.path = /data/user/qt
38
39 export(target.path)
40 INSTALLS += target
41 } else:android {
42 for(deploymentfolder, DEPLOYMENTFOLDERS) {
43 item = item$${deploymentfolder}
44 itemfiles = $${item}.files
45 $$itemfiles = $$eval($${deploymentfolder}.source)
46 itempath = $${item}.path
47 $$itempath = /assets/$$eval($${deploymentfolder}.target)
48 export($$itemfiles)
49 export($$itempath)
50 INSTALLS += $$item
51 }
52
53 x86 {
54 target.path = /libs/x86
55 } else: armeabi-v7a {
56 target.path = /libs/armeabi-v7a
57 } else {
58 target.path = /libs/armeabi
59 }
60
61 export(target.path)
62 INSTALLS += target
63 } else:win32 {
64 copyCommand =
65 for(deploymentfolder, DEPLOYMENTFOLDERS) {
66 source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
67 source = $$replace(source, /, \\)
68 sourcePathSegments = $$split(source, \\)
69 target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
70 target = $$replace(target, /, \\)
71 target ~= s,\\\\\\.?\\\\,\\,
72 !isEqual(source,$$target) {
73 !isEmpty(copyCommand):copyCommand += &&
74 isEqual(QMAKE_DIR_SEP, \\) {
75 copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
76 } else {
77 source = $$replace(source, \\\\, /)
78 target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
79 target = $$replace(target, \\\\, /)
80 copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
81 }
82 }
83 }
84 !isEmpty(copyCommand) {
85 copyCommand = @echo Copying application data... && $$copyCommand
86 copydeploymentfolders.commands = $$copyCommand
87 first.depends = $(first) copydeploymentfolders
88 export(first.depends)
89 export(copydeploymentfolders.commands)
90 QMAKE_EXTRA_TARGETS += first copydeploymentfolders
91 }
92 } else:ios {
93 copyCommand =
94 for(deploymentfolder, DEPLOYMENTFOLDERS) {
95 source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
96 source = $$replace(source, \\\\, /)
97 target = $CODESIGNING_FOLDER_PATH/$$eval($${deploymentfolder}.target)
98 target = $$replace(target, \\\\, /)
99 sourcePathSegments = $$split(source, /)
100 targetFullPath = $$target/$$last(sourcePathSegments)
101 targetFullPath ~= s,/\\.?/,/,
102 !isEqual(source,$$targetFullPath) {
103 !isEmpty(copyCommand):copyCommand += &&
104 copyCommand += mkdir -p \"$$target\"
105 copyCommand += && cp -r \"$$source\" \"$$target\"
106 }
107 }
108 !isEmpty(copyCommand) {
109 copyCommand = echo Copying application data... && $$copyCommand
110 !isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK += ";"
111 QMAKE_POST_LINK += "$$copyCommand"
112 export(QMAKE_POST_LINK)
113 }
114 } else:unix {
115 maemo5 {
116 desktopfile.files = $${TARGET}.desktop
117 desktopfile.path = /usr/share/applications/hildon
118 icon.files = $${TARGET}64.png
119 icon.path = /usr/share/icons/hicolor/64x64/apps
120 } else:!isEmpty(MEEGO_VERSION_MAJOR) {
121 desktopfile.files = $${TARGET}_harmattan.desktop
122 desktopfile.path = /usr/share/applications
123 icon.files = $${TARGET}80.png
124 icon.path = /usr/share/icons/hicolor/80x80/apps
125 } else { # Assumed to be a Desktop Unix
126 copyCommand =
127 for(deploymentfolder, DEPLOYMENTFOLDERS) {
128 source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
129 source = $$replace(source, \\\\, /)
130 macx {
131 target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
132 } else {
133 target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
134 }
135 target = $$replace(target, \\\\, /)
136 sourcePathSegments = $$split(source, /)
137 targetFullPath = $$target/$$last(sourcePathSegments)
138 targetFullPath ~= s,/\\.?/,/,
139 !isEqual(source,$$targetFullPath) {
140 !isEmpty(copyCommand):copyCommand += &&
141 copyCommand += $(MKDIR) \"$$target\"
142 copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
143 }
144 }
145 !isEmpty(copyCommand) {
146 copyCommand = @echo Copying application data... && $$copyCommand
147 copydeploymentfolders.commands = $$copyCommand
148 first.depends = $(first) copydeploymentfolders
149 export(first.depends)
150 export(copydeploymentfolders.commands)
151 QMAKE_EXTRA_TARGETS += first copydeploymentfolders
152 }
153 }
154 !isEmpty(target.path) {
155 installPrefix = $${target.path}
156 } else {
157 installPrefix = /opt/$${TARGET}
158 }
159 for(deploymentfolder, DEPLOYMENTFOLDERS) {
160 item = item$${deploymentfolder}
161 itemfiles = $${item}.files
162 $$itemfiles = $$eval($${deploymentfolder}.source)
163 itempath = $${item}.path
164 $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
165 export($$itemfiles)
166 export($$itempath)
167 INSTALLS += $$item
168 }
169
170 !isEmpty(desktopfile.path) {
171 export(icon.files)
172 export(icon.path)
173 export(desktopfile.files)
174 export(desktopfile.path)
175 INSTALLS += icon desktopfile
176 }
177
178 isEmpty(target.path) {
179 target.path = $${installPrefix}/bin
180 export(target.path)
181 }
182 INSTALLS += target
183 }
184
185 export (ICON)
186 export (INSTALLS)
187 export (DEPLOYMENT)
188 export (LIBS)
189 export (QMAKE_EXTRA_TARGETS)
190 }
191
@@ -0,0 +1,13
1 TEMPLATE = app
2 CONFIG += console
3 CONFIG -= app_bundle
4 CONFIG -= qt
5
6 SOURCES += main.c
7
8 include(deployment.pri)
9 qtcAddDeployment()
10
11 HEADERS += \
12 functions.h
13
@@ -0,0 +1,65
1 #define NB_VALUES_PER_SM 25
2 #define NB_BINS_PER_SM 128
3
4 #define NB_BINS_COMPRESSED_SM_F0 11
5 #define ASM_F0_INDICE_START 17 // 88 bins
6 #define ASM_F0_INDICE_STOP 104 // 2 packets of 44 bins
7 #define NB_BINS_TO_AVERAGE_ASM_F0 8
8
9 void ASM_reorganize_and_divide( float *averaged_spec_mat, float *averaged_spec_mat_reorganized, float divider )
10 {
11 int frequencyBin;
12 int asmComponent;
13 unsigned int offsetASM;
14 unsigned int offsetASMReorganized;
15
16 // BUILD DATA
17 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
18 {
19 for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ )
20 {
21 offsetASMReorganized =
22 frequencyBin * NB_VALUES_PER_SM
23 + asmComponent;
24 offsetASM =
25 asmComponent * NB_BINS_PER_SM
26 + frequencyBin;
27 averaged_spec_mat_reorganized[offsetASMReorganized ] =
28 averaged_spec_mat[ offsetASM ] / divider;
29 }
30 }
31 }
32
33 void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat , float divider,
34 unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage, unsigned char ASMIndexStart )
35 {
36 int frequencyBin;
37 int asmComponent;
38 int offsetASM;
39 int offsetCompressed;
40 int k;
41
42 // BUILD DATA
43 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
44 {
45 for( frequencyBin = 0; frequencyBin < nbBinsCompressedMatrix; frequencyBin++ )
46 {
47 offsetCompressed = // NO TIME OFFSET
48 frequencyBin * NB_VALUES_PER_SM
49 + asmComponent;
50 offsetASM = // NO TIME OFFSET
51 asmComponent * NB_BINS_PER_SM
52 + ASMIndexStart
53 + frequencyBin * nbBinsToAverage;
54 compressed_spec_mat[ offsetCompressed ] = 0;
55 for ( k = 0; k < nbBinsToAverage; k++ )
56 {
57 compressed_spec_mat[offsetCompressed ] =
58 ( compressed_spec_mat[ offsetCompressed ]
59 + averaged_spec_mat[ offsetASM + k ] );
60 }
61 compressed_spec_mat[ offsetCompressed ] =
62 compressed_spec_mat[ offsetCompressed ] / (divider * nbBinsToAverage);
63 }
64 }
65 }
@@ -0,0 +1,64
1 #include <stdio.h>
2
3 #include "functions.h"
4
5 int main(void)
6 {
7 printf("Hello World!\n");
8
9 unsigned int asmComponent;
10 unsigned int frequencyBin;
11 unsigned int offset_input_ASM;
12
13 float input_ASM [ NB_VALUES_PER_SM * NB_BINS_PER_SM ];
14 float output_ASM [ NB_VALUES_PER_SM * NB_BINS_PER_SM ];
15 float output_ASM_compressed [ NB_VALUES_PER_SM * NB_BINS_COMPRESSED_SM_F0 ];
16
17 //*******
18 // TEST 1
19
20 offset_input_ASM = 0;
21
22 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
23 {
24 for (frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++)
25 {
26 offset_input_ASM = asmComponent * NB_BINS_PER_SM + frequencyBin;
27 input_ASM[ offset_input_ASM ] = asmComponent;
28 }
29 }
30
31 ASM_reorganize_and_divide( input_ASM, output_ASM,
32 1 ); // divider
33
34 ASM_compress_reorganize_and_divide( input_ASM, output_ASM_compressed,
35 1, // divider
36 NB_BINS_COMPRESSED_SM_F0,
37 NB_BINS_TO_AVERAGE_ASM_F0,
38 ASM_F0_INDICE_START);
39
40 //*******
41 // TEST 2
42 offset_input_ASM = 0;
43
44 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
45 {
46 for (frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++)
47 {
48 offset_input_ASM = asmComponent * NB_BINS_PER_SM + frequencyBin;
49 input_ASM[ offset_input_ASM ] = asmComponent * NB_BINS_PER_SM + frequencyBin;
50 }
51 }
52
53 ASM_reorganize_and_divide( input_ASM, output_ASM,
54 1 ); // divider
55
56 ASM_compress_reorganize_and_divide( input_ASM, output_ASM_compressed,
57 10, // divider
58 NB_BINS_COMPRESSED_SM_F0,
59 NB_BINS_TO_AVERAGE_ASM_F0,
60 ASM_F0_INDICE_START);
61
62 return 0;
63 }
64
@@ -1,2 +1,2
1 19349b3a5e90c2bacc9d369aa948c68aa9e8d5f0 LFR_basic-parameters
1 a309a930a482e851061936696121f4a1cf7005de LFR_basic-parameters
2 da5613aff4446e5c98b3c56bc32ce7008b3e2340 header/lfr_common_headers
2 2b5dc338fb623046072d6eb98c26ad884e17f95e header/lfr_common_headers
@@ -1,110 +1,111
1 TEMPLATE = app
1 TEMPLATE = app
2 # CONFIG += console v8 sim
2 # CONFIG += console v8 sim
3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch
3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch
4 # lpp_dpu_destid
4 # lpp_dpu_destid
5 CONFIG += console verbose lpp_dpu_destid
5 CONFIG += console verbose lpp_dpu_destid
6 CONFIG -= qt
6 CONFIG -= qt
7
7
8 include(./sparc.pri)
8 include(./sparc.pri)
9
9
10 # flight software version
10 # flight software version
11 SWVERSION=-1-0
11 SWVERSION=-1-0
12 DEFINES += SW_VERSION_N1=2 # major
12 DEFINES += SW_VERSION_N1=2 # major
13 DEFINES += SW_VERSION_N2=0 # minor
13 DEFINES += SW_VERSION_N2=0 # minor
14 DEFINES += SW_VERSION_N3=2 # patch
14 DEFINES += SW_VERSION_N3=2 # patch
15 DEFINES += SW_VERSION_N4=0 # internal
15 DEFINES += SW_VERSION_N4=1 # internal
16
16
17 # <GCOV>
17 # <GCOV>
18 #QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage
18 #QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage
19 #LIBS += -lgcov /opt/GCOV/01A/lib/overload.o -lc
19 #LIBS += -lgcov /opt/GCOV/01A/lib/overload.o -lc
20 # </GCOV>
20 # </GCOV>
21
21
22 # <CHANGE BEFORE FLIGHT>
22 # <CHANGE BEFORE FLIGHT>
23 contains( CONFIG, lpp_dpu_destid ) {
23 contains( CONFIG, lpp_dpu_destid ) {
24 DEFINES += LPP_DPU_DESTID
24 DEFINES += LPP_DPU_DESTID
25 }
25 }
26 # </CHANGE BEFORE FLIGHT>
26 # </CHANGE BEFORE FLIGHT>
27
27
28 contains( CONFIG, debug_tch ) {
28 contains( CONFIG, debug_tch ) {
29 DEFINES += DEBUG_TCH
29 DEFINES += DEBUG_TCH
30 }
30 }
31 DEFINES += LSB_FIRST_TCH
31
32
32 contains( CONFIG, vhdl_dev ) {
33 contains( CONFIG, vhdl_dev ) {
33 DEFINES += VHDL_DEV
34 DEFINES += VHDL_DEV
34 }
35 }
35
36
36 contains( CONFIG, verbose ) {
37 contains( CONFIG, verbose ) {
37 DEFINES += PRINT_MESSAGES_ON_CONSOLE
38 DEFINES += PRINT_MESSAGES_ON_CONSOLE
38 }
39 }
39
40
40 contains( CONFIG, debug_messages ) {
41 contains( CONFIG, debug_messages ) {
41 DEFINES += DEBUG_MESSAGES
42 DEFINES += DEBUG_MESSAGES
42 }
43 }
43
44
44 contains( CONFIG, cpu_usage_report ) {
45 contains( CONFIG, cpu_usage_report ) {
45 DEFINES += PRINT_TASK_STATISTICS
46 DEFINES += PRINT_TASK_STATISTICS
46 }
47 }
47
48
48 contains( CONFIG, stack_report ) {
49 contains( CONFIG, stack_report ) {
49 DEFINES += PRINT_STACK_REPORT
50 DEFINES += PRINT_STACK_REPORT
50 }
51 }
51
52
52 contains( CONFIG, boot_messages ) {
53 contains( CONFIG, boot_messages ) {
53 DEFINES += BOOT_MESSAGES
54 DEFINES += BOOT_MESSAGES
54 }
55 }
55
56
56 #doxygen.target = doxygen
57 #doxygen.target = doxygen
57 #doxygen.commands = doxygen ../doc/Doxyfile
58 #doxygen.commands = doxygen ../doc/Doxyfile
58 #QMAKE_EXTRA_TARGETS += doxygen
59 #QMAKE_EXTRA_TARGETS += doxygen
59
60
60 TARGET = fsw
61 TARGET = fsw
61
62
62 INCLUDEPATH += \
63 INCLUDEPATH += \
63 $${PWD}/../src \
64 $${PWD}/../src \
64 $${PWD}/../header \
65 $${PWD}/../header \
65 $${PWD}/../header/lfr_common_headers \
66 $${PWD}/../header/lfr_common_headers \
66 $${PWD}/../header/processing \
67 $${PWD}/../header/processing \
67 $${PWD}/../src/LFR_basic-parameters
68 $${PWD}/../LFR_basic-parameters
68
69
69 SOURCES += \
70 SOURCES += \
70 ../src/wf_handler.c \
71 ../src/wf_handler.c \
71 ../src/tc_handler.c \
72 ../src/tc_handler.c \
72 ../src/fsw_misc.c \
73 ../src/fsw_misc.c \
73 ../src/fsw_init.c \
74 ../src/fsw_init.c \
74 ../src/fsw_globals.c \
75 ../src/fsw_globals.c \
75 ../src/fsw_spacewire.c \
76 ../src/fsw_spacewire.c \
76 ../src/tc_load_dump_parameters.c \
77 ../src/tc_load_dump_parameters.c \
77 ../src/tm_lfr_tc_exe.c \
78 ../src/tm_lfr_tc_exe.c \
78 ../src/tc_acceptance.c \
79 ../src/tc_acceptance.c \
79 ../src/processing/fsw_processing.c \
80 ../src/processing/fsw_processing.c \
80 ../src/processing/avf0_prc0.c \
81 ../src/processing/avf0_prc0.c \
81 ../src/processing/avf1_prc1.c \
82 ../src/processing/avf1_prc1.c \
82 ../src/processing/avf2_prc2.c \
83 ../src/processing/avf2_prc2.c \
83 ../src/lfr_cpu_usage_report.c \
84 ../src/lfr_cpu_usage_report.c \
84 ../src/LFR_basic-parameters/basic_parameters.c
85 ../LFR_basic-parameters/basic_parameters.c
85
86
86 HEADERS += \
87 HEADERS += \
87 ../header/wf_handler.h \
88 ../header/wf_handler.h \
88 ../header/tc_handler.h \
89 ../header/tc_handler.h \
89 ../header/grlib_regs.h \
90 ../header/grlib_regs.h \
90 ../header/fsw_misc.h \
91 ../header/fsw_misc.h \
91 ../header/fsw_init.h \
92 ../header/fsw_init.h \
92 ../header/fsw_spacewire.h \
93 ../header/fsw_spacewire.h \
93 ../header/tc_load_dump_parameters.h \
94 ../header/tc_load_dump_parameters.h \
94 ../header/tm_lfr_tc_exe.h \
95 ../header/tm_lfr_tc_exe.h \
95 ../header/tc_acceptance.h \
96 ../header/tc_acceptance.h \
96 ../header/processing/fsw_processing.h \
97 ../header/processing/fsw_processing.h \
97 ../header/processing/avf0_prc0.h \
98 ../header/processing/avf0_prc0.h \
98 ../header/processing/avf1_prc1.h \
99 ../header/processing/avf1_prc1.h \
99 ../header/processing/avf2_prc2.h \
100 ../header/processing/avf2_prc2.h \
100 ../header/fsw_params_wf_handler.h \
101 ../header/fsw_params_wf_handler.h \
101 ../header/lfr_cpu_usage_report.h \
102 ../header/lfr_cpu_usage_report.h \
102 ../src/LFR_basic-parameters/basic_parameters.h \
103 ../src/LFR_basic-parameters/basic_parameters_params.h \
104 ../header/lfr_common_headers/ccsds_types.h \
103 ../header/lfr_common_headers/ccsds_types.h \
105 ../header/lfr_common_headers/fsw_params.h \
104 ../header/lfr_common_headers/fsw_params.h \
106 ../header/lfr_common_headers/fsw_params_nb_bytes.h \
105 ../header/lfr_common_headers/fsw_params_nb_bytes.h \
107 ../header/lfr_common_headers/fsw_params_processing.h \
106 ../header/lfr_common_headers/fsw_params_processing.h \
108 ../header/lfr_common_headers/TC_types.h \
107 ../header/lfr_common_headers/TC_types.h \
109 ../header/lfr_common_headers/tm_byte_positions.h
108 ../header/lfr_common_headers/tm_byte_positions.h \
109 ../LFR_basic-parameters/basic_parameters.h \
110 ../LFR_basic-parameters/basic_parameters_params.h
110
111
@@ -1,124 +1,128
1 #ifndef GRLIB_REGS_H_INCLUDED
1 #ifndef GRLIB_REGS_H_INCLUDED
2 #define GRLIB_REGS_H_INCLUDED
2 #define GRLIB_REGS_H_INCLUDED
3
3
4 #define NB_GPTIMER 3
4 #define NB_GPTIMER 3
5
5
6 struct apbuart_regs_str{
6 struct apbuart_regs_str{
7 volatile unsigned int data;
7 volatile unsigned int data;
8 volatile unsigned int status;
8 volatile unsigned int status;
9 volatile unsigned int ctrl;
9 volatile unsigned int ctrl;
10 volatile unsigned int scaler;
10 volatile unsigned int scaler;
11 volatile unsigned int fifoDebug;
11 volatile unsigned int fifoDebug;
12 };
12 };
13
13
14 struct grgpio_regs_str{
14 struct grgpio_regs_str{
15 volatile int io_port_data_register;
15 volatile int io_port_data_register;
16 int io_port_output_register;
16 int io_port_output_register;
17 int io_port_direction_register;
17 int io_port_direction_register;
18 int interrupt_mak_register;
18 int interrupt_mak_register;
19 int interrupt_polarity_register;
19 int interrupt_polarity_register;
20 int interrupt_edge_register;
20 int interrupt_edge_register;
21 int bypass_register;
21 int bypass_register;
22 int reserved;
22 int reserved;
23 // 0x20-0x3c interrupt map register(s)
23 // 0x20-0x3c interrupt map register(s)
24 };
24 };
25
25
26 typedef struct {
26 typedef struct {
27 volatile unsigned int counter;
27 volatile unsigned int counter;
28 volatile unsigned int reload;
28 volatile unsigned int reload;
29 volatile unsigned int ctrl;
29 volatile unsigned int ctrl;
30 volatile unsigned int unused;
30 volatile unsigned int unused;
31 } timer_regs_t;
31 } timer_regs_t;
32
32
33 typedef struct {
33 typedef struct {
34 volatile unsigned int scaler_value;
34 volatile unsigned int scaler_value;
35 volatile unsigned int scaler_reload;
35 volatile unsigned int scaler_reload;
36 volatile unsigned int conf;
36 volatile unsigned int conf;
37 volatile unsigned int unused0;
37 volatile unsigned int unused0;
38 timer_regs_t timer[NB_GPTIMER];
38 timer_regs_t timer[NB_GPTIMER];
39 } gptimer_regs_t;
39 } gptimer_regs_t;
40
40
41 typedef struct {
41 typedef struct {
42 volatile int ctrl; // bit 0 forces the load of the coarse_time_load value and resets the fine_time
42 volatile int ctrl; // bit 0 forces the load of the coarse_time_load value and resets the fine_time
43 // bit 1 is the soft reset for the time management module
43 // bit 1 is the soft reset for the time management module
44 // bit 2 is the soft reset for the waveform picker and the spectral matrix modules, set to 1 after HW reset
44 // bit 2 is the soft reset for the waveform picker and the spectral matrix modules, set to 1 after HW reset
45 volatile int coarse_time_load;
45 volatile int coarse_time_load;
46 volatile int coarse_time;
46 volatile int coarse_time;
47 volatile int fine_time;
47 volatile int fine_time;
48 } time_management_regs_t;
48 } time_management_regs_t;
49
49
50 // PDB >= 0.1.28
50 // PDB >= 0.1.28
51 typedef struct{
51 typedef struct{
52 int data_shaping; // 0x00 00 *** R1 R0 SP1 SP0 BW
52 int data_shaping; // 0x00 00 *** R1 R0 SP1 SP0 BW
53 int run_burst_enable; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
53 int run_burst_enable; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
54 int addr_data_f0_0; // 0x08
54 int addr_data_f0_0; // 0x08
55 int addr_data_f0_1; // 0x0c
55 int addr_data_f0_1; // 0x0c
56 int addr_data_f1_0; // 0x10
56 int addr_data_f1_0; // 0x10
57 int addr_data_f1_1; // 0x14
57 int addr_data_f1_1; // 0x14
58 int addr_data_f2_0; // 0x18
58 int addr_data_f2_0; // 0x18
59 int addr_data_f2_1; // 0x1c
59 int addr_data_f2_1; // 0x1c
60 int addr_data_f3_0; // 0x20
60 int addr_data_f3_0; // 0x20
61 int addr_data_f3_1; // 0x24
61 int addr_data_f3_1; // 0x24
62 volatile int status; // 0x28
62 volatile int status; // 0x28
63 int delta_snapshot; // 0x2c
63 int delta_snapshot; // 0x2c
64 int delta_f0; // 0x30
64 int delta_f0; // 0x30
65 int delta_f0_2; // 0x34
65 int delta_f0_2; // 0x34
66 int delta_f1; // 0x38
66 int delta_f1; // 0x38
67 int delta_f2; // 0x3c
67 int delta_f2; // 0x3c
68 int nb_data_by_buffer; // 0x40 number of samples in a buffer = 2688
68 int nb_data_by_buffer; // 0x40 number of samples in a buffer = 2688
69 int snapshot_param; // 0x44
69 int snapshot_param; // 0x44
70 int start_date; // 0x48
70 int start_date; // 0x48
71 //
71 //
72 volatile unsigned int f0_0_coarse_time; // 0x4c
72 volatile unsigned int f0_0_coarse_time; // 0x4c
73 volatile unsigned int f0_0_fine_time; // 0x50
73 volatile unsigned int f0_0_fine_time; // 0x50
74 volatile unsigned int f0_1_coarse_time; // 0x54
74 volatile unsigned int f0_1_coarse_time; // 0x54
75 volatile unsigned int f0_1_fine_time; // 0x58
75 volatile unsigned int f0_1_fine_time; // 0x58
76 //
76 //
77 volatile unsigned int f1_0_coarse_time; // 0x5c
77 volatile unsigned int f1_0_coarse_time; // 0x5c
78 volatile unsigned int f1_0_fine_time; // 0x60
78 volatile unsigned int f1_0_fine_time; // 0x60
79 volatile unsigned int f1_1_coarse_time; // 0x64
79 volatile unsigned int f1_1_coarse_time; // 0x64
80 volatile unsigned int f1_1_fine_time; // 0x68
80 volatile unsigned int f1_1_fine_time; // 0x68
81 //
81 //
82 volatile unsigned int f2_0_coarse_time; // 0x6c
82 volatile unsigned int f2_0_coarse_time; // 0x6c
83 volatile unsigned int f2_0_fine_time; // 0x70
83 volatile unsigned int f2_0_fine_time; // 0x70
84 volatile unsigned int f2_1_coarse_time; // 0x74
84 volatile unsigned int f2_1_coarse_time; // 0x74
85 volatile unsigned int f2_1_fine_time; // 0x78
85 volatile unsigned int f2_1_fine_time; // 0x78
86 //
86 //
87 volatile unsigned int f3_0_coarse_time; // 0x7c
87 volatile unsigned int f3_0_coarse_time; // 0x7c
88 volatile unsigned int f3_0_fine_time; // 0x80
88 volatile unsigned int f3_0_fine_time; // 0x80
89 volatile unsigned int f3_1_coarse_time; // 0x84
89 volatile unsigned int f3_1_coarse_time; // 0x84
90 volatile unsigned int f3_1_fine_time; // 0x88
90 volatile unsigned int f3_1_fine_time; // 0x88
91 //
91 //
92 unsigned int buffer_length; // 0x8c = buffer length in burst 2688 / 16 = 168
92 unsigned int buffer_length; // 0x8c = buffer length in burst 2688 / 16 = 168
93 //
94 volatile unsigned int v; // 0x90
95 volatile unsigned int e1; // 0x94
96 volatile unsigned int e2; // 0x98
93 } waveform_picker_regs_0_1_18_t;
97 } waveform_picker_regs_0_1_18_t;
94
98
95 typedef struct {
99 typedef struct {
96 volatile int config; // 0x00
100 volatile int config; // 0x00
97 volatile int status; // 0x04
101 volatile int status; // 0x04
98 volatile int f0_0_address; // 0x08
102 volatile int f0_0_address; // 0x08
99 volatile int f0_1_address; // 0x0C
103 volatile int f0_1_address; // 0x0C
100 //
104 //
101 volatile int f1_0_address; // 0x10
105 volatile int f1_0_address; // 0x10
102 volatile int f1_1_address; // 0x14
106 volatile int f1_1_address; // 0x14
103 volatile int f2_0_address; // 0x18
107 volatile int f2_0_address; // 0x18
104 volatile int f2_1_address; // 0x1C
108 volatile int f2_1_address; // 0x1C
105 //
109 //
106 volatile unsigned int f0_0_coarse_time; // 0x20
110 volatile unsigned int f0_0_coarse_time; // 0x20
107 volatile unsigned int f0_0_fine_time; // 0x24
111 volatile unsigned int f0_0_fine_time; // 0x24
108 volatile unsigned int f0_1_coarse_time; // 0x28
112 volatile unsigned int f0_1_coarse_time; // 0x28
109 volatile unsigned int f0_1_fine_time; // 0x2C
113 volatile unsigned int f0_1_fine_time; // 0x2C
110 //
114 //
111 volatile unsigned int f1_0_coarse_time; // 0x30
115 volatile unsigned int f1_0_coarse_time; // 0x30
112 volatile unsigned int f1_0_fine_time; // 0x34
116 volatile unsigned int f1_0_fine_time; // 0x34
113 volatile unsigned int f1_1_coarse_time; // 0x38
117 volatile unsigned int f1_1_coarse_time; // 0x38
114 volatile unsigned int f1_1_time_time; // 0x3C
118 volatile unsigned int f1_1_fine_time; // 0x3C
115 //
119 //
116 volatile unsigned int f2_0_coarse_time; // 0x40
120 volatile unsigned int f2_0_coarse_time; // 0x40
117 volatile unsigned int f2_0_fine_time; // 0x44
121 volatile unsigned int f2_0_fine_time; // 0x44
118 volatile unsigned int f2_1_coarse_time; // 0x48
122 volatile unsigned int f2_1_coarse_time; // 0x48
119 volatile unsigned int f2_1_fine_time; // 0x4C
123 volatile unsigned int f2_1_fine_time; // 0x4C
120 //
124 //
121 unsigned int matrix_length; // 0x50, length of a spectral matrix in burst 3200 / 16 = 200 = 0xc8
125 unsigned int matrix_length; // 0x50, length of a spectral matrix in burst 3200 / 16 = 200 = 0xc8
122 } spectral_matrix_regs_t;
126 } spectral_matrix_regs_t;
123
127
124 #endif // GRLIB_REGS_H_INCLUDED
128 #endif // GRLIB_REGS_H_INCLUDED
@@ -1,36 +1,37
1 #ifndef AVF0_PRC0_H_INCLUDED
1 #ifndef AVF0_PRC0_H_INCLUDED
2 #define AVF0_PRC0_H_INCLUDED
2 #define AVF0_PRC0_H_INCLUDED
3
3
4 #include "fsw_processing.h"
4 #include "fsw_processing.h"
5 #include "basic_parameters.h"
5 #include "basic_parameters.h"
6
6
7 typedef struct {
7 typedef struct {
8 unsigned int norm_bp1;
8 unsigned int norm_bp1;
9 unsigned int norm_bp2;
9 unsigned int norm_bp2;
10 unsigned int norm_asm;
10 unsigned int norm_asm;
11 unsigned int burst_sbm_bp1;
11 unsigned int burst_sbm_bp1;
12 unsigned int burst_sbm_bp2;
12 unsigned int burst_sbm_bp2;
13 unsigned int burst_bp1;
13 unsigned int burst_bp1;
14 unsigned int burst_bp2;
14 unsigned int burst_bp2;
15 unsigned int sbm1_bp1;
15 unsigned int sbm1_bp1;
16 unsigned int sbm1_bp2;
16 unsigned int sbm1_bp2;
17 unsigned int sbm2_bp1;
17 unsigned int sbm2_bp1;
18 unsigned int sbm2_bp2;
18 unsigned int sbm2_bp2;
19 } nb_sm_before_bp_asm_f0;
19 } nb_sm_before_bp_asm_f0;
20
20
21 //************
21 //************
22 // RTEMS TASKS
22 // RTEMS TASKS
23 rtems_task avf0_task( rtems_task_argument lfrRequestedMode );
23 rtems_task avf0_task( rtems_task_argument lfrRequestedMode );
24 rtems_task prc0_task( rtems_task_argument lfrRequestedMode );
24 rtems_task prc0_task( rtems_task_argument lfrRequestedMode );
25
25
26 //**********
26 //**********
27 // FUNCTIONS
27 // FUNCTIONS
28
28
29 void reset_nb_sm_f0( unsigned char lfrMode );
29 void reset_nb_sm_f0( unsigned char lfrMode );
30 void init_k_coefficients_f0( void );
31 void test_TCH( void );
30
32
31 //*******
33 //*******
32 // EXTERN
34 // EXTERN
33 extern ring_node *ring_node_for_averaging_sm_f0;
34 extern rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id );
35 extern rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id );
35
36
36 #endif // AVF0_PRC0_H_INCLUDED
37 #endif // AVF0_PRC0_H_INCLUDED
@@ -1,33 +1,34
1 #ifndef AVF1_PRC1_H
1 #ifndef AVF1_PRC1_H
2 #define AVF1_PRC1_H
2 #define AVF1_PRC1_H
3
3
4 #include "fsw_processing.h"
4 #include "fsw_processing.h"
5 #include "basic_parameters.h"
5
6
6 typedef struct {
7 typedef struct {
7 unsigned int norm_bp1;
8 unsigned int norm_bp1;
8 unsigned int norm_bp2;
9 unsigned int norm_bp2;
9 unsigned int norm_asm;
10 unsigned int norm_asm;
10 unsigned int burst_sbm_bp1;
11 unsigned int burst_sbm_bp1;
11 unsigned int burst_sbm_bp2;
12 unsigned int burst_sbm_bp2;
12 unsigned int burst_bp1;
13 unsigned int burst_bp1;
13 unsigned int burst_bp2;
14 unsigned int burst_bp2;
14 unsigned int sbm2_bp1;
15 unsigned int sbm2_bp1;
15 unsigned int sbm2_bp2;
16 unsigned int sbm2_bp2;
16 } nb_sm_before_bp_asm_f1;
17 } nb_sm_before_bp_asm_f1;
17
18
18 //************
19 //************
19 // RTEMS TASKS
20 // RTEMS TASKS
20 rtems_task avf1_task( rtems_task_argument lfrRequestedMode );
21 rtems_task avf1_task( rtems_task_argument lfrRequestedMode );
21 rtems_task prc1_task( rtems_task_argument lfrRequestedMode );
22 rtems_task prc1_task( rtems_task_argument lfrRequestedMode );
22
23
23 //**********
24 //**********
24 // FUNCTIONS
25 // FUNCTIONS
25
26
26 void reset_nb_sm_f1( unsigned char lfrMode );
27 void reset_nb_sm_f1( unsigned char lfrMode );
28 void init_k_coefficients_f1( void );
27
29
28 //*******
30 //*******
29 // EXTERN
31 // EXTERN
30 extern struct ring_node *ring_node_for_averaging_sm_f1;
31 extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
32 extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
32
33
33 #endif // AVF1_PRC1_H
34 #endif // AVF1_PRC1_H
@@ -1,28 +1,29
1 #ifndef AVF2_PRC2_H
1 #ifndef AVF2_PRC2_H
2 #define AVF2_PRC2_H
2 #define AVF2_PRC2_H
3
3
4 #include "fsw_processing.h"
4 #include "fsw_processing.h"
5 #include "basic_parameters.h"
5
6
6 typedef struct {
7 typedef struct {
7 unsigned int norm_bp1;
8 unsigned int norm_bp1;
8 unsigned int norm_bp2;
9 unsigned int norm_bp2;
9 unsigned int norm_asm;
10 unsigned int norm_asm;
10 } nb_sm_before_bp_asm_f2;
11 } nb_sm_before_bp_asm_f2;
11
12
12 //************
13 //************
13 // RTEMS TASKS
14 // RTEMS TASKS
14 rtems_task avf2_task( rtems_task_argument lfrRequestedMode );
15 rtems_task avf2_task( rtems_task_argument lfrRequestedMode );
15 rtems_task prc2_task( rtems_task_argument lfrRequestedMode );
16 rtems_task prc2_task( rtems_task_argument lfrRequestedMode );
16
17
17 //**********
18 //**********
18 // FUNCTIONS
19 // FUNCTIONS