#! /bin/sh

unit=$1

if [ "$1" = "-u" ] ; then
	unit=$2
fi

if [ "$unit" = ""  ] ; then 
	unit=0
fi

# loading bitfiles
mezzload -u $unit

# set up threep channel
threep_setup -u $unit -m0 10g
pdb -u $unit -f threep_mem_test.pdb

# check register ee = 2
#chkprbs15 -u $unit -c 0 -n 1 -b 1M -i -t -l 5000 -s 2
#chkprbs15 -u $unit -c 1 -n 1 -b 1M -i -t -l 5000 -s 2
chkprbs15 -u $unit -c 0 -n 2 -m -b 1M -i -t -l 5000 -s 2

# or set register ee to 4 for prbs7 and check with:
#chkprbs7 -u $unit -c 0 -n 1 -i -t -l 5000 -s 2
#chkprbs7 -u $unit -c 1 -n 1 -i -t -l 5000 -s 2
#chkprbs7 -u $unit -c 0 -n 2 -m -i -t -l 5000 -s 2

# or set register ee to 7 for count and check with:
#chkcount -c 0 -n 1 -w -t -l 5000 -s 2
#chkcount -c 1 -n 1 -w -t -l 5000 -s 2
#chkcount -c 0 -n 2 -m -w -t -l 5000 -s 2
