1 |
7 |
fafa1971 |
#!/bin/bash
|
2 |
|
|
|
3 |
|
|
# Set source and destination directories
|
4 |
|
|
SRC_DIR=$T1_ROOT/design/sys/iop
|
5 |
|
|
DST_DIR=$S1_ROOT/hdl/rtl/sparc_core
|
6 |
|
|
|
7 |
|
|
# Clean destination directory
|
8 |
15 |
fafa1971 |
rm -f $DST_DIR/*.*
|
9 |
|
|
rm -f $DST_DIR/include/*.*
|
10 |
7 |
fafa1971 |
|
11 |
|
|
# Copy all the Verilog files of the SPARC Core into destination directory
|
12 |
|
|
cp $SRC_DIR/include/*.h $DST_DIR/include
|
13 |
|
|
cp $SRC_DIR/srams/rtl/*.v $DST_DIR
|
14 |
|
|
cp $SRC_DIR/analog/bw_clk/rtl/*.v $DST_DIR
|
15 |
|
|
cp $SRC_DIR/analog/bw_rng/rtl/*.v $DST_DIR
|
16 |
|
|
find $SRC_DIR/common -name "*.v" -exec cp {} $DST_DIR \;
|
17 |
|
|
find $SRC_DIR/pr_macro -name "*.v" -exec cp {} $DST_DIR \;
|
18 |
|
|
find $SRC_DIR/sparc -name "*.v" -exec cp {} $DST_DIR \;
|
19 |
|
|
|
20 |
|
|
# Remove synthetized files -- if any
|
21 |
|
|
find $DST_DIR -name "*_flat.v" -exec rm -f {} \;
|
22 |
|
|
find $DST_DIR -name "*_flat_nc.v" -exec rm -f {} \;
|
23 |
|
|
find $DST_DIR -name "*_hier.v" -exec rm -f {} \;
|
24 |
|
|
rm -f $DST_DIR/bw_r_l2t.v
|
25 |
|
|
|
26 |
|
|
# Clean the files by substituting the $error System Task
|
27 |
|
|
for file in $DST_DIR/*.v ; do
|
28 |
|
|
sed -e 's/\$error/\$display/g' $file | sed -e 's/negedge rclk or rst_l/negedge rclk/g' > $DST_DIR/temp.v
|
29 |
|
|
mv -f $DST_DIR/temp.v $file
|
30 |
|
|
done
|
31 |
|
|
|
32 |
|
|
# Hack the SPARC Core to add the external stall input from the bridge
|
33 |
|
|
sed -e 's/pcx_spc_grant_px,/pcx_spc_grant_px, wbm_spc_stallreq,/g' $DST_DIR/sparc.v |
|
34 |
|
|
sed -e 's/pcx_spc_grant_px;/pcx_spc_grant_px; input wbm_spc_stallreq;/g' |
|
35 |
|
|
sed -e 's/sparc_ifu ifu(/sparc_ifu ifu( .wbm_spc_stallreq(wbm_spc_stallreq),/g' > $DST_DIR/sparc_TMP.v
|
36 |
|
|
mv -f $DST_DIR/sparc_TMP.v $DST_DIR/sparc.v
|
37 |
|
|
sed -e 's/ffu_ifu_stallreq,/ffu_ifu_stallreq, wbm_spc_stallreq,/g' $DST_DIR/sparc_ifu.v |
|
38 |
|
|
sed -e 's/ffu_ifu_stallreq;/ffu_ifu_stallreq; input wbm_spc_stallreq;/g' |
|
39 |
|
|
sed -e 's/sparc_ifu_fcl fcl(/sparc_ifu_fcl fcl( .wbm_spc_stallreq(wbm_spc_stallreq),/g' > $DST_DIR/sparc_ifu_TMP.v
|
40 |
|
|
mv -f $DST_DIR/sparc_ifu_TMP.v $DST_DIR/sparc_ifu.v
|
41 |
|
|
sed -e 's/ffu_ifu_stallreq,/ffu_ifu_stallreq, wbm_spc_stallreq,/g' $DST_DIR/sparc_ifu_fcl.v |
|
42 |
|
|
sed -e 's/assign all_stallreq = ifq_fcl_stallreq/assign all_stallreq = ifq_fcl_stallreq | wbm_spc_stallreq/g' > $DST_DIR/sparc_ifu_fcl_TMP.v
|
43 |
|
|
mv -f $DST_DIR/sparc_ifu_fcl_TMP.v $DST_DIR/sparc_ifu_fcl.v
|
44 |
|
|
|
45 |
|
|
# Copy also behavioral libraries used for RTL simulations
|
46 |
|
|
DST_DIR=$S1_ROOT/hdl/behav/sparc_libs
|
47 |
15 |
fafa1971 |
rm -f $DST_DIR/*.*
|
48 |
7 |
fafa1971 |
cp $SRC_DIR/../../../lib/m1/m1.behV $DST_DIR/m1_lib.v
|
49 |
|
|
cp $SRC_DIR/../../../lib/u1/u1.behV $DST_DIR/u1_lib.v
|
50 |
|
|
|