Changeset 314 for soft/giet_vm


Ignore:
Timestamp:
Apr 21, 2014, 5:48:29 AM (10 years ago)
Author:
alain
Message:

The main modif is in the Makefile: Disk image building.

Location:
soft/giet_vm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/Makefile

    r304 r314  
    1313### partition sectors    = 524832
    1414
    15 MAP_XML     ?= mappings/tsar_leti_2_2_4_sort.xml
     15MAP_XML     ?= mappings/tsar_leti_4_4_4_transpose.xml
    1616
    1717### Objects to be linked for kernel.elf
     
    153153        mcopy -o -i $(DISK_IMAGE) build/gameoflife/gameoflife.elf ::/build/gameoflife
    154154        mcopy -o -i $(DISK_IMAGE) build/dhrystone/dhrystone.elf ::/build/dhrystone
     155        mcopy -o -i $(DISK_IMAGE) transpose/images.raw ::/misc
    155156        mcopy -o -i $(DISK_IMAGE) map.bin ::/
    156157        dd if=build/boot/boot.elf of=$(DISK_IMAGE) seek=2 conv=notrunc
  • soft/giet_vm/giet_common/utils.c

    r301 r314  
    374374
    375375///////////////////////////////////////////////////////////////////////////////////
    376 // This function is used by all drivers (_xxx_set_register() function)
     376// This function is used by several drivers (_xxx_set_register() function)
    377377// If the MMU is not activated, the virtual address is extended using
    378378// X_IO and Y_IO to reach the cluster_io.
     
    422422
    423423///////////////////////////////////////////////////////////////////////////////////
    424 // Takes a lock with an ll/sc atomic access.
    425 // A pseudo random delay is introduced before retry in case of miss
    426 // (delay average value = 100 cycles)
     424// Takes a lock with a blocking ll/sc atomic access.
     425// When the cache coherence is granted by the hardware,
     426// the first read is a standard (cacheable) lw, as the local copy
     427// can be polled when the lock is already taken by another task, reducing
     428// trafic on the interconnect. When the lock is released by the owner task,
     429// the local copy is updated or invalidated by the coherence protocol.
     430// If there is no hardware cache coherence a random delay is introduced
     431// betwween two successive retry.
    427432///////////////////////////////////////////////////////////////////////////////////
    428433inline void _get_lock(unsigned int * plock)
    429434{
     435#if NO_HARD_CC
     436
    430437    register unsigned int delay = ( _get_proctime() ^ _get_procid() << 4) & 0xFF;
    431438
     
    451458            :"r"(plock), "r"(delay)
    452459            :"$2", "$3", "$4");
     460#else
     461
     462    asm volatile (
     463            "_lock_llsc:                 \n"
     464            "    lw   $2,    0(%0)       \n" /* dcache <= _ioc_lock current value    */
     465            "    bnez $2,    _lock_llsc  \n" /* retry if lock already taken          */
     466            "    nop                     \n"
     467            "    ll   $2,    0(%0)       \n" /* ll_buffer <= _ioc_lock current value */
     468            "    bnez $2,    _lock_llsc  \n" /* retry if _ioc_lock already taken     */
     469            "    li   $3,    1           \n" /* $3 <= argument for sc                */
     470            "    sc   $3,    0(%0)       \n" /* try to set _ioc_lock                 */
     471            "    beqz $3,    _lock_llsc  \n" /* retry if sc failure                  */
     472            "    nop                     \n"
     473            :
     474            :"r"(plock)
     475            :"$2", "$3");
     476#endif
     477
     478//  register unsigned int delay = ( _get_proctime() ^ _get_procid() << 4) & 0xFF;
     479
     480//  if (delay == 0) delay++;
     481
     482//  asm volatile (
     483//          "_lock_llsc:             \n"
     484//          "ll   $2,    0(%0)       \n" /* $2 <= _ioc_lock current value */
     485//          "bnez $2,    _lock_delay \n" /* delay if _ioc_lock already taken */
     486//          "li   $3,    1           \n" /* $3 <= argument for sc */
     487//          "sc   $3,    0(%0)       \n" /* try to set _ioc_lock */
     488//          "bnez $3,    _lock_ok    \n" /* exit if atomic */
     489//          "_lock_delay:            \n"
     490//          "move $4,    %1          \n" /* $4 <= delay */
     491//          "_lock_loop:             \n"
     492//          "addi $4,    $4,    -1   \n" /* $4 <= $4 - 1 */
     493//          "bnez $4,    _lock_loop  \n" /* test end delay */
     494//          "nop                     \n"
     495//          "j           _lock_llsc  \n" /* retry */
     496//          "nop                     \n"ache
     497//          "_lock_ok:               \n"
     498//          :
     499//          :"r"(plock), "r"(delay)
     500//          :"$2", "$3", "$4");
     501
    453502}
    454503
  • soft/giet_vm/giet_config.h

    r303 r314  
    2222#define BOOT_DEBUG_ELF           0          /* trace .elf files loading */
    2323
    24 #define GIET_DEBUG_INIT              0                  /* trace parallel kernel initialisation */
     24#define GIET_DEBUG_INIT              0                  /* trace kernel initialisation */
    2525#define GIET_DEBUG_FAT           0          /* trace fat accesses */
    2626#define GIET_DEBUG_SWITCH            0          /* trace context switchs  */
    2727#define GIET_DEBUG_IRQS          0              /* trace interrupts */
    2828#define GIET_DEBUG_IOC_DRIVER    0          /* trace IOC accesses */
    29 #define GIET_DEBUG_BDV_DRIVER    0          /* trace BDV accesses */
    3029#define GIET_DEBUG_TTY_DRIVER    0          /* trace TTY accesses */
    3130#define GIET_DEBUG_DMA_DRIVER    0          /* trace DMA accesses */
  • soft/giet_vm/giet_fat32/fat32.c

    r300 r314  
    10451045#if GIET_DEBUG_FAT
    10461046_printf("\n[FAT DEBUG] Boot Sector Loaded\n");
     1047display_fat_cache();
    10471048#endif
    10481049
Note: See TracChangeset for help on using the changeset viewer.