Index by title
HOWTO recompile RTEMS sources¶
- Télécharger RTEMS sur le site Gaisler.
- Télécharger les sources de RTEMS sur le site Gaisler.
- Copier les sources dans le répertoire src de RTEMS.
HOWTO configure sparc-rtems-gcc¶
Télécharger l'archive sparc-rtems-4.10-gcc sur le site de Gaisler (http://www.gaisler.com/anonftp/rcc/bin/linux/)
sparc-rtems-4.10-gcc-4.4.6-1.2.18-linux.tar.bz2
Décompresser l'archive dans le répertoire /opt
Ajouter le path vers le répertoire contenant sparc-rtems-gcc dans le fichier .bash_profile contenu dans le répertoire HOME de l'utilisateur: /opt/rtems-4.10/bin
Quelques étapes complémentaires sont nécessaires pour le bon fonctionnement du compilateur. En effet, les bibliothèques appelées par sparc-rtems-gcc ne sont pas les dernières versions disponibles dans les paquets fedora officiels. Il faut donc procéder:
- soit par installation de paquets -comp, ou d'anciens paquets contenant les bibliothèques
- soit en créant des liens symboliques avec des noms appropriés et les faire pointer vers les versions récentes des bibliothèques
Il semblerait qu'il ne faille plus installer Qt4, notamment le paquet qt-devel pour que la configuration sparc-rtems-gcc/Qt fonctionne correctement.
Il faut installer la glibc en 32 bits pour que sparc-rtems-fonctionne.
Le dépôt DEV_PLE ayant été cloné, ouvrir le projet fsw-qt.pro et tenter une compilation. Relever les erreurs qui ne manqueront pas de survenir et appliquer selon les besoins les actions suivantes:
libmpfr.so.1 => installer le paquet libmpc en 32 bits
Dans le répertoire /usr/bin, créer les liens suivants:
ln -s libmpfr.so.4 libmpfr.so.1 (réclamé par sparc-rtems-gcc)
libgmp.so.1 => installer le paquet libgmp en 32 bits
Dans le répertoire /usr/bin, créer les liens suivants:
ln -s libgmp.so.10 libgmp.so.3 (réclamé par spar-rtems-gcc)
libz.so.1 => installer le paquet libz en 32 bits (sous Fedora 23, ça suffit à résoudre le problème de dépendance de sparc-rtems)
Une fois tout ceci effectué, la compilation du projet fsw-qt.pro doit fonctionner sans erreur ni warning.
HOWTO GCOV for LFR¶
L'ensemble des fichiers ci-dessous permet de mettre en oeuvre l'outil de mesure de couverture de code. Le fichier HOWTO est à lire en priorité, il décrit la procédure pour installer et configurer les outils.
HOWTO recompile RTEMS sources¶
- Télécharger RTEMS sur le site Gaisler et installer le compilateur (se référer à HOWTO configure sparc-rtems-gcc)
- Télécharger les sources de RTEMS sur le site Gaisler: http://www.gaisler.com/anonftp/rcc/src/, fichier rtems-4.10-1.2.18-src.tar.bz2
- Copier les sources dans le répertoire src de RTEMS, qui doit normalement se trouver dans /opt/rtems-4.10/src
- Editer le fichier grspw.c situé dans le répertoire /opt/rtems-4.10/src/rtems-4.10/c/src/lib/libbsp/sparc/shared/spw et commenter la ligne grspw_hw_reset(pDev); située dans la fonction grspw_open
- se placer dans le répertoire /opt/rtems-4.10/src et exécuter la suite de commandes suivante
- make bootstrap
- make bootstrap_sparc
- make configure-drvmgr
- make compile-drvmgr
- make install-drvmgr
Les fichiers mis à jour à l'issue de la compilation sont les suivants:
src/build-drvmgr/sparc-rtems/c/leon3/lib/libbsp.a
/opt/rtems-4.10/sparc-rtems/leon3/lib
Leon3/FT fault tolerance¶
The explanations hereafter are extracted from the Gaisler IP cores user's manual (grip.pdf).
There are two aspects in the fault tolerance: register file protection and cache protection. Each aspect is managed using a specific register:
- Cache protection is managed with the CCR (Cache Control Register) located in ASI 2, offet 0x00
- Register file protection is managed with the ASR16, Register protection control register
ASI 2 contains a few control registers that have not been assigned as ancillary state registers. These should only be read and written using 32-bit LDA/STA instructions. All cache registers are accessed through load/store operations to the alternate address space (LDA/STA), using ASI = 2. Here are the register addresses:
- 0x00 Cache control register
- 0x04 Reserved
- 0x08 Instruction cache configuration register
- 0x0C Data cache configuration register
The ASR16 can be read using the DSU3 IP core, it is located at the following address: 0x90000000 (DSU3) + 0x400040.
Cache Control Register (ASI 2, offset 0x00)¶
The cache control register located at ASI 0x2, offset 0, and contains control and status registers for the I and D cache.
Default values:
- 20:19 FT scheme (FT) - “01” => 4-bit checking implemented
Cache control register:
- 31:30 Reserved for future implementations
- 29 Register file test select (RFT). If set, will allow the read-out of IU register file checkbits via ASI 0x0F. Only available if fault-tolerance is enabled (FT field in this register is non-zero).
- 28 Parity Select (PS) - if set diagnostic read will return 4 check bits in the lsb bits, otherwise tag or data word is returned. Only available if fault-tolerance is enabled (FT field in this register is non-zero).
- 27:24 Test Bits (TB) - if set, check bits will be xored with test bits TB during diagnostic write. Only available if fault-tolerance is enabled (FT field in this register is non-zero).
- 23 Data cache snoop enable (DS) - if set, will enable data cache snooping.
- 22 Flush data cache (FD). If set, will flush the instruction cache. Always reads as zero.
- 21 Flush Instruction cache (FI). If set, will flush the instruction cache. Always reads as zero.
- 20:19 FT scheme (FT) - “00” = no FT, “01” = 4-bit checking implemented
- 18 Reserved for future implementations
- 17 Separate snoop tags (ST). This read-only bit is set if separate snoop tags are implemented.
- 16 Instruction burst fetch (IB). This bit enables burst fill during instruction fetch.
- 15 Instruction cache flush pending (IP). This bit is set when an instruction cache flush operation is in progress
- 14 Data cache flush pending (DP). This bit is set when an data cache flush operation is in progress.
- 13:12 Instruction Tag Errors (ITE) - Number of detected parity errors in the instruction tag cache. Only available if fault-tolerance is enabled (FT field in this register is non-zero).
- 11:10 Instruction Data Errors (IDE) - Number of detected parity errors in the instruction data cache. Only available if fault-tolerance is enabled (FT field in this register is non-zero).
- 9:8 Data Tag Errors (DTE) - Number of detected parity errors in the data tag cache. Only available if fault-tolerance is enabled (FT field in this register is non-zero).
- 7:6 Data Data Errors (DDE) - Number of detected parity errors in the data data cache. Only available iffault-tolerance is enabled (FT field in this register is non-zero).
- 5 Data Cache Freeze on Interrupt (DF) - If set, the data cache will automatically be frozen when an asynchronous interrupt is taken.
- 4 Instruction Cache Freeze on Interrupt (IF) - If set, the instruction cache will automatically be frozen when an asynchronous interrupt is taken.
- 3:2 Data Cache state (DCS) - Indicates the current data cache state according to the following: X0 = disabled, 01 = frozen, 11 = enabled.
- 1:0 Instruction Cache state (ICS) - Indicates the current data cache state according to the following: X0 = disabled, 01 = frozen, 11 = enabled.
Register protection control register (ASR16, @0x90400040)¶
ASR register 16 (%asr16) is used to control the IU/FPU register file SEU protection. It is possible to disable the SEU protection by setting the IDI/FDI bits, and to inject errors using the ITE/FTE bits.
Corrected errors in the register file are counted, and available in ICNT and FCNT fields. The counters saturate at their maximum value (7), and should be reset by software after read-out.
Default values:
- 31:30 FP FT ID = 01 = 1 => 4-bit parity with restart (OK for GRFPU-light, not for GRFPU)
- 15:14 IU FT ID = 10 = 2 => 8-bit parity without restart
- all other bits are set to 0
Register protection control register:
- 31:30 FP FT ID - Defines which SEU protection is implemented in the FPU (see table 1123)
- 29:27 FP RF error counter - Number of detected parity errors in the FP register file.
- 26:18 Reserved for future implementations
- 17 FPU RF Test Enable - Enables FPU register file test mode. Parity bits are xored with TB before written to the FPU register file.
- 16 FP RF protection disable (FDI) - Disables FP RF parity protection when set.
- 15:14 IU FT ID - Defines which SEU protection is implemented in the IU (see table 1123)
- 13:11 IU RF error counter - Number of detected parity errors in the IU register file.
- 10:3 RF Test bits (RFTB) - In test mode, these bits are xored with correct parity bits before written to the register file.
- 2 DP ram select (DP) - Only applicable if the IU or FPU register files consists of two dual-port rams.
- 1 IU RF Test Enable - Enables register file test mode. Parity bits are xored with TB before written to the register file.
- 0 IU RF protection disable (IDI) - Disables IU RF parity protection when set.
*ASI = Address Space Identifier
*ASR = Ancillary State Register
HOWTO configure sparc-rtems-gcc
Description des étapes à suivre pour configurer le compilateur RTEMS permettant de recompiler le logiciel de vol à partir des sources disponibles sur le dépôt suivant:
https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/SOLO_LFR/DEV_PLE
Le dépôt précédent est lié aux dépôts suivants:
https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/USERS/CHUST/LFR_basic-parameters
https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/SOLO_LFR/lfr_common_headers
HOWTO recompile RTEMS sources
Avant de compiler le logiciel de vol LFR pour la première fois sur une machine de développement, il est nécessaire de recompiler RTEMS et surtout le driver SpaceWire fourni par Gaisler après avoir modifié une ligne de code dans la fonction grspw_open du module grspw.c contenu dans les sources. Si cette ligne de code n'est pas supprimée, une erreur est générée côté DPU au démarrage du logiciel de vol LFR (déconnexion/reconnexion du lien SpaceWire).
HOWTO GCOV_for LFR
Leon3FT_fault_tolerance