4 # ________ _________ ____ / __ \/ ___/
5 # / ___/ _ \/ ___/ __ \/ __ \/ / / /\__ \
6 # / / / __/ /__/ /_/ / / / / /_/ /___/ /
7 # /_/ \___/\___/\____/_/ /_/\____//____/
9 # ======================================================================
12 # author: Christoph RĂ¼thing, University of Paderborn
13 # description: Build the current edk project with reconfigurable HWTs
14 # an generates the full and partial bitstreams.
16 # ======================================================================
26 xsts
=`ls ../../../implementation/system_hwt_reconf_*.prj`
28 echo '<?xml version="1.0"?>' >> xpartition.pxml
29 echo '<Project Name="'$config'" FileVersion="1.2" ProjectVersion="2.0">' >> xpartition.pxml
32 echo ' <Partition Name="/system" State="import" ImportLocation="../idle">' >> xpartition.pxml
34 echo ' <Partition Name="/system" State="implement" ImportLocation="NONE">' >> xpartition.pxml
39 idle
=`grep "reconos_hwt_idle" $xst || true`
42 echo ' <Partition Name="/system/hwt_reconf_'$i'" State="implement" ImportLocation="NONE" Reconfigurable="true" ReconfigModuleName="'$config'"></Partition>' >> xpartition.pxml
44 if [ $include_idle -eq 1 ]
46 echo ' <Partition Name="/system/hwt_reconf_'$i'" State="implement" ImportLocation="NONE" Reconfigurable="true" ReconfigModuleName="reconos_hwt_idle"></Partition>' >> xpartition.pxml
52 echo ' </Partition>' >> xpartition.pxml
53 echo '</Project>' >> xpartition.pxml
65 if [ ! -f system.xmp
]
67 echo "ERROR: Call this script from a EDK projekt folder"
71 device
=`grep "Device: " system.xmp | tr -d ' '`
74 package
=`grep "Package: " system.xmp | tr -d ' '`
77 speedgrade
=`grep "SpeedGrade: " system.xmp | tr -d ' '`
78 speedgrade
=${speedgrade#*:}
80 part
=$device$package$speedgrade
82 mhss
=`ls system_reconf_*.mhs`
85 # create working directory
87 if [ -d reconos_reconf
]
92 mkdir
-p reconos_reconf
/syn
/static
93 mkdir
-p reconos_reconf
/syn
/idle
94 mkdir
-p reconos_reconf
/data
95 cp data
/system.ucf reconos_reconf
/data
98 # generate netlists and implement design
100 # run netlist for static design and copy netlists
102 ln -fs system_static.mhs system.mhs
104 echo -e "run hwclean\nrun netlist\nexit\n" | xps
-nw system
106 # copy over generated netlists
107 cp implementation
/system_hwt_reconf
*.ngc reconos_reconf
/syn
/idle
108 cp implementation
/*.ngc reconos_reconf
/syn
/static
109 rm -f reconos_reconf
/syn
/static
/system_hwt_reconf
*
111 mkdir
-p reconos_reconf
/imp
/idle
112 cd reconos_reconf
/imp
/idle
115 # generate xpartiton.pxml for idle design
116 xpartition
"idle" 0 1
118 # implement idle design
119 ngdbuild
-sd ..
/..
/syn
/static
-sd ..
/..
/syn
/idle
-uc ..
/..
/data
/system.ucf ..
/..
/syn
/static
/system.ngc system.ngd
120 map
-w -detail -ol high
-mt 4 -timing -o system_map.ncd system.ngd system.pcf
121 par
-w -ol high
-mt 4 system_map.ncd system.ncd system.pcf
122 bitgen system.ncd system.bit system.pcf
-w -g ActiveReconfig
:Yes
-g Binary
:Yes
-g ConfigFallback
:Disable
$bitgenopt
126 # generate reconfigurable configs
129 # determine config name
130 config
=${mhs%_v?_??_?.*}
131 config
=${config#system_reconf_}
133 # create syn and imp directory
134 mkdir
-p reconos_reconf
/syn
/$config
135 mkdir
-p reconos_reconf
/imp
/$config
137 # delete old hwt implementation
138 rm -rf implementation
/system_hwt_reconf
*
139 rm -rf implementation
/cache
/system_hwt_reconf
*
142 ln -fs $mhs system.mhs
144 echo -e "run netlist\nexit\n" | xps
-nw system
147 cp implementation
/system_hwt_reconf_
*.ngc reconos_reconf
/syn
/$config
149 cd reconos_reconf
/imp
/$config
151 # generate xpartition.pxml
152 xpartition
$config 1 0
154 ngdbuild
-sd ..
/..
/syn
/static
-sd ..
/..
/syn
/$config -uc ..
/..
/data
/system.ucf ..
/..
/syn
/static
/system.ngc system.ngd
155 map
-w -detail -ol high
-mt 4 -o system_map.ncd system.ngd system.pcf
156 par
-w -mt 4 system_map.ncd system.ncd system.pcf
157 bitgen system.ncd system.bit system.pcf
-w -g ActiveReconfig
:Yes
-g Binary
:Yes
-g ConfigFallback
:Disable
$bitgenopt
162 bins
=`find reconos_reconf -iname *.bin -type f`
163 mkdir
-p reconos_reconf
/bin
168 reconos_revbin.sh
$bin reconos_reconf
/bin
/$name