-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathsyn.tcl
83 lines (66 loc) · 3.24 KB
/
syn.tcl
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
78
79
80
81
82
83
##############################################################################
## This file is part of 'SLAC Firmware Standard Library'.
## It is subject to the license terms in the LICENSE.txt file found in the
## top-level directory of this distribution and at:
## https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
## No part of 'SLAC Firmware Standard Library', including this file,
## may be copied, modified, propagated, or distributed except according to
## the terms contained in the LICENSE.txt file.
##############################################################################
# Load RUCKUS environment and library
source $::env(RUCKUS_DC_DIR)/proc.tcl
source $::env(RUCKUS_DC_DIR)/env_var.tcl
# Init the global variable
set ::DIR_PATH ""
ResetSrcFileLists
# Set the number of maximum cores
set_host_option -max_cores ${MAX_CORES}
# Check for user import.tcl script
if { [file exists ${PROJ_DIR}/syn/import.tcl] == 1 } {
source ${PROJ_DIR}/syn/import.tcl
} else {
# Include DesignWare synthetic library
set synthetic_library "dw_foundation.sldb"
source -echo -verbose ${pdk_dir}/scripts/syn_libs.tcl
# Setup milkyway reference library
create_mw_lib -technology $milkyway_tech -mw_reference_library $milkyway_ref_lib "$design"
open_mw_lib "$design"
# Setup TLU Plus files
lappend search_path ${TLU_PLUS_FILES}
set_tlu_plus_files -tech2itf_map $tluplus_tech2itf_map_file -max_tluplus $max_tluplus_file
check_tlu_plus_files
# Set the set_svf path
set_svf ${SYN_OUT_DIR}/svf/${design}.svf
}
# Set the work path directory
define_design_lib WORK -path ${SYN_DIR}/work
# Load the top-level ruckus.tcl
source $::env(PROJ_DIR)/ruckus.tcl
# Source the constraints file
source ${PROJ_DIR}/syn/compile.tcl
# Check for user export.tcl script
if { [file exists ${PROJ_DIR}/syn/export.tcl] == 1 } {
source ${PROJ_DIR}/syn/export.tcl
} else {
# Write outputs
change_names -rules verilog -hierarchy
write -format verilog -hierarchy -output ${SYN_OUT_DIR}/${design}_g.v
write -format ddc -hierarchy -output ${SYN_OUT_DIR}/${design}_g.ddc
write_sdf ${SYN_OUT_DIR}/${design}_g.sdf
write_sdc ${SYN_OUT_DIR}/${design}_g.sdc
# Copy the .sdf and .v to project image directory
exec cp -f ${SYN_OUT_DIR}/${design}_g.sdf ${IMAGES_DIR}/${IMAGENAME}.sdf
exec cp -f ${SYN_OUT_DIR}/${design}_g.sdc ${IMAGES_DIR}/${IMAGENAME}.sdc
exec cp -f ${SYN_OUT_DIR}/${design}_g.v ${IMAGES_DIR}/${IMAGENAME}.v
# Create compressed versions of the files due to Github's 100MB limit on git-lfs
exec gzip -c -f -9 ${SYN_OUT_DIR}/${design}_g.sdf > ${IMAGES_DIR}/${IMAGENAME}.sdf.gz
exec gzip -c -f -9 ${SYN_OUT_DIR}/${design}_g.sdc > ${IMAGES_DIR}/${IMAGENAME}.sdc.gz
exec gzip -c -f -9 ${SYN_OUT_DIR}/${design}_g.v > ${IMAGES_DIR}/${IMAGENAME}.v.gz
# Generate reports
report_area -nosplit -hierarchy > ${SYN_OUT_DIR}/reports/area.rpt
report_timing -nosplit -transition_time -nets -attributes -delay_type max > ${SYN_OUT_DIR}/reports/timing.rpt
report_timing -nosplit -transition_time -nets -attributes -delay_type min >> ${SYN_OUT_DIR}/reports/timing.rpt
report_power -nosplit -hierarchy > ${SYN_OUT_DIR}/reports/power.rpt
report_resources -nosplit -hierarchy > ${SYN_OUT_DIR}/reports/resources.rpt
exit
}