Changeset 942


Ignore:
Timestamp:
Feb 12, 2015, 2:59:20 PM (9 years ago)
Author:
cfuguet
Message:

reconf: improve unitary tests for dspin_router

Location:
branches/reconfiguration
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/modules/dspin_router/caba/test/common.mk

    r887 r942  
    1717              -fomit-frame-pointer         \
    1818              -march=mips32                \
    19               -Os                          \
     19              -Og                          \
    2020              -ggdb                        \
    2121#             -msoft-float                 \
  • branches/reconfiguration/modules/dspin_router/caba/test/simple_recovery_routing_test/main.c

    r887 r942  
    3030     */
    3131    printf("router(0, 2): configuring as NW\n");
    32     assert(xcu_get_config(0, 2, 0) == BH_NONE);
    33     xcu_set_config(0, 2, 0, BH_NW);    /* configure NW */
     32    assert(xcu_get_register(0, 2, XICU_CFG_REG, 0) == BH_NONE);
     33    xcu_set_register(0, 2, XICU_CFG_REG, 0, BH_NW);    /* configure NW */
    3434
    3535    printf("router(0, 1): configuring as W\n");
    36     assert(xcu_get_config(0, 1, 0) == BH_NONE);
    37     xcu_set_config(0, 1, 0, BH_W);     /* configure W */
     36    assert(xcu_get_register(0, 1, XICU_CFG_REG, 0) == BH_NONE);
     37    xcu_set_register(0, 1, XICU_CFG_REG, 0, BH_W);     /* configure W */
    3838
    3939    printf("router(0, 0): configuring as SW\n");
    40     assert(xcu_get_config(0, 0, 0) == BH_NONE);
    41     xcu_set_config(0, 0, 0, BH_SW);    /* configure SW */
     40    assert(xcu_get_register(0, 0, XICU_CFG_REG, 0) == BH_NONE);
     41    xcu_set_register(0, 0, XICU_CFG_REG, 0, BH_SW);    /* configure SW */
    4242
    4343    printf("router(1, 2): configuring as N\n");
    44     assert(xcu_get_config(1, 2, 0) == BH_NONE);
    45     xcu_set_config(1, 2, 0, BH_N);     /* configure N */
     44    assert(xcu_get_register(1, 2, XICU_CFG_REG, 0) == BH_NONE);
     45    xcu_set_register(1, 2, XICU_CFG_REG, 0, BH_N);     /* configure N */
    4646
    4747    printf("router(2, 2): configuring as NE\n");
    48     assert(xcu_get_config(2, 2, 0) == BH_NONE);
    49     xcu_set_config(2, 2, 0, BH_NE);    /* configure NE */
     48    assert(xcu_get_register(2, 2, XICU_CFG_REG, 0) == BH_NONE);
     49    xcu_set_register(2, 2, XICU_CFG_REG, 0, BH_NE);    /* configure NE */
    5050
    5151    printf("router(2, 1): configuring as E\n");
    52     assert(xcu_get_config(2, 1, 0) == BH_NONE);
    53     xcu_set_config(2, 1, 0, BH_E);     /* configure E */
     52    assert(xcu_get_register(2, 1, XICU_CFG_REG, 0) == BH_NONE);
     53    xcu_set_register(2, 1, XICU_CFG_REG, 0, BH_E);     /* configure E */
    5454
    5555    printf("router(2, 0): configuring as SE\n");
    56     assert(xcu_get_config(2, 0, 0) == BH_NONE);
    57     xcu_set_config(2, 0, 0, BH_SE);    /* configure SE */
     56    assert(xcu_get_register(2, 0, XICU_CFG_REG, 0) == BH_NONE);
     57    xcu_set_register(2, 0, XICU_CFG_REG, 0, BH_SE);    /* configure SE */
    5858
    5959    printf("router(1, 0): configuring as S\n");
    60     assert(xcu_get_config(1, 0, 0) == BH_NONE);
    61     xcu_set_config(1, 0, 0, BH_S);     /* configure S */
     60    assert(xcu_get_register(1, 0, XICU_CFG_REG, 0) == BH_NONE);
     61    xcu_set_register(1, 0, XICU_CFG_REG, 0, BH_S);     /* configure S */
    6262
    63     assert(xcu_get_config(0, 2, 0) == BH_NW);
    64     assert(xcu_get_config(0, 1, 0) == BH_W);
    65     assert(xcu_get_config(0, 0, 0) == BH_SW);
    66     assert(xcu_get_config(1, 2, 0) == BH_N);
    67     assert(xcu_get_config(2, 2, 0) == BH_NE);
    68     assert(xcu_get_config(2, 1, 0) == BH_E);
    69     assert(xcu_get_config(2, 0, 0) == BH_SE);
    70     assert(xcu_get_config(1, 0, 0) == BH_S);
     63    assert(xcu_get_register(0, 2, XICU_CFG_REG, 0) == BH_NW);
     64    assert(xcu_get_register(0, 1, XICU_CFG_REG, 0) == BH_W);
     65    assert(xcu_get_register(0, 0, XICU_CFG_REG, 0) == BH_SW);
     66    assert(xcu_get_register(1, 2, XICU_CFG_REG, 0) == BH_N);
     67    assert(xcu_get_register(2, 2, XICU_CFG_REG, 0) == BH_NE);
     68    assert(xcu_get_register(2, 1, XICU_CFG_REG, 0) == BH_E);
     69    assert(xcu_get_register(2, 0, XICU_CFG_REG, 0) == BH_SE);
     70    assert(xcu_get_register(1, 0, XICU_CFG_REG, 0) == BH_S);
    7171
    7272#if 0
     
    7878     * between them.
    7979     */
    80     assert(xcu_get_config(1, 1, 0) == BH_NONE);
     80    assert(xcu_get_register(1, 1, XICU_CFG_REG, 0) == BH_NONE);
    8181#endif
    8282
  • branches/reconfiguration/modules/dspin_router/caba/test/simple_recovery_routing_test/test.sh

    r934 r942  
    1313PLATFORM=../../../../../platforms/tsar_generic_iob
    1414SIMULATOR=$PLATFORM/simul.x
    15 $SIMULATOR -DSOFT $SOFT -DISK /dev/null -FAULTY_ROUTER 0 1 1 2> /dev/null >> output/log
     15$SIMULATOR -DSOFT $SOFT -DISK /dev/null -FAULTY_ROUTER 0 1 1 > output/log 2>&1
    1616soclib-cleanup-terms &> /dev/null
    1717mv term0 output/term
  • branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/main.c

    r934 r942  
    2525    /* configure the routers around the blackhole (1, 1) to define a cycle-free
    2626     * contour */
     27    uint32_t val;
     28
    2729    printf("router(0, 2): configuring as NW\n");
    28     assert(xcu_get_config(0, 2, 0) == BH_NONE);
    29     xcu_set_config(0, 2, 0, (REQ_SOUTH << 4) | BH_NW);     /* configure NW */
     30    assert(xcu_get_register(0, 2, XICU_CFG_REG, 0) == BH_NONE);
     31    val = (REQ_SOUTH << 4) | BH_NW;
     32    xcu_set_register(0, 2, XICU_CFG_REG, 0, val);     /* configure NW */
    3033
    3134    printf("router(0, 1): configuring as W\n");
    32     assert(xcu_get_config(0, 1, 0) == BH_NONE);
    33     xcu_set_config(0, 1, 0, (REQ_LOCAL << 4) | BH_W);      /* configure W */
     35    assert(xcu_get_register(0, 1, XICU_CFG_REG, 0) == BH_NONE);
     36    val = (REQ_LOCAL << 4) | BH_W;
     37    xcu_set_register(0, 1, XICU_CFG_REG, 0, val);     /* configure W */
    3438
    3539    printf("router(0, 0): configuring as SW\n");
    36     assert(xcu_get_config(0, 0, 0) == BH_NONE);
    37     xcu_set_config(0, 0, 0, (REQ_NORTH << 4) | BH_SW);     /* configure SW */
     40    assert(xcu_get_register(0, 0, XICU_CFG_REG, 0) == BH_NONE);
     41    val = (REQ_NORTH << 4) | BH_SW;
     42    xcu_set_register(0, 0, XICU_CFG_REG, 0, val);     /* configure SW */
    3843
    3944    printf("router(1, 2): configuring as N\n");
    40     assert(xcu_get_config(1, 2, 0) == BH_NONE);
    41     xcu_set_config(1, 2, 0, (REQ_WEST << 4) | BH_N);       /* configure N */
     45    assert(xcu_get_register(1, 2, XICU_CFG_REG, 0) == BH_NONE);
     46    val = (REQ_WEST << 4) | BH_N;
     47    xcu_set_register(1, 2, XICU_CFG_REG, 0, val);     /* configure N */
    4248
    4349    printf("router(2, 2): configuring as NE\n");
    44     assert(xcu_get_config(2, 2, 0) == BH_NONE);
    45     xcu_set_config(2, 2, 0, (REQ_WEST << 4) | BH_NE);      /* configure NE */
     50    assert(xcu_get_register(2, 2, XICU_CFG_REG, 0) == BH_NONE);
     51    val = (REQ_WEST << 4) | BH_NE;
     52    xcu_set_register(2, 2, XICU_CFG_REG, 0, val);     /* configure NE */
    4653
    4754    printf("router(2, 1): configuring as E\n");
    48     assert(xcu_get_config(2, 1, 0) == BH_NONE);
    49     xcu_set_config(2, 1, 0, (REQ_SOUTH << 4) | BH_E);      /* configure E */
     55    assert(xcu_get_register(2, 1, XICU_CFG_REG, 0) == BH_NONE);
     56    val = (REQ_SOUTH << 4) | BH_E;
     57    xcu_set_register(2, 1, XICU_CFG_REG, 0, val);     /* configure E */
    5058
    5159    printf("router(2, 0): configuring as SE\n");
    52     assert(xcu_get_config(2, 0, 0) == BH_NONE);
    53     xcu_set_config(2, 0, 0, (REQ_WEST << 4) | BH_SE);      /* configure SE */
     60    assert(xcu_get_register(2, 0, XICU_CFG_REG, 0) == BH_NONE);
     61    val = (REQ_WEST << 4) | BH_SE;
     62    xcu_set_register(2, 0, XICU_CFG_REG, 0, val);     /* configure SE */
    5463
    5564    printf("router(1, 0): configuring as S\n");
    56     assert(xcu_get_config(1, 0, 0) == BH_NONE);
    57     xcu_set_config(1, 0, 0, (REQ_WEST << 4) | BH_S);       /* configure S */
     65    assert(xcu_get_register(1, 0, XICU_CFG_REG, 0) == BH_NONE);
     66    val = (REQ_WEST << 4) | BH_S;
     67    xcu_set_register(1, 0, XICU_CFG_REG, 0, val);     /* configure S */
    5868
    59     assert((xcu_get_config(0, 2, 0) & 0xF) == BH_NW);
    60     assert((xcu_get_config(0, 1, 0) & 0xF) == BH_W);
    61     assert((xcu_get_config(0, 0, 0) & 0xF) == BH_SW);
    62     assert((xcu_get_config(1, 2, 0) & 0xF) == BH_N);
    63     assert((xcu_get_config(2, 2, 0) & 0xF) == BH_NE);
    64     assert((xcu_get_config(2, 1, 0) & 0xF) == BH_E);
    65     assert((xcu_get_config(2, 0, 0) & 0xF) == BH_SE);
    66     assert((xcu_get_config(1, 0, 0) & 0xF) == BH_S);
     69    assert((xcu_get_register(0, 2, XICU_CFG_REG, 0) & 0xF) == BH_NW);
     70    assert((xcu_get_register(0, 1, XICU_CFG_REG, 0) & 0xF) == BH_W);
     71    assert((xcu_get_register(0, 0, XICU_CFG_REG, 0) & 0xF) == BH_SW);
     72    assert((xcu_get_register(1, 2, XICU_CFG_REG, 0) & 0xF) == BH_N);
     73    assert((xcu_get_register(2, 2, XICU_CFG_REG, 0) & 0xF) == BH_NE);
     74    assert((xcu_get_register(2, 1, XICU_CFG_REG, 0) & 0xF) == BH_E);
     75    assert((xcu_get_register(2, 0, XICU_CFG_REG, 0) & 0xF) == BH_SE);
     76    assert((xcu_get_register(1, 0, XICU_CFG_REG, 0) & 0xF) == BH_S);
    6777
    6878    /* Test the recovered segment that has been migrated to the EAST cluster */
  • branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/test.sh

    r934 r942  
    1313PLATFORM=../../../../../platforms/tsar_generic_iob
    1414SIMULATOR=$PLATFORM/simul.x
    15 $SIMULATOR -DSOFT $SOFT -DISK /dev/null -FAULTY_ROUTER 0 1 1 2> /dev/null >> output/log
     15$SIMULATOR -DSOFT $SOFT -DISK /dev/null -FAULTY_ROUTER 0 1 1 > output/log 2>&1
    1616soclib-cleanup-terms &> /dev/null
    1717mv term0 output/term
  • branches/reconfiguration/softs/drivers/xcu.c

    r887 r942  
    55 */
    66#include <xcu.h>
    7 #include <soclib/xicu.h>
    87#include <io.h>
    98#include <hard_config.h>
     
    1211#define XCUREG(func,idx) (SEG_XCU_BASE + (XICU_REG((func),(idx)) << 2))
    1312
    14 void xcu_set_config(int x, int y, int idx, uint32_t val)
     13void xcu_set_register(int x, int y, int func, int idx, uint32_t val)
    1514{
    16     iowrite32(CLUSTER_BASE(x,y) | XCUREG(XICU_CFG_REG, idx), val);
     15    iowrite32(CLUSTER_BASE(x,y) | XCUREG(func, idx), val);
    1716}
    1817
    19 uint32_t xcu_get_config(int x, int y, int idx)
     18uint32_t xcu_get_register(int x, int y, int func, int idx)
    2019{
    21     return ioread32(CLUSTER_BASE(x,y) | XCUREG(XICU_CFG_REG, idx));
     20    return ioread32(CLUSTER_BASE(x,y) | XCUREG(func, idx));
    2221}
    2322
  • branches/reconfiguration/softs/drivers/xcu.h

    r887 r942  
    77#define XCU_H
    88
     9#include <soclib/xicu.h>
    910#include <stdint.h>
    1011
    11 void xcu_set_config(int x, int y, int idx, uint32_t val);
    12 uint32_t xcu_get_config(int x, int y, int idx);
     12void xcu_set_register(int x, int y, int func, int idx, uint32_t val);
     13uint32_t xcu_get_register(int x, int y, int func, int idx);
    1314
    1415#endif
Note: See TracChangeset for help on using the changeset viewer.