forked from f4pga/prjxray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunme.sh
executable file
·78 lines (63 loc) · 2.16 KB
/
runme.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
set -ex
cat > design.xdc << EOT
set_property -dict {PACKAGE_PIN $XRAY_PIN_00 IOSTANDARD LVCMOS33} [get_ports I[0]]
set_property -dict {PACKAGE_PIN $XRAY_PIN_01 IOSTANDARD LVCMOS33} [get_ports I[1]]
set_property -dict {PACKAGE_PIN $XRAY_PIN_02 IOSTANDARD LVCMOS33} [get_ports I[2]]
set_property -dict {PACKAGE_PIN $XRAY_PIN_03 IOSTANDARD LVCMOS33} [get_ports I[3]]
set_property -dict {PACKAGE_PIN $XRAY_PIN_04 IOSTANDARD LVCMOS33} [get_ports I[4]]
set_property -dict {PACKAGE_PIN $XRAY_PIN_05 IOSTANDARD LVCMOS33} [get_ports I[5]]
set_property -dict {PACKAGE_PIN $XRAY_PIN_06 IOSTANDARD LVCMOS33} [get_ports O]
set_property LOCK_PINS {I0:A1 I1:A2 I2:A3 I3:A4 I4:A5 I5:A6} [get_cells lut]
set_property -dict {IS_LOC_FIXED 1 IS_BEL_FIXED 1 BEL SLICEL.A6LUT} [get_cells lut]
set_property CFGBVS VCCO [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
set_property BITSTREAM.GENERAL.PERFRAMECRC YES [current_design]
EOT
cat > design.v << EOT
module top(input [5:0] I, output O);
LUT6 #(.INIT(64'h8000000000000000)) lut (
.I0(I[0]),
.I1(I[1]),
.I2(I[2]),
.I3(I[3]),
.I4(I[4]),
.I5(I[5]),
.O(O)
);
endmodule
EOT
cat > design.tcl << EOT
create_project -force -part $XRAY_PART design design
read_xdc design.xdc
read_verilog design.v
synth_design -top top
place_design
route_design
write_checkpoint -force design.dcp
source logicframes.tcl
source tiledata.tcl
EOT
rm -f design.log
${XRAY_VIVADO} -nojournal -log design.log -mode batch -source design.tcl
{
sed -e '/^--tiledata--/ { s/[^ ]* //; p; }; d;' design.log
for f0 in logicframes_SLICE_*_0.bit; do
f1=${f0%_0.bit}_1.bit
${XRAY_BITREAD} -x -o ${f0%.bit}.asc $f0 > /dev/null
${XRAY_BITREAD} -x -o ${f1%.bit}.asc $f1 > /dev/null
f0=${f0%.bit}.asc
f1=${f1%.bit}.asc
n=${f0%_0.asc}
n=${n#logicframes_}
echo SLICEBIT $n $( diff $f0 $f1 | grep '^>' | cut -c3-; )
done
} > grid-${XRAY_PART}-db.txt
python3 gridinfo-txt2json.py grid-${XRAY_PART}-db ${XRAY_PART}