##// END OF EJS Templates
fifo occupation reported in the HK packet
paul -
r197:d5570d7e57e2 R3
parent child
Show More
@@ -0,0 +1,75
1 TEMPLATE = app
2 # CONFIG += console v8 sim
3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch
4 # lpp_dpu_destid
5 CONFIG += console verbose lpp_dpu_destid cpu_usage_report
6 CONFIG -= qt
7
8 include(./sparc.pri)
9
10 # eqm debug software version
11 SWVERSION=-1-0
12 DEFINES += SW_VERSION_N1=0 # major
13 DEFINES += SW_VERSION_N2=0 # minor
14 DEFINES += SW_VERSION_N3=0 # patch
15 DEFINES += SW_VERSION_N4=0 # internal
16
17 # <GCOV>
18 #QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage
19 #LIBS += -lgcov /opt/GCOV/01A/lib/overload.o -lc
20 # </GCOV>
21
22 # <CHANGE BEFORE FLIGHT>
23 contains( CONFIG, lpp_dpu_destid ) {
24 DEFINES += LPP_DPU_DESTID
25 }
26 # </CHANGE BEFORE FLIGHT>
27
28 contains( CONFIG, debug_tch ) {
29 DEFINES += DEBUG_TCH
30 }
31 DEFINES += MSB_FIRST_TCH
32
33 contains( CONFIG, vhdl_dev ) {
34 DEFINES += VHDL_DEV
35 }
36
37 contains( CONFIG, verbose ) {
38 DEFINES += PRINT_MESSAGES_ON_CONSOLE
39 }
40
41 contains( CONFIG, debug_messages ) {
42 DEFINES += DEBUG_MESSAGES
43 }
44
45 contains( CONFIG, cpu_usage_report ) {
46 DEFINES += PRINT_TASK_STATISTICS
47 }
48
49 contains( CONFIG, stack_report ) {
50 DEFINES += PRINT_STACK_REPORT
51 }
52
53 contains( CONFIG, boot_messages ) {
54 DEFINES += BOOT_MESSAGES
55 }
56
57 #doxygen.target = doxygen
58 #doxygen.commands = doxygen ../doc/Doxyfile
59 #QMAKE_EXTRA_TARGETS += doxygen
60
61 TARGET = eqm
62
63 INCLUDEPATH += ./header \
64 ../header/lfr_common_headers
65
66 SOURCES += \
67 src/main.c \
68 src/grspw.c
69
70 HEADERS += \
71 ../header/lfr_common_headers/fsw_params.h \
72 header/grspw.h
73
74
75
@@ -0,0 +1,8
1 #ifndef GRSPW_H_INCLUDED
2 #define GRSPW_H_INCLUDED
3
4 int grspw_set_ie( unsigned char value, unsigned int *ctrlReg );
5 int grspw_set_tq( unsigned char value, unsigned int *ctrlReg );
6 int grspw_set_tr( unsigned char value, unsigned int *ctrlReg );
7
8 #endif // GRSPW_H_INCLUDED
@@ -0,0 +1,97
1 CONFIG += console
2 CONFIG -= qt
3 QMAKE_CC=sparc-elf-gcc
4 message(C compiler forced to: $$QMAKE_CC)
5 QMAKE_CXX=sparc-elf-g++
6 message(C++ compiler forced to: $$QMAKE_CXX)
7 QMAKE_AR=sparc-elf-ar rcs
8 message(Archiver forced to: $$QMAKE_AR)
9 QMAKE_LINK=sparc-elf-g++
10 message(Linker forced to: $$QMAKE_LINK)
11 QMAKE_LINK_SHLIB=sparc-rtems-g++
12 QMAKE_OBJCOPY= sparc-elf-objcopy
13 QMAKE_STRIP=sparc-elf-strip
14 QMAKE_GDB=sparc-elf-gdb
15
16 INCLUDEPATH += /opt/sparc-elf-4.4.2
17
18 QMAKE_CFLAGS_DEBUG= -g
19 QMAKE_CFLAGS_RELEASE=""
20 QMAKE_CXXFLAGS_DEBUG= -g
21 QMAKE_CXXFLAGS_RELEASE=""
22 QMAKE_LFLAGS_RELEASE=""
23 QMAKE_LFLAGS_DEBUG= -g
24 QMAKE_CXXFLAGS_DEPS =
25 QMAKE_CXXFLAGS_WARN_ON = -Wall
26 QMAKE_CXXFLAGS_WARN_OFF = -w
27 QMAKE_CXXFLAGS_RELEASE =
28 QMAKE_CXXFLAGS_DEBUG =
29 QMAKE_CXXFLAGS_YACC =
30 QMAKE_CXXFLAGS_THREAD =
31 QMAKE_CXXFLAGS_RTTI_ON =
32 QMAKE_CXXFLAGS_RTTI_OFF =
33 QMAKE_CXXFLAGS_EXCEPTIONS_ON =
34 QMAKE_CXXFLAGS_EXCEPTIONS_OFF =
35 QMAKE_CFLAGS_WARN_ON = -Wall
36 QMAKE_CFLAGS_WARN_OFF = -w
37 QMAKE_CFLAGS_RELEASE =
38 QMAKE_CFLAGS_YACC =
39 QMAKE_LFLAGS_EXCEPTIONS_ON =
40 QMAKE_LFLAGS_EXCEPTIONS_OFF =
41 QMAKE_LFLAGS_RELEASE =
42 QMAKE_LFLAGS_CONSOLE =
43 QMAKE_LFLAGS_WINDOWS =
44 QMAKE_LFLAGS_DLL =
45 QMAKE_INCDIR_QT =
46 QMAKE_INCDIR =
47 QMAKE_CFLAGS_SHLIB =
48 QMAKE_CFLAGS_STATIC_LIB =
49 QMAKE_CXXFLAGS_SHLIB =
50 QMAKE_CXXFLAGS_STATIC_LIB =
51 QMAKE_LIBS=""
52 INCLUDEPATH=""
53 DEFINES=""
54
55 contains( TEMPLATE, app ) {
56 OBJECTS_DIR=obj
57 DESTDIR=bin
58 }
59
60 #QMAKE_CFLAGS_RELEASE += -O0
61 #QMAKE_CFLAGS_DEBUG += -O0
62 #QMAKE_CXXFLAGS_RELEASE += -O0
63 #QMAKE_CXXFLAGS_DEBUG += -O0
64 QMAKE_CFLAGS_RELEASE += -O3
65 QMAKE_CFLAGS_DEBUG += -O3
66 QMAKE_CXXFLAGS_RELEASE += -O3
67 QMAKE_CXXFLAGS_DEBUG += -O3
68
69 #QMAKE_CFLAGS_RELEASE+= -O3 -std=c99
70 #QMAKE_CFLAGS_DEBUG+= -O3 -std=c99
71 #QMAKE_CXXFLAGS_RELEASE+= -O3 -std=c99
72 #QMAKE_CXXFLAGS_DEBUG+= -O3 -std=c99
73
74 contains( TEMPLATE, app ) {
75 grmon.target = grmon
76 grmon.commands = cd $$DESTDIR && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
77 QMAKE_EXTRA_TARGETS += grmon
78 }
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@@ -0,0 +1,70
1 #include "grspw.h"
2
3 int grspw_set_ie( unsigned char value, unsigned int *ctrlReg )
4 {
5 // IE = bit 3
6 // Interrupt Enable
7
8 int ret = 0;
9
10 if (value == 0)
11 {
12 *ctrlReg = *ctrlReg & 0xfffffff7;
13 }
14 else if (value == 1)
15 {
16 *ctrlReg = *ctrlReg | 0x00000008;
17 }
18 else
19 {
20 ret = -1;
21 }
22
23 return ret;
24 }
25
26 int grspw_set_tq( unsigned char value, unsigned int *ctrlReg )
27 {
28 // TQ = bit 8
29 // Tick-out IRQ
30
31 int ret = 0;
32
33 if (value == 0)
34 {
35 *ctrlReg = *ctrlReg & 0xfffffeff;
36 }
37 else if (value == 1)
38 {
39 *ctrlReg = *ctrlReg | 0x00000100;
40 }
41 else
42 {
43 ret = -1;
44 }
45
46 return ret;
47 }
48
49 int grspw_set_tr( unsigned char value, unsigned int *ctrlReg )
50 {
51 // TR = bit 11
52 // Enable timecode reception
53
54 int ret = 0;
55
56 if (value == 0)
57 {
58 *ctrlReg = *ctrlReg & 0xfffff7ff;
59 }
60 else if (value == 1)
61 {
62 *ctrlReg = *ctrlReg | 0x00000800;
63 }
64 else
65 {
66 ret = -1;
67 }
68
69 return ret;
70 }
@@ -0,0 +1,81
1 #include <stdio.h>
2
3 #include "grspw.h"
4 #include "fsw_params.h"
5
6 #define DSU_TIME_TAG_COUNTER 0x90000008
7
8 //**********
9 // IRQ LINES
10 #define IRQ_GRSPW 11
11 #define IRQ_SPARC_GRSPW 0x1b // see sparcv8.pdf p.76 for interrupt levels
12
13 extern void *catch_interrupt(void func(), int irq);
14 int *lreg = (int *) 0x80000000;
15
16 #define ICLEAR 0x20c
17 #define IMASK 0x240
18 #define IFORCE 0x208
19
20 void enable_irq (int irq)
21 {
22 lreg[ICLEAR/4] = (1 << irq); // clear any pending irq
23 lreg[IMASK/4] |= (1 << irq); // unmaks irq
24 }
25
26 void disable_irq (int irq) { lreg[IMASK/4] &= ~(1 << irq); } // mask irq
27
28 void force_irq (int irq) { lreg[IFORCE/4] = (1 << irq); } // force irq
29
30 /* NOTE: NEVER put printf() or other stdio routines in interrupt handlers,
31 they are not re-entrant. This (bad) example is just a demo */
32
33 unsigned char processTimecode = 0;
34
35 void irqhandler(int irq)
36 {
37 processTimecode = 1;
38 }
39
40 int main( void )
41 {
42 unsigned int *grspwCtrlReg;
43 unsigned int k;
44 volatile unsigned int *reg;
45 float aux;
46 unsigned int counter = 0;
47
48 printf("hello world!\n");
49
50 grspwCtrlReg = (unsigned int*) REGS_ADDR_GRSPW;
51 grspw_set_ie( 1, grspwCtrlReg );
52 grspw_set_tq( 1, grspwCtrlReg );
53 grspw_set_tr( 1, grspwCtrlReg );
54
55 catch_interrupt(irqhandler, IRQ_GRSPW);
56 enable_irq( IRQ_GRSPW );
57 force_irq( IRQ_GRSPW );
58
59 reg = (volatile unsigned int *) DSU_TIME_TAG_COUNTER;
60
61 while(1)
62 {
63 if (processTimecode == 1)
64 {
65 counter ++;
66 printf("timecode counter = %d\n", counter);
67 processTimecode = 0;
68 }
69 else
70 {
71 printf(".");
72 }
73
74 // for (k=0; k<100000;k++)
75 // {
76 // aux = aux + *reg ;
77 // }
78 }
79
80 return 0;
81 }
@@ -0,0 +1,17
1 # LOAD FSW USING LINK 1
2 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
3
4 APB_UART_PLUGIN0.setFifoDebugEnabled( 0 )
5
6 dsu3plugin0.openFile("/opt/DEV_PLE/EQM/bin/eqm")
7 dsu3plugin0.loadFile()
8
9 dsu3plugin0.run()
10
11 APB_UART_PLUGIN0.setFifoDebugEnabled( 1 )
12
13 # START SENDING TIMECODES AT 1 Hz
14 SpwPlugin0.StarDundeeStartTimecodes( 1 )
15
16 # it is possible to change the time code frequency
17 #RMAPPlugin0.changeTimecodeFrequency(2)
@@ -0,0 +1,34
1 import time
2
3 proxy.loadSysDriver("SpwPlugin","SpwPlugin0")
4 SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick")
5
6 proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0")
7 proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0")
8
9 proxy.loadSysDriverToParent("APB_UART_PLUGIN","SpwPlugin0")
10 APB_UART_PLUGIN0.setFifoDebugEnabled( 1 )
11
12 availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount()
13 print str(availableBrickCount) + " SpaceWire brick(s) found"
14
15 SpwPlugin0.StarDundeeSelectBrick(1)
16 SpwPlugin0.StarDundeeSetBrickAsARouter(1)
17 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
18 SpwPlugin0.connectBridge()
19
20 #SpwPlugin0.TCPServerSetIP("127.0.0.1")
21 SpwPlugin0.TCPServerConnect()
22
23 # OPEN SPACEWIRE SERVER
24 #LFRControlPlugin0.SetSpwServerIP(129,104,27,164)
25 LFRControlPlugin0.TCPServerConnect()
26
27 # OPEN TM ECHO BRIDGE SERVER
28 LFRControlPlugin0.TMEchoBridgeOpenPort()
29
30 # START SENDING TIMECODES AT 1 Hz
31 SpwPlugin0.StarDundeeStartTimecodes( 1 )
32
33 # it is possible to change the time code frequency
34 #RMAPPlugin0.changeTimecodeFrequency(2)
@@ -0,0 +1,34
1 #!/usr/bin/lppmon -e
2
3 import time
4
5 proxy.loadSysDriver("SpwPlugin","SpwPlugin0")
6 SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick")
7
8 proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0")
9 proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0")
10
11 proxy.loadSysDriverToParent("APB_UART_PLUGIN","SpwPlugin0")
12 APB_UART_PLUGIN0.setFifoDebugEnabled( 0 )
13
14 availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount()
15 print "availableBrickCount = ", availableBrickCount
16
17 SpwPlugin0.StarDundeeSelectBrick(1)
18 SpwPlugin0.StarDundeeSetBrickAsARouter(1)
19 SpwPlugin0.connectBridge()
20
21 #SpwPlugin0.TCPServerSetIP("127.0.0.1")
22 SpwPlugin0.TCPServerConnect()
23
24 #LFRControlPlugin0.SetSpwServerIP(129,104,27,164)
25 LFRControlPlugin0.TCPServerConnect()
26
27 dsu3plugin0.openFile("/opt/DEV_PLE/EQM/bin/eqm")
28 dsu3plugin0.loadFile()
29 dsu3plugin0.run()
30
31 APB_UART_PLUGIN0.setFifoDebugEnabled( 1 )
32
33 LFRControlPlugin0.TMEchoBridgeOpenPort()
34
@@ -0,0 +1,13
1 # LOAD FSW USING LINK 1
2 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
3
4 dsu3plugin0.openFile("/opt/LFR/LFR-FSW/2.0.2.3/fsw")
5 dsu3plugin0.loadFile()
6
7 dsu3plugin0.run()
8
9 # START SENDING TIMECODES AT 1 Hz
10 SpwPlugin0.StarDundeeStartTimecodes( 1 )
11
12 # it is possible to change the time code frequency
13 #RMAPPlugin0.changeTimecodeFrequency(2)
@@ -0,0 +1,5
1 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
2 dsu3plugin0.loadFile()
3
4 dsu3plugin0.run()
5
@@ -0,0 +1,83
1 #from PyQt4 import QtGui
2 #from PyQt4 import QtCore
3 #from PyQt4 import Qt
4 import sys
5 def elfSize(FileName,section):
6 bashCommand = "/usr/bin/size "+ FileName
7 import subprocess
8 process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
9 result = process.communicate()[0].split("\n")
10 header = result[0].lstrip()
11 line1 = result[1].lstrip()
12 hcolumns=header.split()
13 columns=line1.split()
14 for i in range(0,len(hcolumns)):
15 if(hcolumns[i].find(section) != -1):
16 return int(columns[i])
17 return 0;
18
19
20 def elfAddress(FileName,section):
21 bashCommand = "readelf -S " + FileName
22 import subprocess
23 process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
24 result = process.communicate()[0].split()
25 for i in range(0,len(result)):
26 if(result[i].find('.'+section) != -1):
27 return int("0x"+result[i+2],16)
28 return 0;
29
30 def compare(data1,data2):
31 if len(data1)!=len(data2):
32 return [-1,-1]
33 for i in range(len(data1)):
34 if data1[i]!=data2[i]:
35 return [-1,i]
36 return [1,-1]
37
38 def cycles(rootPlugin,textAddress,textSize,orgiData,count):
39 for i in range(count):
40 rootPlugin.dumpMemory(textAddress,textSize/4,"/opt/dump"+str(i)+".srec","srec")
41 data = rootPlugin.Read(textAddress,textSize/4)
42 result = compare(data,orgiData)
43 if(result[0]==1):
44 print("test number "+str(i)+" = success")
45 else:
46 print("test number "+str(i)+" = error @0x" + hex(textAddress + result[1]))
47
48
49 #app = QtGui.QApplication(sys.argv)
50 fileName = QtGui.QFileDialog.getOpenFileName()
51
52 if PySocExplorer.ElfFile.isElf(fileName):
53 proxy.loadSysDriver("SpwPlugin","SpwPlugin0")
54 SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick")
55
56 proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0")
57 proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0")
58 SpwPlugin0.TCPServerConnect()
59 LFRControlPlugin0.TCPServerConnect()
60 proxy.loadSysDriverToParent("APB_UART_PLUGIN","SpwPlugin0")
61 availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount()
62 print(str(availableBrickCount) + " SpaceWire brick(s) found")
63
64 SpwPlugin0.StarDundeeSelectBrick(1)
65 SpwPlugin0.StarDundeeSetBrickAsARouter(1)
66 SpwPlugin0.connectBridge()
67 APB_UART_PLUGIN0.setUARTPortNane("/dev/ttyUSB1")
68 APB_UART_PLUGIN0.setUARTPortSpeed(38400)
69 APB_UART_PLUGIN0.openUart()
70 textSize= elfSize(fileName,"text")
71 textAddress= elfAddress(fileName,"text")
72 print "Found text section@" + hex(textAddress)+ " of " + str(textSize) +" bytes"
73 print "loading software"
74 dsu3plugin0.openFile(fileName)
75 dsu3plugin0.loadFile()
76 SpwPlugin0.dumpMemory(textAddress,textSize/4,"/opt/dumpOrig.srec","srec")
77 dsu3plugin0.run()
78 orgiData = SpwPlugin0.Read(textAddress,textSize/4)
79 orgiData = SpwPlugin0.Read(textAddress,textSize/4)
80
81
82
83
@@ -16,8 +16,6
16 #include "avf1_prc1.h"
16 #include "avf1_prc1.h"
17 #include "avf2_prc2.h"
17 #include "avf2_prc2.h"
18
18
19 #include "GscMemoryLPP.hpp"
20
21 extern rtems_name Task_name[20]; /* array of task names */
19 extern rtems_name Task_name[20]; /* array of task names */
22 extern rtems_id Task_id[20]; /* array of task ids */
20 extern rtems_id Task_id[20]; /* array of task ids */
23
21
@@ -35,6 +33,8 rtems_status_code get_message_queue_id_r
35 rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id );
33 rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id );
36 rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
34 rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
37 rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id );
35 rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id );
36 void update_queue_max_count( rtems_id queue_id, unsigned char*fifo_size_max );
37 void init_ring(ring_node ring[], unsigned char nbNodes, volatile int buffer[], unsigned int bufferSize );
38 //
38 //
39 int start_recv_send_tasks( void );
39 int start_recv_send_tasks( void );
40 //
40 //
@@ -45,4 +45,10 extern ring_node *ring_node_to_send_cwf_
45 extern ring_node waveform_ring_f3[];
45 extern ring_node waveform_ring_f3[];
46 extern unsigned short sequenceCounterHK;
46 extern unsigned short sequenceCounterHK;
47
47
48 extern unsigned char hk_lfr_q_sd_fifo_size_max;
49 extern unsigned char hk_lfr_q_rv_fifo_size_max;
50 extern unsigned char hk_lfr_q_p0_fifo_size_max;
51 extern unsigned char hk_lfr_q_p1_fifo_size_max;
52 extern unsigned char hk_lfr_q_p2_fifo_size_max;
53
48 #endif // FSW_MISC_H_INCLUDED
54 #endif // FSW_MISC_H_INCLUDED
@@ -11,6 +11,7
11
11
12 #include "fsw_params.h"
12 #include "fsw_params.h"
13 #include "tc_handler.h"
13 #include "tc_handler.h"
14 #include "fsw_init.h"
14
15
15 extern spw_stats spacewire_stats;
16 extern spw_stats spacewire_stats;
16 extern spw_stats spacewire_stats_backup;
17 extern spw_stats spacewire_stats_backup;
@@ -3,6 +3,7
3
3
4 #include "fsw_processing.h"
4 #include "fsw_processing.h"
5 #include "basic_parameters.h"
5 #include "basic_parameters.h"
6 #include "fsw_init.h"
6
7
7 typedef struct {
8 typedef struct {
8 unsigned int norm_bp1;
9 unsigned int norm_bp1;
@@ -3,6 +3,7
3
3
4 #include "fsw_processing.h"
4 #include "fsw_processing.h"
5 #include "basic_parameters.h"
5 #include "basic_parameters.h"
6 #include "fsw_init.h"
6
7
7 typedef struct {
8 typedef struct {
8 unsigned int norm_bp1;
9 unsigned int norm_bp1;
@@ -3,6 +3,7
3
3
4 #include "fsw_processing.h"
4 #include "fsw_processing.h"
5 #include "basic_parameters.h"
5 #include "basic_parameters.h"
6 #include "fsw_init.h"
6
7
7 typedef struct {
8 typedef struct {
8 unsigned int norm_bp1;
9 unsigned int norm_bp1;
@@ -10,7 +10,6
10 #include <grlib_regs.h>
10 #include <grlib_regs.h>
11
11
12 #include "fsw_params.h"
12 #include "fsw_params.h"
13 #include "fsw_spacewire.h"
14
13
15 typedef struct ring_node_asm
14 typedef struct ring_node_asm
16 {
15 {
@@ -72,7 +71,7 typedef struct
72 unsigned char data[ 117 ]; // 13 bins * 9 Bytes only for TM_LFR_SCIENCE_NORMAL_BP1_F0 and F1
71 unsigned char data[ 117 ]; // 13 bins * 9 Bytes only for TM_LFR_SCIENCE_NORMAL_BP1_F0 and F1
73 } bp_packet_with_spare;
72 } bp_packet_with_spare;
74
73
75 typedef struct
74 typedef struct asm_msg
76 {
75 {
77 ring_node_asm *norm;
76 ring_node_asm *norm;
78 ring_node_asm *burst_sbm;
77 ring_node_asm *burst_sbm;
@@ -12,9 +12,6
12
12
13 #include "lfr_cpu_usage_report.h"
13 #include "lfr_cpu_usage_report.h"
14
14
15 // MODE PARAMETERS
16 extern unsigned int maxCount;
17
18 //****
15 //****
19 // ISR
16 // ISR
20 rtems_isr commutation_isr1( rtems_vector_number vector );
17 rtems_isr commutation_isr1( rtems_vector_number vector );
@@ -7,8 +7,7
7 #include <math.h>
7 #include <math.h>
8 #include <fsw_params.h>
8 #include <fsw_params.h>
9
9
10 #include "fsw_spacewire.h"
10 #include "fsw_init.h"
11 #include "fsw_misc.h"
12 #include "fsw_params_wf_handler.h"
11 #include "fsw_params_wf_handler.h"
13
12
14 #define pi 3.14159265359
13 #define pi 3.14159265359
@@ -11,7 +11,7 print str(availableBrickCount) + " Space
11
11
12 SpwPlugin0.StarDundeeSelectBrick(1)
12 SpwPlugin0.StarDundeeSelectBrick(1)
13 SpwPlugin0.StarDundeeSetBrickAsARouter(1)
13 SpwPlugin0.StarDundeeSetBrickAsARouter(1)
14 SpwPlugin0.StarDundeeSelectLinkNumber( 2 )
14 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
15 SpwPlugin0.connectBridge()
15 SpwPlugin0.connectBridge()
16
16
17 #SpwPlugin0.TCPServerSetIP("127.0.0.1")
17 #SpwPlugin0.TCPServerSetIP("127.0.0.1")
@@ -26,7 +26,6
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 unsigned int maxCount;
30 int fdSPW = 0;
29 int fdSPW = 0;
31 int fdUART = 0;
30 int fdUART = 0;
32 unsigned char lfrCurrentMode;
31 unsigned char lfrCurrentMode;
@@ -61,6 +60,12 struct param_local_str param_local;
61
60
62 // HK PACKETS
61 // HK PACKETS
63 Packet_TM_LFR_HK_t housekeeping_packet;
62 Packet_TM_LFR_HK_t housekeeping_packet;
63 // message queues occupancy
64 unsigned char hk_lfr_q_sd_fifo_size_max;
65 unsigned char hk_lfr_q_rv_fifo_size_max;
66 unsigned char hk_lfr_q_p0_fifo_size_max;
67 unsigned char hk_lfr_q_p1_fifo_size_max;
68 unsigned char hk_lfr_q_p2_fifo_size_max;
64 // sequence counters are incremented by APID (PID + CAT) and destination ID
69 // sequence counters are incremented by APID (PID + CAT) and destination ID
65 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
70 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
66 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
71 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
@@ -60,6 +60,7
60
60
61 #include "fsw_init.h"
61 #include "fsw_init.h"
62 #include "fsw_config.c"
62 #include "fsw_config.c"
63 #include "GscMemoryLPP.hpp"
63
64
64 void initCache()
65 void initCache()
65 {
66 {
@@ -812,3 +813,57 rtems_status_code get_message_queue_id_p
812
813
813 return status;
814 return status;
814 }
815 }
816
817 void update_queue_max_count( rtems_id queue_id, unsigned char*fifo_size_max )
818 {
819 u_int32_t count;
820 rtems_status_code status;
821
822 status = rtems_message_queue_get_number_pending( queue_id, &count );
823
824 count = count + 1;
825
826 if (status != RTEMS_SUCCESSFUL)
827 {
828 PRINTF1("in update_queue_max_count *** ERR = %d\n", status)
829 }
830 else
831 {
832 if (count > *fifo_size_max)
833 {
834 *fifo_size_max = count;
835 }
836 }
837 }
838
839 void init_ring(ring_node ring[], unsigned char nbNodes, volatile int buffer[], unsigned int bufferSize )
840 {
841 unsigned char i;
842
843 //***************
844 // BUFFER ADDRESS
845 for(i=0; i<nbNodes; i++)
846 {
847 ring[i].coarseTime = 0x00;
848 ring[i].fineTime = 0x00;
849 ring[i].sid = 0x00;
850 ring[i].status = 0x00;
851 ring[i].buffer_address = (int) &buffer[ i * bufferSize ];
852 }
853
854 //*****
855 // NEXT
856 ring[ nbNodes - 1 ].next = (ring_node*) &ring[ 0 ];
857 for(i=0; i<nbNodes-1; i++)
858 {
859 ring[i].next = (ring_node*) &ring[ i + 1 ];
860 }
861
862 //*********
863 // PREVIOUS
864 ring[ 0 ].previous = (ring_node*) &ring[ nbNodes - 1 ];
865 for(i=1; i<nbNodes; i++)
866 {
867 ring[i].previous = (ring_node*) &ring[ i - 1 ];
868 }
869 }
@@ -161,22 +161,6 rtems_task hous_task(rtems_task_argument