summaryrefslogtreecommitdiffstats
path: root/woferclock/copy_buckets
blob: 11d29cd1e12ad8b561ce9d4a94c2736dc8e076bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
#
# Copyright (c) 2018 Raptor Engineering, LLC
# Released under the terms of the AGPL v3

set -e

NEW_ULTRATURBO_MHZ="$1"
VOLTAGE_RATIO="$2"
INDIR="$3"
INFILE="$4"
OUTFILE="$5"
SOURCE_BUCKET=2
DEST_BUCKET=5

P9_ALLOWED_BUCKET_NEST_MHZ=(0 1600 1866 2000 2133 2400 2666)

NEW_NEST_FREQUENCY=${P9_ALLOWED_BUCKET_NEST_MHZ[$DEST_BUCKET]}

rm -rf bucket_copy
mkdir bucket_copy
../reverseVpd.py -v ${INDIR}/${INFILE}.bin -o bucket_copy -r &> /dev/null

cp ${INDIR}/${INFILE}.bin ${OUTFILE}.bin

for i in `seq 0 5`; do
	POUND_V=$(./extract_buckets_from_tvpd "#V" bucket_copy/${INFILE}-LRP${i}.tvpd)
	if [[ "$POUND_V" != "" ]]; then
		./update_poundv_buckets ${SOURCE_BUCKET} ${DEST_BUCKET} ${NEW_NEST_FREQUENCY} ${NEW_ULTRATURBO_MHZ} ${VOLTAGE_RATIO} ${POUND_V}
		./find_replace_binary_string ${OUTFILE}.bin search.bin replace.bin
	fi
done

POUND_W=$(./extract_buckets_from_tvpd "#W" bucket_copy/${INFILE}-CRP0.tvpd)
if [[ "$POUND_W" != "" ]]; then
	./update_poundw_buckets ${SOURCE_BUCKET} ${DEST_BUCKET} ${POUND_W}
	./find_replace_binary_string ${OUTFILE}.bin search.bin replace.bin
fi
OpenPOWER on IntegriCloud