OpenCores
URL https://opencores.org/ocsvn/ssbcc/ssbcc/trunk

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [core/] [9x8/] [build/] [vivado-xc7/] [vivado/] [make] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 sinclairrf
#!/bin/bash
2
#
3
# Script to build the micro controller for various 7-series FPGA.
4
#
5
# Usage:
6 7 sinclairrf
#   ./make -v 2014.2 -d xc7a35t-3cpg236 -p 100 [-o "-propconst -sweep -remap -resynth_area"]
7 6 sinclairrf
# Note:  See the pinouts directory for a list of available devices.
8
 
9 7 sinclairrf
while getopts "hd:o:p:v:" OPTNAME; do
10
  case ${OPTNAME} in
11
    ( h ) echo "Usage:  run [-t uc_name] [-v ISE_version]" > /dev/stderr;
12
          echo "Where:" > /dev/stderr;
13
          echo "  uc_name is one of the .9x8 files in ../uc" > /dev/stderr;
14
          echo "  ISE_version is an ISE version number" > /dev/stderr;
15
          exit 0;;
16
    ( d ) DEVICE="${OPTARG}";;
17
    ( o ) OPTPAR="${OPTARG}";;
18
    ( p ) PERIOD="${OPTARG}";;
19
    ( v ) VERSION="${OPTARG}";;
20
  esac
21
done
22
 
23
VERSION="/opt/Xilinx/Vivado/${VERSION}";
24
if [ ! -d "${VERSION}" ]; then
25
  echo "FATAL ERROR:  \"${VERSION}\" not found" > /dev/stderr;
26
  exit 1;
27
fi
28
source "${VERSION}/settings64.sh";
29
 
30 6 sinclairrf
# Ensure a version of vivado has been specified.
31
 
32
if [ -z "`which vivado 2> /dev/null`" ]; then
33
  echo "FATAL ERROR:  Vivado version not specified" > /dev/stderr;
34
  exit 1;
35
fi
36
 
37
# Build the micro controller and convert it to a Vivado IP.
38
 
39
( cd ../uc_led; ./make ) || { echo "FATAL ERROR -- uc build failed" > /dev/stderr; exit 1; }
40
 
41
#
42
# Run the Vivado TCL script.
43
#
44
 
45
cat < clock.xdc
46
create_clock -period ${PERIOD} [get_ports {pi_clk}]
47
EOF
48
 
49
time vivado -mode tcl <
50
# Create the project.
51
create_project build . -part ${DEVICE} -force
52
set_property constrs_type XDC [current_fileset -constrset]
53
# Create the top-level design
54
set_property ip_repo_paths { ../uc_led } [current_fileset];
55
update_ip_catalog
56
remove_files -quiet build.scrs/sources_1/bd/top/top.bd
57
create_bd_design "top"
58
create_bd_cell -type ip -vlnv sinclairrf.com:none:uc_led:1.0 uc_led
59
create_bd_port -dir I pi_clk
60
create_bd_port -dir I pi_rst
61
create_bd_port -dir O po_led
62
foreach {sig1 sig2} {
63
  pi_clk        uc_led/i_clk
64
  pi_rst        uc_led/i_rst
65
  uc_led/o_led  po_led
66
} {
67
  connect_bd_net [get_bd_pins \$sig1] [get_bd_pins \$sig2];
68
}
69
save_bd_design
70
# Prepare for synthesis.
71
generate_target {Synthesis} [get_files build.srcs/sources_1/bd/top/top.bd]
72
generate_target {Implementation} [get_files build.srcs/sources_1/bd/top/top.bd]
73
set_property top top [current_fileset]
74
# Run synthesis.
75
read_xdc clock.xdc
76
synth_design
77
report_clocks
78
# Incorporate device-dependent pinout.
79
read_xdc pinouts/${DEVICE}.xdc
80
# Place and route the design.
81 7 sinclairrf
opt_design ${OPTPAR}
82 6 sinclairrf
place_design
83
route_design
84
# Performance reports.
85
report_utilization
86
report_timing_summary
87
EOF
88
 
89
#
90
# Extract desired performance statistics from the log file.
91
#
92
 
93 7 sinclairrf
gawk '
94
BEGIN { usage_match=0; slack=999999; }
95
/^1\. Slice Logic/ || /^2\. Slice Logic Distribution/ || /^3\. Memory/ {usage_match=1; next; }
96
/^[0-9]\./ { usage_match=0; next; }
97
usage_match && /Slice LUTs/ { LUTs=$5; }
98
usage_match && ($2 == "Slice") { slices=$4; }
99
usage_match && ($2 == "RAMB18") { ramb18=$4; }
100
/^Slack/ { this_slack=1*$4; if (this_slack < slack) slack=this_slack; }
101
END {
102
  print "*** Performance Statistics ***";
103
  print "LUTs   =",LUTs;
104
  print "Slices =",slices;
105
  print "Slack  =",slack;
106
  print "RAMB18 =",ramb18;
107
}
108
' vivado.log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.