OpenCores
URL https://opencores.org/ocsvn/ssbcc/ssbcc/trunk

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [core/] [9x8/] [tb/] [ifdef/] [run] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sinclairrf
#!/bin/bash
2
 
3
rm -f ssbcc;
4
ln -s ../../../../ssbcc;
5
 
6
NAME=ifdef;
7
 
8
for INCLUDE_UART in false true; do
9
  for INCLUDE_I2C in false true; do
10
    FLAGS="";
11
    if ${INCLUDE_UART}; then
12 12 sinclairrf
      FLAGS+=" -D D_INCLUDE_UART";
13 2 sinclairrf
    fi
14
    if ${INCLUDE_I2C}; then
15 12 sinclairrf
      FLAGS+=" -D D_INCLUDE_I2C";
16 2 sinclairrf
    fi
17
    ssbcc -q ${FLAGS} uc.9x8 || { echo "FATAL ERROR:  ssbcc failed" > /dev/stderr; exit 1; }
18
    FAILED=false;
19
    # Validate existence/non-existence of UART peripheral.
20
    RESULT="`grep 'PERIPHERAL UART_Tx:' uc.v`";
21
    if ${INCLUDE_UART}; then
22
      if [ -z "${RESULT}" ]; then FAILED=true; fi
23
    else
24
      if [ -n "${RESULT}" ]; then FAILED=true; fi
25
    fi
26
    # Validate existence/non-existence of "NO I2C BUS" message.
27
    RESULT="`grep '// WARNING -- NO I2C BUS' uc.v`";
28
    if ${INCLUDE_I2C}; then
29
      if [ -n "${RESULT}" ]; then FAILED=true; fi
30
    else
31
      if [ -z "${RESULT}" ]; then FAILED=true; fi
32
    fi
33
    # Validate existence/non-existence of I2C bus signals.
34
    RESULT="`grep 'io_scl' uc.v`";
35
    if ${INCLUDE_I2C}; then
36
      if [ -z "${RESULT}" ]; then FAILED=true; fi
37
    else
38
      if [ -n "${RESULT}" ]; then FAILED=true; fi
39
    fi
40
    # Validate use of ":infinite_1" for existence/non-existence of I2C bus in uc.s
41
    RESULT="`grep ':infinite_1' uc.v`";
42
    if ${INCLUDE_I2C}; then
43
      if [ -z "${RESULT}" ]; then FAILED=true; fi
44
    else
45
      if [ -n "${RESULT}" ]; then FAILED=true; fi
46
    fi
47
    # Validate use of :loop_2 for existence/non-existence of UART use in uc.s
48
    RESULT="`grep ':loop_2' uc.v`";
49
    if ${INCLUDE_UART}; then
50
      if [ -z "${RESULT}" ]; then FAILED=true; fi
51
    else
52
      if [ -n "${RESULT}" ]; then FAILED=true; fi
53
    fi
54
    # Print error message if test failed.
55
    if $FAILED; then
56
      echo "ifdef test failed for ${FLAGS}" > /dev/stderr;
57
      exit 1;
58
    fi
59
  done
60
done
61
 
62
# Remove the temporary output files.
63
rm -f ssbcc uc.9x8-meta uc.v;
64
 
65
# Print success message and return success indication.
66
echo "Passed:  ${NAME}";
67
exit 0;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.