evaluate_ip.tcl.template 2.52 KB
Newer Older
1
2
3
#
# Copyright (C) 2014 Jens Korinth, TU Darmstadt
#
4
# This file is part of Tapasco (TPC).
5
#
6
# Tapasco is free software: you can redistribute it and/or modify
7
8
9
10
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
11
# Tapasco is distributed in the hope that it will be useful,
12
13
14
15
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
17
# along with Tapasco.  If not, see <http://www.gnu.org/licenses/>.
18
19
20
21
22
23
24
#
# @file		evaluate_ip.tcl.template
# @brief	Tcl template to get area and timing estimates for IPXACT cores.
# @authors	J. Korinth (jk@esa.cs.tu-darmstadt.de
# 

# source base lib
25
source -notrace "$::env(TAPASCO_HOME)/common/common.tcl"
26
27
28
29
30
31
32
33
34
35
36

# suppress most messages except errors
set_msg_config -severity INFO -suppress
set_msg_config -severity WARNING -suppress
set_param general.maxThreads 1

# add files
add_files @@SRC_FILES@@
# add_files -fileset constrs_1 @@XDC_FILES@@
foreach script [list @@TCL_FILES@@] { source $script }

37
38
39
# find top
set top [lindex [find_top] 0]

40
# synthesize and optimize netlist
41
42
#synth_design -part @@PART@@ -top $top -no_iobuf -mode out_of_context -retiming
synth_design -part @@PART@@ -top $top -mode out_of_context -retiming
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

# read switching activity files (if any)
foreach saif [glob -nocomplain *.saif] {
  read_saif $saif
}

# write design checkpoint
write_checkpoint -force @@SYNTH_CHECKPOINT@@

# set clock
set clock_ports [get_ports -filter {DIRECTION == IN && (NAME =~ *clk* || NAME =~ *CLK*)}]
puts "clock_ports = $clock_ports"
create_clock -name clk -period @@PERIOD@@ $clock_ports
set_property HD.CLK_SRC BUFGCTRL_X0Y0 $clock_ports

# place and route
opt_design
place_design
phys_opt_design
route_design

# write design checkpoint
write_checkpoint -force @@IMPL_CHECKPOINT@@

# report timing
report_timing_summary -quiet -datasheet -file @@REPORT_TIMING@@
# report utilization
report_utilization -quiet -file @@REPORT_UTILIZATION@@

# recalculate achieved frequency and set new period (for realistic power values)
73
set wns [tapasco::get_wns_from_timing_report @@REPORT_TIMING@@]
74
75
76
77
78
79
80
if {$wns < 0} {
  create_clock -name clk -period [expr "@@PERIOD@@ - $wns"] $clock_ports
}

# report power
report_power -quiet -file @@REPORT_POWER@@

81
82
83
84
# write netlist file
set netlist "@@NETLIST@@"
write_edif $netlist

85
86
# done!
exit