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.
Location:
branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/Makefile

    r934 r1016  
    7070
    7171mkconfig $(SIMULATOR) $(CONF): $(PLATFORM)/scripts/onerun.py
    72         ./$< -o $(CONFDIR) -p $(PLATFORM) -x3 -y3 -n1 -c
     72        ./$< -o $(CONFDIR) -p $(PLATFORM) -x3 -y3 -n1 -f -c
    7373
    7474$(BUILD_DIR):
  • branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/main.c

    r947 r1016  
    2525    /* configure the routers around the blackhole (1, 1) to define a cycle-free
    2626     * contour */
    27     const int PATH_RECOVERY = 1;
     27    const int RECOVERY = 1;
    2828    uint32_t val;
    2929
    3030    printf("router(0, 2): configuring as NW\n");
    31     assert(xcu_get_register(0, 2, XICU_CFG_REG, 0) == BH_NONE);
    32     val = (PATH_RECOVERY << 7) | (REQ_SOUTH << 4) | BH_NW;
     31    val = (REQ_SOUTH << 5) | (RECOVERY << 4) | NW_OF_X;
    3332    xcu_set_register(0, 2, XICU_CFG_REG, 0, val);     /* configure NW */
    3433
    3534    printf("router(0, 1): configuring as W\n");
    36     assert(xcu_get_register(0, 1, XICU_CFG_REG, 0) == BH_NONE);
    37     val = (PATH_RECOVERY << 7) | (REQ_LOCAL << 4) | BH_W;
     35    val = (REQ_LOCAL << 5) | (RECOVERY << 4) | W_OF_X;
    3836    xcu_set_register(0, 1, XICU_CFG_REG, 0, val);     /* configure W */
    3937
    4038    printf("router(0, 0): configuring as SW\n");
    41     assert(xcu_get_register(0, 0, XICU_CFG_REG, 0) == BH_NONE);
    42     val = (PATH_RECOVERY << 7) | (REQ_NORTH << 4) | BH_SW;
     39    val = (REQ_NORTH << 5) | (RECOVERY << 4) | SW_OF_X;
    4340    xcu_set_register(0, 0, XICU_CFG_REG, 0, val);     /* configure SW */
    4441
    4542    printf("router(1, 2): configuring as N\n");
    46     assert(xcu_get_register(1, 2, XICU_CFG_REG, 0) == BH_NONE);
    47     val = (PATH_RECOVERY << 7) | (REQ_WEST << 4) | BH_N;
     43    val = (REQ_WEST << 5) | (RECOVERY << 4) | N_OF_X;
    4844    xcu_set_register(1, 2, XICU_CFG_REG, 0, val);     /* configure N */
    4945
    5046    printf("router(2, 2): configuring as NE\n");
    51     assert(xcu_get_register(2, 2, XICU_CFG_REG, 0) == BH_NONE);
    52     val = (PATH_RECOVERY << 7) | (REQ_WEST << 4) | BH_NE;
     47    val = (REQ_WEST << 5) | (RECOVERY << 4) | NE_OF_X;
    5348    xcu_set_register(2, 2, XICU_CFG_REG, 0, val);     /* configure NE */
    5449
    5550    printf("router(2, 1): configuring as E\n");
    56     assert(xcu_get_register(2, 1, XICU_CFG_REG, 0) == BH_NONE);
    57     val = (PATH_RECOVERY << 7) | (REQ_SOUTH << 4) | BH_E;
     51    val = (REQ_SOUTH << 5) | (RECOVERY << 4) | E_OF_X;
    5852    xcu_set_register(2, 1, XICU_CFG_REG, 0, val);     /* configure E */
    5953
    6054    printf("router(2, 0): configuring as SE\n");
    61     assert(xcu_get_register(2, 0, XICU_CFG_REG, 0) == BH_NONE);
    62     val = (PATH_RECOVERY << 7) | (REQ_WEST << 4) | BH_SE;
     55    val = (REQ_WEST << 5) | (RECOVERY << 4) | SE_OF_X;
    6356    xcu_set_register(2, 0, XICU_CFG_REG, 0, val);     /* configure SE */
    6457
    6558    printf("router(1, 0): configuring as S\n");
    66     assert(xcu_get_register(1, 0, XICU_CFG_REG, 0) == BH_NONE);
    67     val = (PATH_RECOVERY << 7) | (REQ_WEST << 4) | BH_S;
     59    val = (REQ_WEST << 5) | (RECOVERY << 4) | S_OF_X;
    6860    xcu_set_register(1, 0, XICU_CFG_REG, 0, val);     /* configure S */
    6961
    70     assert((xcu_get_register(0, 2, XICU_CFG_REG, 0) & 0xF) == BH_NW);
    71     assert((xcu_get_register(0, 1, XICU_CFG_REG, 0) & 0xF) == BH_W);
    72     assert((xcu_get_register(0, 0, XICU_CFG_REG, 0) & 0xF) == BH_SW);
    73     assert((xcu_get_register(1, 2, XICU_CFG_REG, 0) & 0xF) == BH_N);
    74     assert((xcu_get_register(2, 2, XICU_CFG_REG, 0) & 0xF) == BH_NE);
    75     assert((xcu_get_register(2, 1, XICU_CFG_REG, 0) & 0xF) == BH_E);
    76     assert((xcu_get_register(2, 0, XICU_CFG_REG, 0) & 0xF) == BH_SE);
    77     assert((xcu_get_register(1, 0, XICU_CFG_REG, 0) & 0xF) == BH_S);
     62    assert((xcu_get_register(0, 2, XICU_CFG_REG, 0) & 0xF) == NW_OF_X);
     63    assert((xcu_get_register(0, 1, XICU_CFG_REG, 0) & 0xF) == W_OF_X);
     64    assert((xcu_get_register(0, 0, XICU_CFG_REG, 0) & 0xF) == SW_OF_X);
     65    assert((xcu_get_register(1, 2, XICU_CFG_REG, 0) & 0xF) == N_OF_X);
     66    assert((xcu_get_register(2, 2, XICU_CFG_REG, 0) & 0xF) == NE_OF_X);
     67    assert((xcu_get_register(2, 1, XICU_CFG_REG, 0) & 0xF) == E_OF_X);
     68    assert((xcu_get_register(2, 0, XICU_CFG_REG, 0) & 0xF) == SE_OF_X);
     69    assert((xcu_get_register(1, 0, XICU_CFG_REG, 0) & 0xF) == S_OF_X);
    7870
    7971    /* Test the recovered segment that has been migrated to the EAST cluster */
  • 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 */
  • branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/test.sh

    r942 r1016  
    1313PLATFORM=../../../../../platforms/tsar_generic_iob
    1414SIMULATOR=$PLATFORM/simul.x
    15 $SIMULATOR -DSOFT $SOFT -DISK /dev/null -FAULTY_ROUTER 0 1 1 > output/log 2>&1
     15$SIMULATOR -DSOFT $SOFT \
     16           -DISK /dev/null \
     17           -FAULTY_ROUTER 0 1 1 \
     18           -NCYCLES 20000 > output/log 2>&1
     19#          -PROCID 0 \
     20#          -MEMCID 0x1 \
     21#          -DEBUG 3000 \
     22
    1623soclib-cleanup-terms &> /dev/null
    1724mv term0 output/term
    1825grep -q "success" output/term
    1926if [ $? == 0 ];
    20         then echo $(basename $PWD) ": Success";
    21         else echo $(basename $PWD) ": Failure";
     27    then echo $(basename $PWD) ": Success";
     28    else echo $(basename $PWD) ": Failure";
    2229fi;
Note: See TracChangeset for help on using the changeset viewer.