#!/bin/sh
#Author: Andrea Guerrieri - EPFL-LAP email:andrea.guerrieri@epfl.ch
#Dynamatic hdl writer script
#ver.1.0


HDL_DIR=hdl
SCRIPTS_DIR=scripts



dot2vhdl $2

#conv_dc $1

mkdir -p $1/$HDL_DIR


mv $1/reports/*.vhd $1/$HDL_DIR 2> /dev/null
mv $1/reports/*.v $1/$HDL_DIR 2> /dev/null
mv $1/reports/*.tcl $1/$HDL_DIR 2> /dev/null

cp $DHLS_INSTALL_DIR/etc/dhls/components/*.vhd $1/$HDL_DIR 2> /dev/null
cp $DHLS_INSTALL_DIR/etc/dhls/components/*.v $1/$HDL_DIR 2> /dev/null
cp $DHLS_INSTALL_DIR/etc/dhls/components/*.tcl $1/$HDL_DIR 2> /dev/null


mv -f *.v $1/$HDL_DIR > /dev/null 2>&1

rm -f *.fir > /dev/null 2>&1

rm -f *.json > /dev/null 2>&1

mkdir -p $1/$SCRIPTS_DIR

mv -f $1/reports/*.tcl $1/$SCRIPTS_DIR
rm -r $1/$SCRIPTS_DIR

rm -f $1/reports/*.txt






