################################################################################
# Default Script for Lattice ISP Lever par (Place & Route)
# You can comment any line using a # character to disable the option
# The .Replace* strings denote stings that will be replaced by the system
# to disable this feature just delete the string and replace it with the
# desired hardcoded value
# Any <value> needs to be udpated manually by the user.  They can be replaced
# with a .Replace* string alternatively.  These values are used for the
# modular design process and are not needed for Altium Designer flows.
################################################################################

#####################
#  GENERAL OPTIONS  #
#####################

################################################################################
# Skip constructive placement. Run only optimizing placement, then enter the
# router. Existing routes are ripped up before routing begins. Use only on a
# design that has already been placed. 
# To run re-entrant (also called incremental) routing, use the options -kp to
# skip placement (constructive and optimizing) and begin routing, leaving the
# existing routing in place.
################################################################################
# -k 

################################################################################
# Do not run placement (constructive or optimizing) route only. Existing routes
# are ripped up before routing begins. 
# To run re-entrant (also called incremental) routing, use the options -kp to
# skip placement and begin routing, leaving the existing routing in place
################################################################################
# -p


################################################################################
# Do not route the design.
################################################################################
# -r

################################################################################
# Overrides the default speed grade.
################################################################################
# -sp <speed>

################################################################################
# If the specified output file already exists, over-write the existing file
# (including the input file). If the specified output is a directory, overwrite
# files in the directory. With this option, any .par , .pad , and .dly files
# generated will overwrite existing .par , .pad , and .dly files.
################################################################################
# -w

################################################################################
# Do not use timing-driven option for this PAR run.
################################################################################
.ReplaceDoNotPerformTimingDrivenPAR -x  

################################################################################
# To specify a guide file for guided PAR use the -g option with the file name
# of the guide file. Guided PAR decreases PAR runtime after minor changes to the
# physical design file (.ncd) by using a previously placed and/or routed .ncd
# file to "guide" the placement and routing of the new .ncd file. 
# For PAR to use a guide_file for design, PAR first tries to find a guiding
# object (i.e., nets, components, and/ or macros) in the guide_file that
# corresponds to an object in the new .ncd file. A guiding object is an object
# in the guide_file of the same name, type, and connectivity as an object in the
# new .ncd file. A guided object is an object in the new .ncd file that has a
# corresponding guiding object in the guide_file.
#
# Syntax:
# -g <guide_file[.ncd]> -mf <matching_factor> -gv
# where: 
# -mf specifies the matching factor or percentage of the same connectivity that
#   guiding and guided objects must have. 
# <matching_factor> is a number ranging from 1 to 100 and is defaulted to 100. 
# -gv specifies that the names of all guided objects are also listed in the 
#   .gpr file.
#
# After PAR compares the objects in each file, it places and routes each object
# of the new .ncd file based on the placement/routing of its guiding object. If
# PAR fails to find a guiding object for a component, for example, PAR will try
# to find one based on the connectivity. PAR appends the names of all objects
# which do not have a guiding object in the guide_file to the Guided PAR Report
# (.gpr) file.
# After all guided objects are placed and routed, PAR locks down the locations
# of all guided components and macros and then proceeds with its normal
# operation.
################################################################################
# -g <guidefile.ncd>
# -mf <matching_Factor>
# -gv

################################################################################
# Adds the Delay Summary Report in the .par file and creates the delay file
# (in .dly format) at the end of the par run.
################################################################################
.ReplaceCreateDelayFile -y


#####################
# PLACEMENT OPTIONS #
#####################

################################################################################
# Automatic level skipping for constructive placement.
# When you use -a, the -n option controls the maximum number of iterations per
# level. You cannot use -a with -m or -r options.
# (Cost tables). Number of iterations (place and route passes) performed at the
# effort level specified by the -l option. Each iteration uses a different cost
# table during placement and will produce a different .ncd file. If you enter
# n 0, PAR continues to run until solved, stopping either after the design is
# fully routed and all constraints are met or after completing the iteration at
# cost table 100. 
#
#If you do not specify the -n option, one place and route iteration runs. If you
# specify a -t option, the iterations begin at the cost table specified by -t.
################################################################################
# -a
# -n <0-100>

################################################################################
# Specifies the effort level of the design from 1 (simplest designs) to 5 (most
# complex designs). Default is level 5. 
################################################################################
-l .ReplaceEffortLevel

################################################################################
# Minimize the clock skew on all clock nets. 
################################################################################
.ReplaceMinimizeClockSkew -q 

################################################################################
# Save the number of best results for this run. If not used, all results are
# saved.
################################################################################
# -s <1-100>

################################################################################
# Start placement at the specified cost table. Default is 1.
################################################################################
# -t <1-100>


#####################
#  ROUTING OPTIONS  #
#####################

################################################################################
# Run number of cost-based cleanup passes of the router. 
################################################################################
-c .ReplaceCostBasedCleanupPasses

################################################################################
# Run number of delay-based cleanup passes of the router. To run delay-based
# cleanup passes only on designs that have been routed to completion (100%
# routed), use the -e option instead of -d.
################################################################################
# -d <#>

################################################################################
# Run number of delay-based cleanup passes of the router on completely-routed
# designs only. 
################################################################################
# -e <#>

################################################################################
# Run a maximum number of passes, stopping earlier only if the routing goes to
# 100% completion and all constraints are met. If not used, runs to completion
# or until router decides it cannot complete.
################################################################################
# -i <1-1000>



################################################################################
# Input file
################################################################################
.ReplaceInputFile

################################################################################
# Output file
################################################################################
.ReplaceOutputFile

################################################################################
# Preference file
################################################################################
.ReplacePreferenceFile