Changeset 333 for soft/giet_vm


Ignore:
Timestamp:
Jun 19, 2014, 1:31:45 PM (11 years ago)
Author:
alain
Message:

Cosmetic

Location:
soft/giet_vm/giet_drivers
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/bdv_driver.c

    r320 r333  
    136136    _bdv_set_register( BLOCK_DEVICE_LBA       , lba );
    137137
     138#if GIET_DEBUG_IOC_DRIVER
     139_printf("\n[BDV DEBUG] _bdv_access() : config registers set\n");
     140#endif
     141
    138142    // In BOOT mode, we launch transfer, and poll the BDV_STATUS
    139143    // register because IRQs are masked.
     
    144148        else             _bdv_set_register( BLOCK_DEVICE_OP, BLOCK_DEVICE_READ );
    145149
     150#if GIET_DEBUG_IOC_DRIVER
     151_printf("\n[BDV DEBUG] _bdv_access() : transfert lauched in polling mode\n");
     152#endif
    146153        unsigned int status;
    147154        do
     
    185192        // enters critical section
    186193        _it_disable( &save_sr );
    187        
    188194
    189195        // set _bdv_gtid and reset runnable
     
    195201        else             _bdv_set_register( BLOCK_DEVICE_OP, BLOCK_DEVICE_READ  );
    196202
     203#if GIET_DEBUG_IOC_DRIVER
     204_printf("\n[BDV DEBUG] _bdv_access() : transfert lauched in interrupt mode\n");
     205#endif
    197206        // deschedule task
    198207        _ctx_switch();                     
  • soft/giet_vm/giet_drivers/dma_driver.c

    r320 r333  
    2121//
    2222// The virtual base address of the segment associated to a channel is:
    23 //    SEG_DMA_BASE + cluster_xy * vseg_cluster_increment + DMA_SPAN * channel_id
     23//    SEG_DMA_BASE + cluster_xy * PERI_CLUSTER_INCREMENT + DMA_SPAN * channel_id
    2424//
    2525// The SEG_DMA_BASE virtual address mus be defined in the hard_config.h file.
     
    5757#endif
    5858
    59 #if !defined(VSEG_CLUSTER_INCREMENT)
    60 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file
     59#if !defined(PERI_CLUSTER_INCREMENT)
     60# error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file
    6161#endif
    6262
     
    8383    // compute DMA base address
    8484    unsigned int* dma_address = (unsigned int*) ( SEG_DMA_BASE +
    85                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     85                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    8686
    8787    // disable interrupt for selected channel
     
    111111    // compute DMA base address
    112112    unsigned int* dma_address = (unsigned int*) ( SEG_DMA_BASE +
    113                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     113                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    114114
    115115    // reset selected channel
     
    138138    // compute DMA base address
    139139    unsigned int * dma_address = (unsigned int *) ( SEG_DMA_BASE +
    140                                  (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     140                                 (cluster_xy * PERI_CLUSTER_INCREMENT) );
    141141
    142142    // get selected channel status
     
    169169    // compute DMA base address
    170170    unsigned int * dma_address = (unsigned int *) ( SEG_DMA_BASE +
    171                                  (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     171                                 (cluster_xy * PERI_CLUSTER_INCREMENT) );
    172172
    173173    // selected channel configuration and lauching
     
    308308
    309309#else // NB_DMA_CHANNELS == 0
    310     _printf("\n[GIET ERROR] in _dma_copy() : NB_DMA_CHANNELS = 0 !\n");
     310    _printf("\n[GIET ERROR] in _dma_copy() : NB_DMA_CHANNELS == 0 / cycle %d\n",
     311            _get_proctime );
    311312    _exit();
    312313#endif
     
    320321               unsigned int channel )
    321322{
    322     _printf("\n[GIET ERROR] _dma_isr() not implemented\n");
     323    _printf("\n[GIET ERROR] _dma_isr() not implemented / cycle %d\n",
     324            _get_proctime() );
    323325    _exit();
    324326}
  • soft/giet_vm/giet_drivers/icu_driver.c

    r320 r333  
    1515////////////////////////////////////////////////////////////////////////////////
    1616// The virtual base address of the segment associated to the component is:
    17 //      SEG_ICU_BASE + cluster_xy * VSEG_CLUSTER_INCREMENT
     17//      SEG_ICU_BASE + cluster_xy * PERI_CLUSTER_INCREMENT
    1818//
    19 // SEG_ICU_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h
     19// SEG_ICU_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h
    2020////////////////////////////////////////////////////////////////////////////////
    2121
     
    5353#endif
    5454
    55 #if !defined(VSEG_CLUSTER_INCREMENT)
    56 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file
     55#if !defined(PERI_CLUSTER_INCREMENT)
     56# error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file
    5757#endif
    5858
     
    8080#else
    8181    unsigned int * icu_address = (unsigned int *) ( SEG_ICU_BASE +
    82                                  (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     82                                 (cluster_xy * PERI_CLUSTER_INCREMENT) );
    8383    icu_address[proc_id * ICU_SPAN + ICU_MASK_SET] = value;
    8484    return 0;
     
    108108#else
    109109    unsigned int * icu_address = (unsigned int *) ( SEG_ICU_BASE +
    110                                  (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     110                                 (cluster_xy * PERI_CLUSTER_INCREMENT) );
    111111    *buffer = icu_address[proc_id * ICU_SPAN + ICU_IT_VECTOR];
    112112    return 0;
  • soft/giet_vm/giet_drivers/mmc_driver.c

    r320 r333  
    1212//
    1313// The (virtual) base address of the associated segment is:
    14 //       SEG_MMC_BASE + cluster_id * VSEG_CLUSTER_INCREMENT
     14//       SEG_MMC_BASE + cluster_id * PERI_CLUSTER_INCREMENT
    1515//
    16 // SEG_MMC_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h.
     16// SEG_MMC_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h.
    1717////////////////////////////////////////////////////////////////////////////////
    1818
     
    4242#endif
    4343
    44 #if !defined(VSEG_CLUSTER_INCREMENT)
    45 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file
     44#if !defined(PERI_CLUSTER_INCREMENT)
     45# error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file
    4646#endif
    4747
     
    6868
    6969    unsigned int* mmc_address = (unsigned int*)( SEG_MMC_BASE +
    70                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     70                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    7171
    7272    // get the hard lock protecting exclusive access to MEMC
     
    104104
    105105    unsigned int* mmc_address = (unsigned int*)( SEG_MMC_BASE +
    106                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     106                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    107107
    108108    // get the hard lock protecting exclusive access to MEMC
  • soft/giet_vm/giet_drivers/mwr_driver.c

    r320 r333  
    1111//
    1212// The (virtual) base address of the associated segment is:
    13 //       SEG_MWR_BASE + cluster_xy * VSEG_CLUSTER_INCREMENT
     13//       SEG_MWR_BASE + cluster_xy * PERI_CLUSTER_INCREMENT
    1414//
    15 // SEG_MWR_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h
     15// SEG_MWR_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h
    1616////////////////////////////////////////////////////////////////////////////////
    1717
     
    4141#endif
    4242
    43 #if !defined(VSEG_CLUSTER_INCREMENT)
    44 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file
     43#if !defined(PERI_CLUSTER_INCREMENT)
     44# error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file
    4545#endif
    4646
     
    7575    // compute base address
    7676    unsigned int* mwr_address = (unsigned int*) ( SEG_MWR_BASE +
    77                                  (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     77                                 (cluster_xy * PERI_CLUSTER_INCREMENT) );
    7878
    7979    unsigned int lsb = (unsigned int)channel_pbase;
  • soft/giet_vm/giet_drivers/nic_driver.c

    r320 r333  
    9393                              unsigned int   length )
    9494{
    95     _printf("[GIET ERROR] _nic_sync_write function not implemented\n");
     95    _printf("[GIET ERROR] _nic_sync_write function not implemented / cycle %d\n",
     96            _get_proctime() );
    9697    _exit();
    9798
    98     // unsigned char* nic_address = (unsigned char *) &seg_nic_base;
    99     // memcpy((void *) nic_address, (void *) buffer, length);
    10099    return 0;
    101100}
     
    108107                             unsigned int   length )
    109108{
    110     _printf("[GIET ERROR] _nic_sync_read function not implemented\n");
     109    _printf("[GIET ERROR] _nic_sync_read function not implemented / cycle %d\n",
     110            _get_proctime() );
    111111    _exit();
    112112
    113     // unsigned char* nic_address = (unsigned char *) &seg_nic_base;
    114     // memcpy((void *) buffer, (void *) nic_address, length);
    115113    return 0;
    116114}
     
    120118unsigned int _nic_cma_start( )
    121119{
    122     _printf("[GIET ERROR] _nic_cma_start() not implemented\n");
     120    _printf("[GIET ERROR] _nic_cma_start() not implemented / cycle %d\n",
     121            _get_proctime() );
    123122    _exit();
    124123
    125     // unsigned char* nic_address = (unsigned char *) &seg_nic_base;
    126124    return 0;
    127125}
     
    131129unsigned int _nic_cma_stop()
    132130{
    133     _printf("[GIET ERROR] _nic_cma_stop() not implemented\n");
     131    _printf("[GIET ERROR] _nic_cma_stop() not implemented / cycle %d\n",
     132            _get_proctime() );
    134133    _exit();
    135134
    136     // unsigned char* nic_address = (unsigned char *) &seg_nic_base;
    137135    return 0;
    138136}
     
    145143                  unsigned int channel )
    146144{
    147     _printf("[GIET ERROR] _nic_rx_isr() not implemented\n");
     145    _printf("[GIET ERROR] _nic_rx_isr() not implemented / cycle %d\n",
     146            _get_proctime() );
    148147    _exit();
    149148}
     
    156155                  unsigned int channel )
    157156{
    158     _printf("[GIET ERROR] _nic_tx_isr() not implemented\n");
     157    _printf("[GIET ERROR] _nic_tx_isr() not implemented / cycle %d\n",
     158            _get_proctime() );
    159159    _exit();
    160160}
  • soft/giet_vm/giet_drivers/tim_driver.c

    r320 r333  
    2121//
    2222// The virtual base address of the segment associated to a channel is:
    23 //     SEG_TIM_BASE + cluster_xy * VSEG_CLUSTER_INCREMENT + TIMER_SPAN * timer_id
    24 //
    25 // The SEG_TIM_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h.
     23//     SEG_TIM_BASE + cluster_xy * PERI_CLUSTER_INCREMENT + TIMER_SPAN * timer_id
     24//
     25// The SEG_TIM_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h.
    2626/////////////////////////////////////////////////////////////////////////////////////
    2727
     
    3636#endif
    3737
    38 #if !defined(VSEG_CLUSTER_INCREMENT)
    39 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file
     38#if !defined(PERI_CLUSTER_INCREMENT)
     39# error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file
    4040#endif
    4141
     
    9999
    100100    unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE +
    101                                   (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     101                                  (cluster_xy * PERI_CLUSTER_INCREMENT) );
    102102
    103103    timer_address[local_id * TIMER_SPAN + TIMER_PERIOD] = period;
     
    130130
    131131    unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE +
    132                                   (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     132                                  (cluster_xy * PERI_CLUSTER_INCREMENT) );
    133133
    134134    timer_address[local_id * TIMER_SPAN + TIMER_MODE] = 0;
     
    162162
    163163    unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE +
    164                                   (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     164                                  (cluster_xy * PERI_CLUSTER_INCREMENT) );
    165165
    166166    timer_address[local_id * TIMER_SPAN + TIMER_RESETIRQ] = 0;
     
    196196    // We suppose that the TIMER_MODE register value is 0x3
    197197    unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE +
    198                                   (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     198                                  (cluster_xy * PERI_CLUSTER_INCREMENT) );
    199199
    200200    unsigned int period = timer_address[local_id * TIMER_SPAN + TIMER_PERIOD];
  • soft/giet_vm/giet_drivers/tty_driver.c

    r320 r333  
    152152
    153153//////////////////////////////////////////////////////////////////////////////
    154 // This function try to take the hardwired lock protecting
     154// This function try to take the lock protecting
    155155// exclusive access to TTY terminal identified by the "channel" argument.
    156156// It enters a critical section before taking the lock, and save the SR value
     
    162162{
    163163    if( channel >= NB_TTY_CHANNELS ) _exit();
    164 
    165164    _it_disable( save_sr_ptr );
    166 
    167 //    while ( _tty_get_register( channel, TTY_CONFIG ) ); // busy waiting
    168 
    169165    _get_lock( &_tty_lock[channel] );
    170166}
     
    180176{
    181177    if( channel >= NB_TTY_CHANNELS ) _exit();
    182 
    183 //    _tty_set_register( channel, TTY_CONFIG, 0 );
    184 
    185178    _release_lock( &_tty_lock[channel] );
    186    
    187179    _it_restore( save_sr_ptr );
    188180}
  • soft/giet_vm/giet_drivers/xcu_driver.c

    r320 r333  
    77// This peripheral is replicated in aall clusters containing processors.
    88//
    9 // SEG_XCU_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h file.
     9// SEG_XCU_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h file.
    1010///////////////////////////////////////////////////////////////////////////////////
    1111
     
    4545#endif
    4646
    47 #if !defined( VSEG_CLUSTER_INCREMENT )
    48 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file
     47#if !defined( PERI_CLUSTER_INCREMENT )
     48# error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file
    4949#endif
    5050
     
    6969
    7070    unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE +
    71                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     71                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    7272
    7373    unsigned int func;
     
    111111
    112112    unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE +
    113                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     113                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    114114
    115115    unsigned int prio = xcu_address[XCU_REG(XCU_PRIO,channel)];
     
    163163
    164164    unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE +
    165                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     165                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    166166
    167167    xcu_address[XCU_REG(XCU_WTI_REG,wti_index)] = wdata;
     
    192192 
    193193    unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE +
    194                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     194                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    195195
    196196    *value = xcu_address[XCU_REG(XCU_WTI_REG, wti_index)];
     
    240240
    241241    unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE +
    242                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     242                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    243243
    244244    xcu_address[XCU_REG(XCU_PTI_PER, pti_index)] = period;
     
    265265
    266266    unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE +
    267                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     267                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    268268
    269269    xcu_address[XCU_REG(XCU_PTI_PER, pti_index)] = 0;
     
    292292
    293293    unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE +
    294                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     294                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    295295
    296296    // This return value is not used / avoid a compilation warning.
     
    323323
    324324    unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE +
    325                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
     325                                (cluster_xy * PERI_CLUSTER_INCREMENT) );
    326326
    327327    unsigned int period = xcu_address[XCU_REG(XCU_PTI_PER, pti_index)];
Note: See TracChangeset for help on using the changeset viewer.