Add script to copy run results to dirs
diff --git a/openlane/user_proj_example/copy_results.sh b/openlane/user_proj_example/copy_results.sh index acee4ad..340b15a 100755 --- a/openlane/user_proj_example/copy_results.sh +++ b/openlane/user_proj_example/copy_results.sh
@@ -14,13 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -x +set -ex -IN_PATH="./$1" -OUT_PATH="../.." +IN_PATH="$(realpath "$1")" +OUT_PATH="$(realpath ../..)" ARTIFACT="user_proj_example" -echo "Copying results from '${IN_PATH}' to '${OUT_PATH}'" +# echo "Copying results from '${IN_PATH}' to '${OUT_PATH}'" cp -pf "${IN_PATH}/results/routing/${ARTIFACT}.def" "${OUT_PATH}/def/${ARTIFACT}.def" cp -pf "${IN_PATH}/results/magic/${ARTIFACT}.gds" "${OUT_PATH}/gds/${ARTIFACT}.gds" @@ -29,11 +29,17 @@ cp -pf "${IN_PATH}/results/lvs/${ARTIFACT}.lvs.powered.v" "${OUT_PATH}/verilog/gl/${ARTIFACT}.v" cp -pf "${IN_PATH}/results/magic/${ARTIFACT}.spice" "${OUT_PATH}/spi/lvs/${ARTIFACT}.spice" -echo "Copying summary" -cp -pf "${IN_PATH}/reports/final_summary_report.csv" "${OUT_PATH}/openlane/${ARTIFACT}/" +# echo "Copying summary" +# cp -pf "${IN_PATH}/reports/final_summary_report.csv" "${OUT_PATH}/openlane/${ARTIFACT}/" -# echo "Removing old results folder and copying all results..." -# rm -rf "${OUT_PATH}/runs/${ARTIFACT}/*" -# cp -prf "${IN_PATH}/*" "${OUT_PATH}/openlane/${ARTIFACT}/runs/${ARTIFACT}" +echo "Removing old results folder and logs / reports" +mkdir -p "${OUT_PATH}/openlane/${ARTIFACT}/results" +rm -rf "${OUT_PATH}/openlane/${ARTIFACT}/results/*" +(cd "${IN_PATH}" && + find . -iregex '.*\.\(rpt\|txt\|log\|tcl\|csv\|drc\)' \ + -exec cp -pv --parents {} "${OUT_PATH}/openlane/${ARTIFACT}/results/" ';') + +# Compress known large log files +gzip -9 "${OUT_PATH}/openlane/${ARTIFACT}/results/reports/routing/antenna.rpt" echo "Done"