Fixing floorplan script to use the right list index
Floorplan now runs through!
# SC setup (!!DO NOT EDIT THIS SECTION!!)
########################################################
-source -verbose ./sc_setup.tcl
+source ./sc_setup.tcl
-set scriptdir [file dirname $SC_FLOORPLAN_SCRIPT]
+set scriptdir [file dirname [lindex $SC_FLOORPLAN_SCRIPT 0]]
source -verbose $scriptdir/process.tcl
source -verbose $scriptdir/library.tcl
+set jobid [lindex $SC_FLOORPLAN_JOBID 0]
+set topmodule [lindex $SC_TOPMODULE 0]
+set mainlib [lindex $SC_LIB 0]
+
#Inputs
-set input_verilog "../../syn/job${SC_SYN_JOBID}/${SC_TOPMODULE}.v"
-set input_sdc "../../syn/job${SC_SYN_JOBID}/${SC_TOPMODULE}.sdc"
-set input_def "$SC_DEF"
+set input_verilog "../../syn/job$jobid/$topmodule.v"
+set input_sdc $SC_CONSTRAINTS
+set input_def $SC_DEF
#Outputs
-set output_verilog "${SC_TOPMODULE}.v"
-set output_def "${SC_TOPMODULE}.def"
-set output_sdc "${SC_TOPMODULE}.sdc"
-set output_report "${SC_TOPMODULE}.report"
-set output_qor "${SC_TOPMODULE}.json"
+set output_verilog "$topmodule.v"
+set output_def "$topmodule.def"
+set output_sdc "$topmodule.sdc"
+set output_report "$topmodule.report"
+set output_qor "$topmodule.json"
################################################################
# Read Inputs
@@ -30,29 +34,37 @@ set output_qor "${SC_TOPMODULE}.json"
read_verilog $input_verilog
-link_design $SC_TOPMODULE
+link_design $topmodule
+
+#Read in constraints if there is a clock and it matches
+
+set a [lindex $SC_CLK 0]
if {[file exists $input_sdc]} {
read_sdc $input_sdc
}
################################################################
-# Floorplan
+# Create a floorplan
################################################################
if {[file exists $input_def]} {
read_def $input_def
-} elseif {[llength $SC_DIESIZE] == 4} {
+} else {
+
+ if {[llength $SC_DIESIZE] == 4} {
initialize_floorplan -die_area $SC_DIESIZE \
-core_area $SC_CORESIZE \
-tracks ./sc_tracks.txt \
-site $SC_SITE
} else {
- initialize_floorplan -utilization $SC_DENSITY \
- -aspect_ratio $SC_ASPECTRATIO \
- -core_space $SC_MARGIN \
+ initialize_floorplan -utilization [lindex $SC_DENSITY 0] \
+ -aspect_ratio [lindex $SC_ASPECTRATIO 0] \
+ -core_space [lindex $SC_MARGIN 0]\
-tracks ./sc_tracks.txt \
- -site $SC_SITE
+ -site [lindex $SC_SITE 0]
+ }
+
}
################################################################
