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

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [core/] [9x8/] [peripherals/] [tb/] [UART_Rx/] [run] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sinclairrf
#!/bin/bash
2 9 sinclairrf
# Copyright 2013, 2015, Sinclair R.F., Inc.
3 2 sinclairrf
 
4
NAME=UART_Rx
5
 
6 9 sinclairrf
cat < tb.good
7 2 sinclairrf
48
8
65
9
6c
10
6c
11
6f
12
20
13
57
14
6f
15
72
16
6c
17
63
18
12
19
0d
20
0a
21
00
22
EOF
23
 
24
# Test +/-2.7% and 0% baud rates.
25 9 sinclairrf
cp tb_${NAME}.s-normal tb_${NAME}.s;
26
cp tb.v-normal tb.v
27 2 sinclairrf
for baud in 112089 115200 118310; do
28
  sed -e "s/115200/${baud}/" tb_${NAME}.9x8-good > tb_${NAME}.9x8;
29
  ../../../../../ssbcc -q -P monitor_stack tb_${NAME}.9x8 || { echo "${NAME} compile failed" > /dev/stderr; exit 1; }
30
  iverilog -o tb tb.v tb_${NAME}.v || { echo "${NAME} build failed" > /dev/stderr; exit 1; }
31
  ./tb > tb.out;
32 9 sinclairrf
  if ! cmp -s tb.out tb.good; then
33 2 sinclairrf
    echo "${NAME} failed testing baud rate:  ${baud}" > /dev/stderr;
34
    exit 1;
35
  fi
36
done
37
 
38
# Partial test for input FIFO.
39 9 sinclairrf
cp tb_${NAME}.s-fifo tb_${NAME}.s;
40
cp tb.v-normal tb.v
41 2 sinclairrf
sed -e "s/G_BAUD$/G_BAUD inFIFO=16/" tb_${NAME}.9x8-good > tb_${NAME}.9x8;
42
../../../../../ssbcc -q -P monitor_stack tb_${NAME}.9x8 || { echo "${NAME} compile failed" > /dev/stderr; exit 1; }
43
iverilog -o tb tb.v tb_${NAME}.v || { echo "${NAME} build failed" > /dev/stderr; exit 1; }
44
./tb > tb.out
45 9 sinclairrf
if ! cmp tb.out tb.good; then
46 2 sinclairrf
  echo "${NAME} FIFO test failed" > /dev/stderr;
47
  exit 1;
48
fi
49
 
50 9 sinclairrf
# Validate RTRn signal generation
51
cp tb_${NAME}.s-rtrn tb_${NAME}.s
52
cp tb.v-rtrn tb.v
53
for RTR_BUFFER in 1 2 4; do
54
  for RTR_OVERFLOW  in 0 1 2 3; do
55
    if [ ${RTR_OVERFLOW} -ge ${RTR_BUFFER} ]; then continue; fi
56
    sed -e "s/G_BAUD$/G_BAUD inFIFO=8 RTRn=o_uart_rtrn rtr_buffer=${RTR_BUFFER}/" tb_${NAME}.9x8-good > tb_${NAME}.9x8;
57
    sed -e "s/@RTR_OVERFLOW@/${RTR_OVERFLOW}/" tb.v-rtrn > tb.v;
58
    ../../../../../ssbcc -q -P monitor_stack tb_${NAME}.9x8 || { echo "${NAME} compile failed" > /dev/stderr; exit 1; }
59
    iverilog -o tb tb.v tb_${NAME}.v || { echo "${NAME} build failed" > /dev/stderr; exit 1; }
60
    ./tb > tb.out
61
    if ! cmp tb.out tb.good; then
62
      echo "${NAME} FIFO test failed" > /dev/stderr;
63
      exit 1;
64
    fi
65
  done
66
done
67
 
68 2 sinclairrf
echo "Passed:  ${NAME}";
69
exit 0;

powered by: WebSVN 2.1.0

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