Skip to content

Commit

Permalink
Merge pull request f4pga#1570 from antmicro/mglb/guess-device-from-pa…
Browse files Browse the repository at this point in the history
…rt-name

xc7/toolchain_wrappers: find device/arch using part name
  • Loading branch information
kgugala committed Jul 3, 2020
2 parents 9a392b6 + 3f58546 commit 3abef09
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xc/xc7/toolchain_wrappers/synth
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
VERILOG_FILES=()
XDC_FILES=()
TOP=top
DEVICE=""
DEVICE="*"
PART=""

VERILOGLIST=0
Expand Down
7 changes: 7 additions & 0 deletions xc/xc7/toolchain_wrappers/vpr_common
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ function parse_args {
esac
done

if [ -z $DEVICE ] && [ -n $PART ]; then
# Try to find device name. Accept only when exactly one is found
PART_DIRS=(${MYPATH}/../share/symbiflow/arch/*/${PART})
if [ ${#PART_DIRS[@]} -eq 1 ]; then
DEVICE=$(basename $(dirname "${PART_DIRS[0]}"))
fi
fi
if [ -z $DEVICE ]; then
echo "Please provide device name"
exit 1
Expand Down
10 changes: 8 additions & 2 deletions xc/xc7/toolchain_wrappers/write_bitstream
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ while true; do
done

if [ -z $DEVICE ]; then
echo "Please provide device name"
exit 1
# Try to find device name. Accept only when exactly one is found
PART_DIRS=(${XRAY_DATABASE_DIR}/*/${PART})
if [ ${#PART_DIRS[@]} -eq 1 ]; then
DEVICE=$(basename $(dirname "${PART_DIRS[0]}"))
else
echo "Please provide device name"
exit 1
fi
fi

if [ -z $FASM ]; then
Expand Down

0 comments on commit 3abef09

Please sign in to comment.