Skip to content
Snippets Groups Projects
Unverified Commit da88a983 authored by Recolic Keghart's avatar Recolic Keghart
Browse files

better `vivadow init`

parent 5e0c7b44
No related branches found
No related tags found
No related merge requests found
...@@ -153,12 +153,18 @@ function clean_real_project () { ...@@ -153,12 +153,18 @@ function clean_real_project () {
echo "real_project cleaned" echo "real_project cleaned"
} }
function cp_with_backup () {
a="$1"
b="$2"
[[ -f "$b" ]] && mv "$b" "$b.backup"
cp "$a" "$b"
}
function do_init () { function do_init () {
mkdir -p constraint build src mkdir -p constraint build src
[[ -f ./Vivadofile ]] && mv ./Vivadofile ./Vivadofile.backup cp_with_backup "$my_path"/template/Vivadofile ./Vivadofile
cp "$my_path"/template/Vivadofile ./Vivadofile
echo "I'll provide a constraint file for xc7a100tcsg324-1, which is used by HUST students. Remove it if it's not your case." echo "I'll provide a constraint file for xc7a100tcsg324-1, which is used by HUST students. Remove it if it's not your case."
cp "$my_path"/template/xc7a100tcsg324-1.xdc ./constraint cp_with_backup "$my_path"/template/xc7a100tcsg324-1.xdc ./constraint/xc7a100tcsg324-1.xdc
echo "Vivadow project inited." echo "Vivadow project inited."
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment