File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # This script is intended to be used on RR graph XML files generated by VPR.
4+ # If the architecture is a 2D architecture, you can simply call this script
5+ # to remove all attributes related to 3D FPGA support (layer="0",
6+ # layer_low="0", layer_high="0"). In VPR, these values default to 0.
7+
8+ # This also helps convert older RR graph files that used the "layer" attribute
9+ # instead of "layer_low" and "layer_high" for nodes, by removing the "layer" attribute
10+ # altogether. As a result, VPR can read the file without issues, and it slightly
11+ # reduces the file size for 2D architectures.
12+
13+ # Exit if any command fails
14+ set -e
15+
16+ # Check that a file was provided
17+ if [ $# -ne 1 ]; then
18+ echo " Usage: $0 <filename>"
19+ exit 1
20+ fi
21+
22+ FILE=" $1 "
23+
24+ # Check file existence
25+ if [ ! -f " $FILE " ]; then
26+ echo " Error: File '$FILE ' not found."
27+ exit 1
28+ fi
29+
30+ # Remove all occurrences in-place
31+ sed -i \
32+ -e ' s/layer="0"//g' \
33+ -e ' s/layer_low="0"//g' \
34+ -e ' s/layer_high="0"//g' \
35+ " $FILE "
36+
37+ echo " Removed layer attributes from '$FILE '."
You can’t perform that action at this time.
0 commit comments