##// END OF EJS Templates
Minor changes to test VHDL 0.0.9
paul -
r86:143da496b835 nov2013
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 Nov 22 16:34:14 2013
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Dec 12 07:45:06 2013
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
@@ -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 2.8.1, 2013-11-29T10:16:14. -->
3 <!-- Written by QtCreator 2.8.1, 2013-12-12T15:59:05. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -72,7 +72,6 void set_wfp_burst_enable_register( unsi
72 void reset_wfp_run_burst_enable();
72 void reset_wfp_run_burst_enable();
73 void reset_wfp_status();
73 void reset_wfp_status();
74 void reset_new_waveform_picker_regs();
74 void reset_new_waveform_picker_regs();
75 unsigned int address_alignment( volatile int *address);
76
75
77 //*****************
76 //*****************
78 // local parameters
77 // local parameters
@@ -41,19 +41,19 gptimer_regs_t *gptimer_regs
41 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
41 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
42
42
43 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes
43 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes
44 volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET + ALIGNEMENT_OFFSET ];
44 volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
45 //
45 //
46 volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET + ALIGNEMENT_OFFSET ];
46 volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
47 volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET + ALIGNEMENT_OFFSET ];
47 volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
48 volatile int wf_snap_f1_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET + ALIGNEMENT_OFFSET ];
48 volatile int wf_snap_f1_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
49 //
49 //
50 volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET + ALIGNEMENT_OFFSET ];
50 volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
51 volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET + ALIGNEMENT_OFFSET ];
51 volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
52 volatile int wf_snap_f2_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET + ALIGNEMENT_OFFSET ];
52 volatile int wf_snap_f2_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
53 //
53 //
54 volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET + ALIGNEMENT_OFFSET ];
54 volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
55 volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET + ALIGNEMENT_OFFSET ];
55 volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
56 char wf_cont_f3_light[ NB_SAMPLES_PER_SNAPSHOT * NB_BYTES_CWF3_LIGHT_BLK + ALIGNEMENT_OFFSET ];
56 char wf_cont_f3_light[ NB_SAMPLES_PER_SNAPSHOT * NB_BYTES_CWF3_LIGHT_BLK ] __attribute__((aligned(0x100)));
57
57
58 // SPECTRAL MATRICES GLOBAL VARIABLES
58 // SPECTRAL MATRICES GLOBAL VARIABLES
59 volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ];
59 volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ];
@@ -515,6 +515,7 int enter_burst_mode()
515 int enter_sbm1_mode()
515 int enter_sbm1_mode()
516 {
516 {
517 rtems_status_code status;
517 rtems_status_code status;
518 int startDate;
518
519
519 status = restart_science_tasks();
520 status = restart_science_tasks();
520
521
@@ -525,14 +526,17 int enter_sbm1_mode()
525 #ifdef GSA
526 #ifdef GSA
526 LEON_Unmask_interrupt( IRQ_SM );
527 LEON_Unmask_interrupt( IRQ_SM );
527 #else
528 #else
529 //****************
530 // waveform picker
528 reset_new_waveform_picker_regs();
531 reset_new_waveform_picker_regs();
529 set_wfp_burst_enable_register(LFR_MODE_SBM1);
532 set_wfp_burst_enable_register( LFR_MODE_SBM1 );
530 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
533 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
531 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
534 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
532 // SM simulation
535 startDate = time_management_regs->coarse_time + 2;
533 // timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR );
536 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000]
534 // LEON_Clear_interrupt( IRQ_SM ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board
537 new_waveform_picker_regs->start_date = startDate;
535 // LEON_Unmask_interrupt( IRQ_SM );
538 //****************
539 // spectral matrix
536 #endif
540 #endif
537
541
538 return status;
542 return status;
@@ -75,28 +75,12 rtems_isr waveforms_isr( rtems_vector_nu
75 #else
75 #else
76 statusReg = new_waveform_picker_regs->status;
76 statusReg = new_waveform_picker_regs->status;
77 fullRecord = fullRecord | ( statusReg & 0x7 );
77 fullRecord = fullRecord | ( statusReg & 0x7 );
78 // if ( (new_waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full
78 if ( (new_waveform_picker_regs->status & 0x7) == 0x7 ) // f2 f1 and f0 are full
79 // if ( (new_waveform_picker_regs->status & 0x1) == 0x1 ) // f0 is full
80 if ( (new_waveform_picker_regs->status & 0x4) == 0x4 ) // f2 is full
81 {
79 {
82 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
80 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
83 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
81 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
84 }
82 }
85 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
83 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
86 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
87 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
88 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
89 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
90 // if ( (new_waveform_picker_regs->status & 0x1) == 0x1 )
91 if ( (new_waveform_picker_regs->status & 0x4) == 0x4 ) // f2 is full
92 {
93 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 );
94 }
95 // if ( (new_waveform_picker_regs->status & 0x1) == 0x0 )
96 if ( (new_waveform_picker_regs->status & 0x4) == 0x0 )
97 {
98 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_7 );
99 }
100 }
84 }
101 #endif
85 #endif
102 break;
86 break;
@@ -274,8 +258,8 rtems_task wfrm_task(rtems_task_argument
274
258
275 if (event_out == RTEMS_EVENT_MODE_NORMAL)
259 if (event_out == RTEMS_EVENT_MODE_NORMAL)
276 {
260 {
277 //send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
261 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
278 //send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
262 send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
279 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
263 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
280 #ifdef GSA
264 #ifdef GSA
281 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xf888; // [1111 1000 1000 1000] f2, f1, f0 bits =0
265 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xf888; // [1111 1000 1000 1000] f2, f1, f0 bits =0
@@ -1038,11 +1022,8 void set_wfp_burst_enable_register( unsi
1038 // the burst bits shall be set first, before the enable bits
1022 // the burst bits shall be set first, before the enable bits
1039 switch(mode) {
1023 switch(mode) {
1040 case(LFR_MODE_NORMAL):
1024 case(LFR_MODE_NORMAL):
1041 new_waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
1025 new_waveform_picker_regs->run_burst_enable = 0x80; // [1000 0000] f3 burst enable
1042 // new_waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1026 new_waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1043 // new_waveform_picker_regs->run_burst_enable = 0x07; // [0000 0111] enable f2 f1 f0
1044 // new_waveform_picker_regs->run_burst_enable = 0x01; // [0000 0001] enable f0
1045 new_waveform_picker_regs->run_burst_enable = 0x04; // [0000 0100] enable f0
1046 break;
1027 break;
1047 case(LFR_MODE_BURST):
1028 case(LFR_MODE_BURST):
1048 new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1029 new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
@@ -1115,21 +1096,12 void reset_new_waveform_picker_regs()
1115 *
1096 *
1116 */
1097 */
1117
1098
1118 unsigned int wf_snap_f0_aligned;
1119 unsigned int wf_snap_f1_aligned;
1120 unsigned int wf_snap_f2_aligned;
1121 unsigned int wf_cont_f3_aligned;
1122
1123 new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
1099 new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
1124 new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1100 new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1125 wf_snap_f0_aligned = address_alignment( wf_snap_f0 );
1101 new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08
1126 wf_snap_f1_aligned = address_alignment( wf_snap_f1 );
1102 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // 0x0c
1127 wf_snap_f2_aligned = address_alignment( wf_snap_f2 );
1103 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // 0x10
1128 wf_cont_f3_aligned = address_alignment( wf_cont_f3 );
1104 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // 0x14
1129 new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0_aligned); // 0x08
1130 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_aligned); // 0x0c
1131 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_aligned); // 0x10
1132 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_aligned); // 0x14
1133 new_waveform_picker_regs->status = 0x00; // 0x18
1105 new_waveform_picker_regs->status = 0x00; // 0x18
1134 // new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776
1106 // new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776
1135 // new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096
1107 // new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096
@@ -1145,59 +1117,6 void reset_new_waveform_picker_regs()
1145 new_waveform_picker_regs->nb_word_in_buffer = 0x1802; // 0x3c *** 2048 * 3 + 2 = 6146
1117 new_waveform_picker_regs->nb_word_in_buffer = 0x1802; // 0x3c *** 2048 * 3 + 2 = 6146
1146 }
1118 }
1147
1119
1148 void reset_new_waveform_picker_regs_alt()
1149 {
1150 /** This function resets the waveform picker module registers.
1151 *
1152 * The registers affected by this function are located at the following offset addresses:
1153 * - 0x00 data_shaping
1154 * - 0x04 run_burst_enable
1155 * - 0x08 addr_data_f0
1156 * - 0x0C addr_data_f1
1157 * - 0x10 addr_data_f2
1158 * - 0x14 addr_data_f3
1159 * - 0x18 status
1160 * - 0x1C delta_snapshot
1161 * - 0x20 delta_f0
1162 * - 0x24 delta_f0_2
1163 * - 0x28 delta_f1
1164 * - 0x2c delta_f2
1165 * - 0x30 nb_data_by_buffer
1166 * - 0x34 nb_snapshot_param
1167 * - 0x38 start_date
1168 * - 0x3c nb_word_in_buffer
1169 *
1170 */
1171
1172 unsigned int wf_snap_f0_aligned;
1173 unsigned int wf_snap_f1_aligned;
1174 unsigned int wf_snap_f2_aligned;
1175 unsigned int wf_cont_f3_aligned;
1176
1177 new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
1178 new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1179 wf_snap_f0_aligned = address_alignment( wf_snap_f0 );
1180 wf_snap_f1_aligned = address_alignment( wf_snap_f1 );
1181 wf_snap_f2_aligned = address_alignment( wf_snap_f2 );
1182 wf_cont_f3_aligned = address_alignment( wf_cont_f3 );
1183 new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0_aligned); // 0x08
1184 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_aligned); // 0x0c
1185 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_aligned); // 0x10
1186 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_aligned); // 0x14
1187 new_waveform_picker_regs->status = 0x00; // 0x18
1188 // new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776
1189 new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096
1190 new_waveform_picker_regs->delta_f0 = 0xbf5; // 0x20 *** 1013
1191 new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits]
1192 new_waveform_picker_regs->delta_f1 = 0xbc0; // 0x28 *** 960
1193 // new_waveform_picker_regs->delta_f2 = 0x12200; // 0x2c *** 74240
1194 new_waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 12 * 256 = 3072
1195 new_waveform_picker_regs->nb_data_by_buffer = 0x07; // 0x30 *** 7
1196 new_waveform_picker_regs->snapshot_param = 0x10; // 0x34 *** 16
1197 new_waveform_picker_regs->start_date = 0x00; // 0x38
1198 new_waveform_picker_regs->nb_word_in_buffer = 0x34; // 0x3c *** (3 * 8 + 2) * 2
1199 }
1200
1201 //*****************
1120 //*****************
1202 // local parameters
1121 // local parameters
1203 void set_local_sbm1_nb_cwf_max()
1122 void set_local_sbm1_nb_cwf_max()
@@ -1321,31 +1240,3 void increment_seq_counter_source_id( un
1321 *sequence_cnt = 0;
1240 *sequence_cnt = 0;
1322 }
1241 }
1323 }
1242 }
1324
1325 unsigned int address_alignment( volatile int *address)
1326 {
1327 unsigned char i;
1328 unsigned char lastByte;
1329 unsigned int addressAligned;
1330
1331 addressAligned = (unsigned int) address;
1332
1333 PRINTF1("address %x\n", addressAligned );
1334
1335 for (i=0; i<256; i++)
1336 {
1337 lastByte = (unsigned char) ( addressAligned & 0x000000ff ) ;
1338 if (lastByte == 0x00)
1339 {
1340 break;
1341 }
1342 else
1343 {
1344 addressAligned = addressAligned + 1;
1345 }
1346 }
1347
1348 PRINTF2("i = %d, address %x\n", i, (int) addressAligned);
1349
1350 return addressAligned;
1351 }
General Comments 0
You need to be logged in to leave comments. Login now