#*************************************************************
# * this is the static timing analysis(STA) script for encoder_sim.v.
# * using the PrimeTime tool.
#*************************************************************
##################################################################
# below are parameters that you will want to set for the design
##################################################################
# list of all HDL files in the design
set myFiles [list encoder_sim.v] ;# verilog or VHDL
set sdfFiles [list encoder.SDF] ;# sdf
set myClk clk ;# The name of your clock
# Timing and loading information
set myPeriod_ns 0.8 ;# desired clock period (in ns) (sets speed goal)
set myUncertainty_ns 0.03 ;# uncertainty of clock (in ns)
set myTransition_ns 0.08 ;# transition of clock (in ns)
set myInDelay_ns 0.30 ;# delay from clock to inputs valid
set myOutDelay_ns 0.30 ;# delay from clock to output valid
set myInputBuf INVX4M ;# name of cell driving the inputs
set myLoadLibrary ss_1v62_125c ;# name of library the cell comes from
set myLoadPin A ;# name of pin that the outputs drive
##################################################################
# read the design data
##################################################################
set search_path "." ;# set the search path
set link_path "* ./smic18m_library/ss_1v62_125c.db" ;# set the link path
read_verilog $myFiles ;# read in the verilog files
# set and link the top design before reading in sdf file
current_design encoder
link_design
read_sdf $sdfFiles ;# read in the sdf file
##################################################################
# constrain the design
##################################################################
# set the clock attribute
create_clock -period $myPeriod_ns $myClk
set_propagated_clock [get_ports clk]
set_clock_uncertainty $myUncertainty_ns $myClk
set_clock_transition $myTransition_ns $myClk
# set the input and output delay relative to myClk
set_input_delay $myInDelay_ns -clock $myClk [remove_from_collection [all_inputs] $myClk]
set_output_delay $myOutDelay_ns -clock $myClk [all_outputs]
##################################################################
# specify the environment and analysis conditions
##################################################################
# Set the driving cell for all inputs except the clock
# The clock has infinite drive by default.
set_driving_cell -library $myLoadLibrary -lib_cell $myInputBuf [remove_from_collection [all_inputs] $myClk]
# set the load of the circuit outputs in terms of the load
of the next cell that they will drive.
set_load [load_of [format "%s%s%s%s%s" $myLoadLibrary "/" $myInputBuf "/" $myLoadPin]] [all_outputs]
set_false_path -from [get_ports set]
set_false_path -to [get_ports MSB_out_cp
set_false_path -to [get_ports MSB_out_cn
set_false_path -to [get_ports ISB_out_cp
set_false_path -to [get_ports ISB_out_cn
set_false_path -to [get_ports LSB_out_cp
set_false_path -to [get_ports LSB_out_cn