Merge pull request #309 from mcmasterg/specn

specn()
This commit is contained in:
John McMaster 2018-12-10 16:45:50 -08:00 committed by GitHub
commit 4265b125e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View File

@ -163,3 +163,9 @@ def gen_tile_bits(db_root, tilej, strict=False, verbose=False):
# 31_06
_bit_inv, (bit_addroff, bit_bitoff) = parse_tagbit(bitstr)
yield (baseaddr + bit_addroff, bitbase + bit_bitoff, tag)
def specn():
# ex: build/specimen_001
specdir = os.getenv("SPECDIR")
return int(re.match(".*specimen_([0-9]*)", specdir).group(1), 10)

View File

@ -10,14 +10,14 @@ set -ex
# for some reason on sourced script set -e doesn't work
# Scripts may have additional arguments, but first is reserved for build directory
test $# -ge 1 || exit 1
test ! -e "$SPECN"
SPECN=$1
test ! -e "$SPECDIR"
export SPECDIR=$1
rm -rf "$SPECN"
mkdir -p "$SPECN"
cd "$SPECN"
rm -rf "$SPECDIR"
mkdir -p "$SPECDIR"
cd "$SPECDIR"
export SEED="$(echo $SPECN | md5sum | cut -c1-8)"
export SEED="$(echo $SPECDIR | md5sum | cut -c1-8)"
export SEEDN="$(basename $(pwd) |sed s/specimen_0*//)"
function seed_vh () {