##// END OF EJS Templates
The HK packet contains v, e1 and e2 valid data at f3....
paul -
r129:85c441b3b744 VHDLib206
parent child
Show More
@@ -1,6 +1,6
1 #############################################################################
1 #############################################################################
2 # Makefile for building: bin/fsw
2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Fri May 2 15:40:46 2014
3 # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue May 6 08:24:43 2014
4 # Project: fsw-qt.pro
4 # Project: fsw-qt.pro
5 # Template: app
5 # Template: app
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
@@ -10,7 +10,7
10
10
11 CC = sparc-rtems-gcc
11 CC = sparc-rtems-gcc
12 CXX = sparc-rtems-g++
12 CXX = sparc-rtems-g++
13 DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=6 -DPRINT_MESSAGES_ON_CONSOLE
13 DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=7 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../header/processing -I../src/basic_parameters
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../header/processing -I../src/basic_parameters
@@ -1,7 +1,7
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 CONFIG += console verbose
4 CONFIG += console verbose cpu_usage_report
5 CONFIG -= qt
5 CONFIG -= qt
6
6
7 include(./sparc.pri)
7 include(./sparc.pri)
@@ -11,7 +11,7 SWVERSION=-1-0
11 DEFINES += SW_VERSION_N1=1 # major
11 DEFINES += SW_VERSION_N1=1 # major
12 DEFINES += SW_VERSION_N2=0 # minor
12 DEFINES += SW_VERSION_N2=0 # minor
13 DEFINES += SW_VERSION_N3=0 # patch
13 DEFINES += SW_VERSION_N3=0 # patch
14 DEFINES += SW_VERSION_N4=6 # internal
14 DEFINES += SW_VERSION_N4=7 # internal
15
15
16 contains( CONFIG, debug_tch ) {
16 contains( CONFIG, debug_tch ) {
17 DEFINES += DEBUG_TCH
17 DEFINES += DEBUG_TCH
@@ -1,6 +1,6
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 3.0.1, 2014-05-02T15:40:56. -->
3 <!-- Written by QtCreator 3.0.1, 2014-05-06T09:36:02. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -36,6 +36,7 void increment_seq_counter( unsigned cha
36 void getTime( unsigned char *time);
36 void getTime( unsigned char *time);
37 unsigned long long int getTimeAsUnsignedLongLongInt( );
37 unsigned long long int getTimeAsUnsignedLongLongInt( );
38 void send_dumb_hk( void );
38 void send_dumb_hk( void );
39 void get_v_e1_e2_f3 (unsigned char *v, unsigned char *e1, unsigned char *e2, bool init_buffer_addr );
39
40
40 extern int sched_yield( void );
41 extern int sched_yield( void );
41
42
@@ -321,7 +321,7 int create_all_tasks( void ) // create a
321 {
321 {
322 status = rtems_task_create(
322 status = rtems_task_create(
323 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
323 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
324 RTEMS_DEFAULT_MODES,
324 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
325 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
325 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
326 );
326 );
327 }
327 }
@@ -221,6 +221,10 rtems_task hous_task(rtems_task_argument
221
221
222 spacewire_update_statistics();
222 spacewire_update_statistics();
223
223
224 get_v_e1_e2_f3(
225 housekeeping_packet.hk_lfr_sc_v_f3, housekeeping_packet.hk_lfr_sc_e1_f3, housekeeping_packet.hk_lfr_sc_e2_f3,
226 false );
227
224 // SEND PACKET
228 // SEND PACKET
225 status = rtems_message_queue_urgent( queue_id, &housekeeping_packet,
229 status = rtems_message_queue_urgent( queue_id, &housekeeping_packet,
226 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
230 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
@@ -255,7 +259,7 rtems_task dumb_task( rtems_task_argumen
255
259
256 char *DumbMessages[10] = {"in DUMB *** default", // RTEMS_EVENT_0
260 char *DumbMessages[10] = {"in DUMB *** default", // RTEMS_EVENT_0
257 "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1
261 "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1
258 "in DUMB *** waveforms_isr", // RTEMS_EVENT_2
262 "in DUMB *** f3 buffer changed", // RTEMS_EVENT_2
259 "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3
263 "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3
260 "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4
264 "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4
261 "in DUMB *** waveforms_simulator_isr", // RTEMS_EVENT_5
265 "in DUMB *** waveforms_simulator_isr", // RTEMS_EVENT_5
@@ -432,3 +436,66 void send_dumb_hk( void )
432 rtems_message_queue_urgent( queue_id, &dummy_hk_packet,
436 rtems_message_queue_urgent( queue_id, &dummy_hk_packet,
433 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
437 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
434 }
438 }
439
440 void get_v_e1_e2_f3( unsigned char *v, unsigned char *e1, unsigned char *e2, bool init_buffer_addr )
441 {
442 static int *current_addr_data_f3 = NULL;
443 int *new_addr_data_f3;
444 unsigned char *ptr;
445
446 static unsigned int counter = 0;
447 unsigned int offset_in_samples;
448 unsigned int offset_in_words;
449 unsigned char delta = 16; // v, e1 and e2 will be picked up each second, f3 = 16 Hz
450
451 new_addr_data_f3 = (int *) waveform_picker_regs->addr_data_f3;
452
453 if (init_buffer_addr == true) // when the waveform_picker is launched
454 {
455 current_addr_data_f3 = NULL;
456 }
457 else
458 {
459 if (lfrCurrentMode == LFR_MODE_STANDBY)
460 {
461 v[0] = 0x00;
462 v[1] = 0x00;
463 e1[0] = 0x00;
464 e1[1] = 0x00;
465 e2[0] = 0x00;
466 e2[1] = 0x00;
467 }
468 else
469 {
470 if ( new_addr_data_f3 != current_addr_data_f3 )
471 {
472 counter = 0;
473 offset_in_samples = 0;
474 current_addr_data_f3 = new_addr_data_f3;
475 }
476 else
477 {
478 counter = counter + 1;
479 offset_in_samples = counter * delta;
480 if ( offset_in_samples > NB_SAMPLES_PER_SNAPSHOT )
481 {
482 offset_in_samples = NB_SAMPLES_PER_SNAPSHOT -1;
483 PRINTF1("ERR *** in get_v_e1_e2_f3 *** trying to read out the buffer, counter = %d\n", counter)
484 }
485 }
486 offset_in_words = TIME_OFFSET + offset_in_samples * NB_WORDS_SWF_BLK;
487 ptr = (unsigned char*) &current_addr_data_f3[ offset_in_words ];
488 v[0] = ptr[0];
489 v[1] = ptr[1];
490 e1[0] = ptr[2];
491 e1[1] = ptr[3];
492 e2[0] = ptr[4];
493 e2[1] = ptr[5];
494 }
495 }
496 }
497
498
499
500
501
@@ -751,6 +751,7 void launch_waveform_picker( unsigned ch
751 reset_current_ring_nodes();
751 reset_current_ring_nodes();
752 reset_waveform_picker_regs();
752 reset_waveform_picker_regs();
753 set_wfp_burst_enable_register( mode );
753 set_wfp_burst_enable_register( mode );
754 get_v_e1_e2_f3( NULL, NULL, NULL, true );
754
755
755 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
756 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
756 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
757 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
@@ -66,7 +66,7 rtems_isr waveforms_isr( rtems_vector_nu
66
66
67 rtems_status_code status;
67 rtems_status_code status;
68
68
69 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
69 if ( (lfrCurrentMode == LFR_MODE_NORMAL) || (lfrCurrentMode == LFR_MODE_BURST) // in BURST the data are used to place v, e1 and e2 in the HK packet
70 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
70 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
71 { // in modes other than STANDBY and BURST, send the CWF_F3 data
71 { // in modes other than STANDBY and BURST, send the CWF_F3 data
72 if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
72 if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
@@ -282,35 +282,43 rtems_task cwf3_task(rtems_task_argument
282 // wait for an RTEMS_EVENT
282 // wait for an RTEMS_EVENT
283 rtems_event_receive( RTEMS_EVENT_0,
283 rtems_event_receive( RTEMS_EVENT_0,
284 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
284 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
285 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
285 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
286 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode==LFR_MODE_SBM2) )
286 {
287 {
287 PRINTF("send CWF_LONG_F3\n")
288 }
289 else
290 {
291 PRINTF("send CWF_F3 (light)\n")
292 }
293 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
294 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
288 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
295 {
289 {
296 send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
290 PRINTF("send CWF_LONG_F3\n")
297 }
291 }
298 else
292 else
299 {
293 {
300 send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id );
294 PRINTF("send CWF_F3 (light)\n")
295 }
296 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
297 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
298 {
299 send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
300 }
301 else
302 {
303 send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id );
304 }
305 }
306 else
307 {
308 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
309 {
310 send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
311 }
312 else
313 {
314 send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id );
315 }
316
301 }
317 }
302 }
318 }
303 else
319 else
304 {
320 {
305 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
321 PRINTF1("in CWF3 *** lfrCurrentMode is %d, no data will be sent\n", lfrCurrentMode)
306 {
307 send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
308 }
309 else
310 {
311 send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id );
312 }
313
314 }
322 }
315 }
323 }
316 }
324 }
@@ -1205,7 +1213,8 void set_wfp_burst_enable_register( unsi
1205 break;
1213 break;
1206 case(LFR_MODE_BURST):
1214 case(LFR_MODE_BURST):
1207 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1215 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1208 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1216 // waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1217 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x06; // [0110] enable f3 AND f2
1209 break;
1218 break;
1210 case(LFR_MODE_SBM1):
1219 case(LFR_MODE_SBM1):
1211 waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
1220 waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
General Comments 0
You need to be logged in to leave comments. Login now