diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,4 +11,4 @@ set(LFR_BP_SRC ${CMAKE_CURRENT_SOURCE_DI SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/sparc/") add_subdirectory(src) -add_subdirectory(timegen) +#add_subdirectory(timegen) diff --git a/FSW-qt/bin/__init__.py b/FSW-qt/bin/__init__.py deleted file mode 100644 diff --git a/FSW-qt/bin/floatconversion.py b/FSW-qt/bin/floatconversion.py deleted file mode 100644 --- a/FSW-qt/bin/floatconversion.py +++ /dev/null @@ -1,83 +0,0 @@ -def ieee(f, word=32): - """Generate the binary string representing a floating-point value in IEEE754 code.""" - f = float(f) - if word not in (16, 32, 64, 128): - raise ValueError("IEEE754 is defined for 16, 32, 64 and 128 bit words.") - exp_bin = range({16:5, 32:8, 64:11, 128:15}[word]) - frac_bin = range(word - len(exp_bin) - 1) - - # Sign. - sign_bin = [int(f < 0)] - f = abs(f) - - # Find exponent (adding the bias). - bias = 2**(len(exp_bin)-1) -1 - exponent = bias - while f >= 2: - exponent += 1 - f /= 2 - while f < 1 and exponent > 0: - exponent -= 1 - f *= 2 - if not 0 <= exponent < 2*(bias+1): - raise ValueError("Exponent overflow: Absolute exponent must be smaller than %d." % (bias + 1)) - - # Encode exponent in binary. - for i in exp_bin[::-1]: - exp_bin[i] = int(exponent % 2) - exponent /= 2 - - # Remove the leading 1 bit. - f -= 1 - for i in frac_bin: - f *= 2 - frac_bin[i] = int(f >= 1) - f -= frac_bin[i] - - # Join the binary string components together. - return "".join(map(str, sign_bin + exp_bin + frac_bin)) - -def ieee_decode(binary): - """Decode a binary string representing a floating-point value in IEEE754 code.""" - - # Determine the word size of the binary. - word = len(binary) - if word not in (16, 32, 64, 128): - raise ValueError("IEEE754 is defined for 16, 32, 64 and 128 bit words.") - - # Determine the length of the exponent. - e = {16:5, 32:8, 64:11, 128:15}[word] - - # Turn the binary string into a bit-list. - binary = [int(c) for c in binary] - - # Split the components. - sign = -2 * binary[0] + 1 - exp_bin = binary[1:1+e] - frac_bin = binary[1+e:] - - # Decode the exponent. - bias = 2**(e-1) - 1 - exponent = -bias - c = 1 - for i in exp_bin[::-1]: - exponent += i * c - c *= 2 - - # Decode the fraction. - f = float(2**exponent) - power = f - for i in frac_bin: - power *= 0.5 - f += i * power - - return sign * f - -if __name__ == "__main__": - val = ieee(24.) - val - print val[:16] - print val[0], val[1], val[2] - val_in_int = int(val[:16], 2) - print val_in_int - print hex( val_in_int ) \ No newline at end of file diff --git a/FSW-qt/bin/gdb.ini b/FSW-qt/bin/gdb.ini deleted file mode 100644 --- a/FSW-qt/bin/gdb.ini +++ /dev/null @@ -1,12 +0,0 @@ -target extended-remote :3333 - -# Reset to known state -monitor reset halt -load -monitor reset init - -# Set a breakpoint at main(). -break set_apbuart_scaler_reload_register - -# Run to the breakpoint. -continue diff --git a/FSW-qt/bin/lfr_fsw.sublime-project b/FSW-qt/bin/lfr_fsw.sublime-project deleted file mode 100644 --- a/FSW-qt/bin/lfr_fsw.sublime-project +++ /dev/null @@ -1,11 +0,0 @@ -{ - "folders": - [ - { - "path": "/opt/DEV_PLE/FSW-qt/bin" - }, - { - "path": "spectralmatrix" - } - ] -} diff --git a/FSW-qt/bin/lfr_fsw.sublime-workspace b/FSW-qt/bin/lfr_fsw.sublime-workspace deleted file mode 100644 --- a/FSW-qt/bin/lfr_fsw.sublime-workspace +++ /dev/null @@ -1,282 +0,0 @@ -{ - "auto_complete": - { - "selected_items": - [ - [ - "data", - "dataInIntReorganized" - ], - [ - "index", - "indexTransformDecimationInFrequency" - ], - [ - "in", - "indexTransformDecimationInFrequency" - ], - [ - "dft", - "dft_val" - ], - [ - "butter", - "butterflyProcessor" - ], - [ - "chec", - "checkbox_sy_lfr_bw" - ], - [ - "send", - "sendLoadCommonPar" - ], - [ - "groupbo", - "groupbox_tc_lfr_load_common_par" - ], - [ - "l", - "layout_tc" - ], - [ - "button", - "button_tc_lfr_load_common_par" - ], - [ - "a", - "addWidget" - ], - [ - "group", - "groupbox_tc_lfr_load_common_par" - ], - [ - "c", - "common" - ], - [ - "laben", - "label_UNKNOWN_nb" - ], - [ - "UN", - "UNKNOWN_nb" - ] - ] - }, - "buffers": - [ - { - "file": "spectralmatrix/readmatrix.py", - "settings": - { - "buffer_size": 1115, - "line_ending": "Unix" - } - } - ], - "build_system": "", - "command_palette": - { - "height": 392.0, - "selected_items": - [ - ], - "width": 392.0 - }, - "console": - { - "height": 0.0 - }, - "distraction_free": - { - "menu_visible": true, - "show_minimap": false, - "show_open_files": false, - "show_tabs": false, - "side_bar_visible": false, - "status_bar_visible": false - }, - "file_history": - [ - "/opt/DEV_PLE/FSW-qt/bin/spectralmatrix/asm_f0_test_20140403_case1.txt", - "/opt/DEV_PLE/FSW-qt/bin/spectralmatrix/asm_f0_test_paul_1.txt", - "/opt/DEV_PLE/FSW-qt/bin/load_spectral_matrix.py", - "/opt/DEV_PLE/FSW-qt/bin/floatconversion.py", - "/opt/VALIDATION/waveform_analysis/main_sbm2.py", - "/opt/VALIDATION/waveform_analysis/main_cwf_f1.py", - "/opt/VALIDATION/waveform_analysis/main_cwf_f3.py", - "/opt/VALIDATION/waveform_analysis/main_cwf_f2.py", - "/opt/VALIDATION/waveform_analysis/main_128.py", - "/opt/VALIDATION/waveform_analysis/main_64.py", - "/opt/LFR_EMULATOR/SRC/testing_FFT.py", - "/opt/LFR_EMULATOR/main.py", - "/opt/LFR_EMULATOR/fft_8_decimation_in_frequency.py", - "/opt/LFR_EMULATOR/index_transform_decimation_in_frequency.py", - "/opt/LFR_EMULATOR/efficient_complex_multiplier.py", - "/opt/LFR_EMULATOR/butterfly_processor.py", - "/opt/LFR_EMULATOR/twiddle_factors.py", - "/opt/LFR_EMULATOR/SRC/filters.py", - "/opt/LFR_EMULATOR/SRC/test_cases1.py", - "/opt/VALIDATION/lfrverif/LFR_SVS/SVS-0001/Step02/UploadDumpMemory.py", - "/opt/VALIDATION/lfrverif/LFR_SVS/SVS-0001/Step02/UploadDumpMemory (copy).py", - "/opt/VALIDATION/lfrverif/LFR_SVS/SVS-0001/Step01/grspw_registers.py", - "/opt/VALIDATION/lfrverif/LFR_SVS/SVS-0002/tc_during_matrix_transmission.py", - "/opt/VALIDATION/lfrverif/common/actions_tc_lfr_launcher.py", - "/opt/VALIDATION/lfrverif/common/test_monitor.py", - "/opt/VALIDATION/validation.sublime-workspace", - "/opt/VALIDATION/validation.sublime-project", - "/opt/PYTHON/lfrverif/test1/test1main.py", - "/opt/PYTHON/lfrverif/test1/test1launcher.py", - "/opt/PYTHON/lfrverif/common/crcforlfr.py", - "/opt/PYTHON/lfrverif/common/tcparams.py", - "/opt/PYTHON/lfrverif/test1/testgui.py", - "/opt/PYTHON/lfrverif/test1/tcmonitor.py", - "/opt/PYTHON/lfrverif/test1/lppmoncfg.py", - "/opt/PYTHON/lfrverif/test1/wfdisplay.py", - "/opt/PYTHON/lfrverif/test1/lppmonplot.py", - "/opt/PYTHON/lfrverif/test1/tmmonitor.py" - ], - "find": - { - "height": 34.0 - }, - "find_in_files": - { - "height": 0.0, - "where_history": - [ - "/opt/VALIDATION/lfrverif", - "/opt/VALIDATION/lfrverif/LFR_SVS" - ] - }, - "find_state": - { - "case_sensitive": false, - "find_history": - [ - "snapshots", - "def displayInfoSendTc", - "dump", - "tc_lfr_dump_par", - "processpac", - "WriteSPWDelay", - "sendPacket", - "sendLoadCommonPar" - ], - "highlight": true, - "in_selection": false, - "preserve_case": false, - "regex": false, - "replace_history": - [ - ], - "reverse": false, - "show_context": true, - "use_buffer2": true, - "whole_word": false, - "wrap": true - }, - "groups": - [ - { - "selected": 0, - "sheets": - [ - { - "buffer": 0, - "file": "spectralmatrix/readmatrix.py", - "settings": - { - "buffer_size": 1115, - "regions": - { - }, - "selection": - [ - [ - 208, - 208 - ] - ], - "settings": - { - "syntax": "Packages/Python/Python.tmLanguage" - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "type": "text" - } - ] - } - ], - "incremental_find": - { - "height": 0.0 - }, - "input": - { - "height": 0.0 - }, - "layout": - { - "cells": - [ - [ - 0, - 0, - 1, - 1 - ] - ], - "cols": - [ - 0.0, - 1.0 - ], - "rows": - [ - 0.0, - 1.0 - ] - }, - "menu_visible": true, - "output.exec": - { - "height": 257.0 - }, - "replace": - { - "height": 0.0 - }, - "save_all_on_build": true, - "select_file": - { - "height": 0.0, - "selected_items": - [ - ], - "width": 0.0 - }, - "select_project": - { - "height": 500.0, - "selected_items": - [ - [ - "", - "/opt/VALIDATION/waveform_analysis/wfmr_plots.sublime-project" - ] - ], - "width": 380.0 - }, - "show_minimap": true, - "show_open_files": false, - "show_tabs": true, - "side_bar_visible": true, - "side_bar_width": 255.0, - "status_bar_visible": true -} diff --git a/FSW-qt/bin/loadPlugin.py b/FSW-qt/bin/loadPlugin.py deleted file mode 100644 --- a/FSW-qt/bin/loadPlugin.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 *-* - -# setting up LPPMON plugins -from __main__ import proxy -if not(proxy.instanceExists("RMAPPlugin0")): - proxy.loadSysDriver("RMAPPlugin", "RMAPPlugin0") - proxy.loadSysDriverToParent("dsu3plugin", "RMAPPlugin0") - - dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw") - dsu3plugin0.loadFile() - dsu3plugin0.run() - -from __main__ import RMAPPlugin0 - diff --git a/FSW-qt/bin/load_spectral_matrix.py b/FSW-qt/bin/load_spectral_matrix.py deleted file mode 100644 --- a/FSW-qt/bin/load_spectral_matrix.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/lppmon -e - -address_to_read = 0x80000f08 -val = RMAPPlugin0.Read( address_to_read, 1) -matrixF0_Address0 = val[0] -print hex(matrixF0_Address0) - -# BUILD THE DATA -dataToWrite = [] -dataToWrite.append( 0x1234abcd ) -dataToWrite.append( 0x4321dcba ) - -for component in range(25): - for frequencyBin in range (64): - dataToWrite.append( component + frequencyBin ) - for frequencyBin in range (64): - dataToWrite.append( - (component + frequencyBin) ) - -# WRITE THE DATA -print len(dataToWrite) -RMAPPlugin0.Write( matrixF0_Address0, dataToWrite ) diff --git a/FSW-qt/bin/load_spectral_matrix_TCH.py b/FSW-qt/bin/load_spectral_matrix_TCH.py deleted file mode 100644 --- a/FSW-qt/bin/load_spectral_matrix_TCH.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/lppmon -e - -#################### -## BUILD THE DATA ## -#################### - -with open('/opt/DEV_PLE/FSW-qt/bin/spectralmatrix/asm_f0_test_20140403_case2.txt', 'r') as f: - listOfLines = [] - for line in f.readlines(): - listOfLines.append(line) - -data = listOfLines[10] # line 10 contains the data -data = data.split() # get the data from the global string - -dataInFloat = [] -nbData = len(data) -print "nbData = " + str(nbData) -for i in range( nbData ): - dataInFloat.append( float( data[i] ) ) # convert each string into a float - -# reorganize the data to have a matrix in the VHDL format -# INPUT (ICD format) -# matrix_0[0 .. 24] matrix_1[0 .. 24] .. matrix_127[0 .. 24] -# OUTPUT (VHDL format) -# component_0[0 .. 127] component_1[0 .. 127] .. component_24[0 .. 127] - -dataInFloatReorganized = [] -dataInIntReorganized = [] -nbComponentsByMatrix = 25 -nbFrequencyBins = 128 -for indexComponent in range(nbComponentsByMatrix): - for frequencyBin in range(nbFrequencyBins): - dataInFloatReorganized.append( - dataInFloat[ indexComponent + frequencyBin * nbComponentsByMatrix ] - ) - dataInIntReorganized.append( - int( dataInFloat[ indexComponent + frequencyBin * nbComponentsByMatrix ] ) - ) - -#################### -## WRITE THE DATA ## -#################### - -# F0 buffer address -address_to_read = 0x80000f08 -val = RMAPPlugin0.Read( address_to_read, 1) -matrixF0_Address0 = val[0] - -# F1 buffer address -address_to_read = 0x80000f10 -val = RMAPPlugin0.Read( address_to_read, 1) -matrixF1_Address = val[0] - -# F2 buffer address -address_to_read = 0x80000f14 -val = RMAPPlugin0.Read( address_to_read, 1) -matrixF2_Address = val[0] - -print str( len(dataInIntReorganized) ) + " data to write" -RMAPPlugin0.Write( matrixF0_Address0, dataInIntReorganized ) -print str( len(dataInIntReorganized) ) + " data written @" + hex(matrixF0_Address0) -RMAPPlugin0.Write( matrixF1_Address, dataInIntReorganized ) -print str( len(dataInIntReorganized) ) + " data written @" + hex(matrixF1_Address) -RMAPPlugin0.Write( matrixF2_Address, dataInIntReorganized ) -print str( len(dataInIntReorganized) ) + " data written @" + hex(matrixF2_Address) - - - - - - - diff --git a/FSW-qt/bin/load_spectral_matrix_sinus.py b/FSW-qt/bin/load_spectral_matrix_sinus.py deleted file mode 100644 --- a/FSW-qt/bin/load_spectral_matrix_sinus.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/lppmon -e -import math - -address_to_read = 0x80000f08 -val = RMAPPlugin0.Read( address_to_read, 1) -matrixF0_Address0 = val[0] -print hex(matrixF0_Address0) - -teta = [] -for i in range(128): - teta.append( i * 2 * math.pi / 128 ) -amplitude = 10000 - -# BUILD THE DATA -dataToWrite = [] -for frequencyBin in range(128): - for component in range (25): - dataToWrite.append( amplitude * math.sin( teta[frequencyBin] * component ) ) - -# WRITE THE DATA -print len(dataToWrite) -RMAPPlugin0.Write( matrixF0_Address0, dataToWrite ) diff --git a/FSW-qt/bin/spectralmatrix/__init__.py b/FSW-qt/bin/spectralmatrix/__init__.py deleted file mode 100644 diff --git a/FSW-qt/bin/spectralmatrix/readmatrix.py b/FSW-qt/bin/spectralmatrix/readmatrix.py deleted file mode 100644 --- a/FSW-qt/bin/spectralmatrix/readmatrix.py +++ /dev/null @@ -1,34 +0,0 @@ -with open('asm_f0_test_paul_1.txt', 'r') as f: - listOfLines = [] - for line in f.readlines(): - listOfLines.append(line) - -data = listOfLines[10] # line 9 contains the data -data = data.split() # get the data from the global string - -dataInFloat = [] -nbData = len(data) -print "nbData = " + str(nbData) -for i in range( nbData ): - dataInFloat.append( float( data[i] ) ) # convert each string into a float - -# reorganize the data to have a matrix in the VHDL format -# input format (ICD format) -# matrix_0[0 .. 24] matrix_1[0 .. 24] .. matrix_127[0 .. 127] -# output format (VHDL format) -# component_0[0 .. 127] component_1[0 .. 127] .. component_24[0 .. 127] - -dataInFloatReorganized = [] -dataInIntReorganized = [] -nbComponentsByMatrix = 25 -nbFrequencyBins = 128 -for indexComponent in range(nbComponentsByMatrix): - for frequencyBin in range(nbFrequencyBins): - dataInFloatReorganized.append( - dataInFloat[ indexComponent + frequencyBin * nbComponentsByMatrix ] - ) - dataInIntReorganized.append( - int( dataInFloat[ indexComponent + frequencyBin * nbComponentsByMatrix ] ) - ) - -print dataInIntReorganized diff --git a/header/GscMemoryLPP.hpp b/header/GscMemoryLPP.hpp --- a/header/GscMemoryLPP.hpp +++ b/header/GscMemoryLPP.hpp @@ -213,7 +213,7 @@ static void faultTolerantScheme() } else { - PRINTF("in faultTolerantScheme *** not a Leon3FT not detected\n"); + PRINTF("in faultTolerantScheme *** Leon3FT not detected\n"); PRINTF2(" *** vendorID = 0x%x, deviceId = 0x%x\n", vendorId, deviceId); } } diff --git a/python_scripts/00_LFRControlPlugin_reload_fsw.py b/python_scripts/00_LFRControlPlugin_reload_fsw.py --- a/python_scripts/00_LFRControlPlugin_reload_fsw.py +++ b/python_scripts/00_LFRControlPlugin_reload_fsw.py @@ -1,7 +1,7 @@ # LOAD FSW USING LINK 1 SpwPlugin0.StarDundeeSelectLinkNumber( 1 ) -dsu3plugin0.openFile("/home/pleroy/DEV/DEV_PLE/FSW-qt/bin/fsw") +dsu3plugin0.openFile("/home/pleroy/DEV/DEV_PLE/build-DEV_PLE-Desktop-Default/src/fsw") #dsu3plugin0.openFile("/opt/LFR/LFR-FSW/2.0.2.3/fsw") dsu3plugin0.loadFile() diff --git a/sparc/sparc-rtems.cmake b/sparc/sparc-rtems.cmake --- a/sparc/sparc-rtems.cmake +++ b/sparc/sparc-rtems.cmake @@ -4,5 +4,6 @@ set(CMAKE_C_COMPILER /opt/rtems-4.10/bin set(CMAKE_CXX_COMPILER /opt/rtems-4.10/bin/sparc-rtems-g++) set(CMAKE_LINKER /opt/rtems-4.10/bin/sparc-rtems-g++) SET(CMAKE_EXE_LINKER_FLAGS "-static") +set(CMAKE_C_FLAGS_RELEASE "-O3") set(CMAKE_C_LINK_EXECUTABLE " -o ") include_directories("/opt/rtems-4.10/sparc-rtems/leon3/lib/include") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 2.6) -project (FSW) +project (fsw) include(sparc-rtems) @@ -102,4 +102,4 @@ add_definitions(-DSW_VERSION_N2=${SW_VER add_definitions(-DSW_VERSION_N3=${SW_VERSION_N3}) add_definitions(-DSW_VERSION_N4=${SW_VERSION_N4}) -add_executable(FSW ${SOURCES}) +add_executable(fsw ${SOURCES}) diff --git a/src/fsw_init.c b/src/fsw_init.c --- a/src/fsw_init.c +++ b/src/fsw_init.c @@ -314,7 +314,6 @@ void init_local_mode_parameters( void ) BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max) BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max) - BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX) // init sequence counters diff --git a/src/tc_load_dump_parameters.c b/src/tc_load_dump_parameters.c --- a/src/tc_load_dump_parameters.c +++ b/src/tc_load_dump_parameters.c @@ -1390,9 +1390,9 @@ void floatToChar( float value, unsigned valuePtr = (unsigned char*) &value; ptr[0] = valuePtr[0]; - ptr[1] = valuePtr[0]; - ptr[2] = valuePtr[0]; - ptr[3] = valuePtr[0]; + ptr[1] = valuePtr[1]; + ptr[2] = valuePtr[2]; + ptr[3] = valuePtr[3]; } //**********