Ignore:
Timestamp:
Sep 14, 2015, 9:42:16 AM (9 years ago)
Author:
cfuguet
Message:

reconf: dspin_router

  • improve the code readability of the dspin_router model.
  • update the unitary tests of the dspin_router to support the local gateway hardware barrier, and the memory cache scratchpad mode.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/reset.S

    r934 r1016  
    2121#define Y_MASK ((1<<Y_WIDTH)-1)
    2222
     23#define XCU_REG(func, idx) ((((func)<<5)|(idx)) << 2)
     24#define XCU_CFG_REG 17
     25#define XCU_BARRIER 5
     26
     27#define MEMC_REG(func,idx) (((func<<7)|idx) << 2)
     28#define MEMC_CONFIG 0
     29#define MEMC_SCRATCHPAD 4
     30
    2331reset:
    2432    .set noreorder
     
    3341
    3442    /*
    35      * All processors compute:
    36      *   cid = (x * Y_SIZE) + y
    37      *   pid = (cid * NB_PROCS_MAX) + lpid
     43     * Get processor ID
    3844     */
    3945    mfc0   k0,  CP0_PROCID
    40     andi   k0,  k0,  0xFFF             /* k0 <= proc_xyl                 */
     46    andi   k0,  k0,  0xFFF             /* k0 <= proc_xyl                     */
    4147
    42     /* Only the processor 0 continues the execution                      */
     48    /*
     49     * Release local gateway hardware barrier
     50     */
     51    la     k1,     SEG_XCU_BASE        /* k1 <= ICU base address             */
     52    li     t0,     XCU_REG(XCU_CFG_REG, XCU_BARRIER)
     53    or     k1,     k1,     t0          /* k1 <= &XICU[CFG_REG][BARRIER]      */
     54    li     t0,     0xFFFFFFFF
     55    sw     t0,     0(k1)
     56
     57    /*
     58     * Disable the scratchpad mode on the local memory cache
     59     */
     60    la     k1,     SEG_MMC_BASE        /* k1 <= MMC base address             */
     61    li     t0,     MEMC_REG(MEMC_CONFIG, MEMC_SCRATCHPAD)
     62    or     k1,     k1,     t0          /* k1 <= &MEMC[CONFIG][SCRATCHPAD]    */
     63    sw     zero,   0(k1)
     64
     65    /* Only the processor 0 continues the execution                          */
    4366    beqz   k0,  1f
    4467    nop
     
    47701:  /* processor 0 initializes stack pointer (16K) */
    4871    la     sp,  _stack
    49     addiu  sp,  sp,  (1<<14)           /* sp <= _stack + 16K             */
     72    addiu  sp,  sp,  (1<<14)           /* sp <= _stack + 16K                 */
    5073
    5174    /* jumps to main in kernel mode */
Note: See TracChangeset for help on using the changeset viewer.