# moore5.script : dc_shell-t script for moore5 module. # two procedures: # 1. set_variables procedure: sets some variables. # 2. synthesize procedure: synthesizes moore5 module. # one verilog source code file used: moore5.vl proc set_variables {} { # Declare some global variables. global search_path global link_library global target_library global synthetic_library global symbol_library global compile_new_optimization global synlib_prefer_ultra_license global hdlin_report_inferred_modules global fsm_auto_inferring global hdlin_report_fsm global hdlin_infer_enumerated_types # Set some variables. set search_path {.} # should also include libraries/syn path # class.db is a standard cell library in Synopsys database format that # the design will be mapped to in the compile command of the script. set target_library class.db set link_library class.db set symbol_library class.sdb # Set the DC Ultra optimization mode and checkout the DC Ultra license. set_ultra_optimization true # Set which optimization algorithms Design Compiler uses. When true, # the new optimization algorithms in Design Compiler are turned on. # The new optimization algorithms leverage a gain-based delay # model that is automatically derived using library analysis. set compile_new_optimization true set hdlin_report_inferred_modules verbose # Check out a DesignWare Foundation license. set synlib_prefer_ultra_license true # DesignWare Foundation is set as the synthetic library. set synthetic_library dw_foundation.sldb set link_library [ concat $link_library $synthetic_library ] set fsm_auto_inferring true set hdlin_report_fsm true set hdlin_infer_enumerated_types true set compile_log_format "%cpu %mem %area %elap_time" redirect one.rpt {list $compile_log_format} } proc synthesize {} { # Generate a listing of licenses in use. redirect moore5.license.rpt { list_license } # The file, moore5.vl, is checked for errors using the analyze command. # If there's no errors, the verilog is translated to an intermediate format. # The messages generated by the analyze command are redirected to a file, # moore5.analyze.rpt. echo "analyze command with moore5.vl started." redirect moore5.analyze.rpt { set moore5_analyze_variable [ analyze -f verilog moore5.vl ] } if {$moore5_analyze_variable == 1} then { echo "analyze command with moore5.vl successfully executed." } else { echo "The analyze command with moore5.vl generated at least one error." set strings [exec grep Error moore5.analyze.rpt] echo "Error message(s) from analyze moore5.vl command:" puts $strings echo "Returning from synthesize procedure due to analyze moore5.vl error(s)." return } echo "elaborate command with the moore5 module started." redirect moore5.elaborate.rpt { set moore5_elaborate_variable [ elaborate moore5 ] } if {$moore5_elaborate_variable == 1} then { echo "elaborate command with moore5 successfully executed." } else { echo "The elaborate command with moore5 module generated at least one error." set strings [exec grep Error moore5.elaborate.rpt] echo "Error message(s) from elaborate command with moore5 module:" puts $strings echo "Returning from synthesize procedure due to elaborate moore5 error(s)." return } current_design moore5 set_local_link_library class.db # Obtain a report to see if there are any combinational loops. # If there is a combinational loop the report will CURRENT_STATE # that a timing loop is detected. # If there is no combinational loop the report will CURRENT_STATE # that no loops were detected. redirect moore5.loops.rpt { report_timing -loops } # Check for unwanted latches. The file, moore5.latch.rpt, should be an # empty file, signifying no latches. redirect moore5.latch.rpt { all_registers -level_sensitive } create_multibit -name CURRENT_STATE_reg {CURRENT_STATE_reg*} create_clock CLK -period 3 # Minimize area for a given timing constraint. set_max_area 0.0 # The design is mapped and optimized to the class # standard cell library using the compile command. # The compile log messages are redirected to the file, moore5.compile.rpt. # Other possible choices of map_effort besides high are medium and low. echo "compile command with the moore5 module started." redirect moore5.compile1.rpt { set moore5_compile_variable [ compile -map_effort high ] } if {$moore5_compile_variable == 1} then { echo "compile command with moore5 successfully executed." } else { echo "The compile command with moore5 module generated at least one error." set strings [exec grep Error moore5.compile1.rpt] echo "Error message(s) from compile command with moore5 module:" puts $strings echo "Returning from synthesize procedure due to compile moore5 error(s)." return } # Write the design to file in Synopsys internal database format. # The -hierarchy option is only needed when modules are instantiated. # To read the design back into dc_shell-t, the command is, # read_db moore5.after.first.compile.db. write -hierarchy -output moore5.after.first.compile.db # Check design for warnings and write output to file moore5_warnings. # An empty file signifies no warnings. redirect moore5.warnings.rpt { check_design } # Obtain a report summarizing information on how well # the design meets constraints that were specified. redirect moore5.constraints.rpt { report_constraints } # Obtain a report displaying some information on the current design. redirect moore5.design.rpt { report_design } # Obtain a report displaying attributes of the current design. redirect moore5.attributes.rpt { report_attributes } # Write a report listing the number of each type of cell used in the design. redirect moore5.reference.rpt { report_reference } # Write a report listing the number and type of designware components # implemented in the design for the arithmetic operators, +, -, *, <, >, etc. # In addition this report would include any resource-sharing information. # The report would also include other designware components implemented such # as large muxes. redirect moore5.resources.rpt { report_resources -hierarchy } # Optimize design after previous ungroup command. redirect moore5.compile2.rpt { compile -incremental_map -map_effort high } # Write the design to file in Synopsys internal database format. # The -hierarchy option is only needed when modules are instantiated. # To read the design back into dc_shell-t, the command is, # read_db moore5.db. write -hierarchy -output moore5.db # Obtain an area report in units of gates. # Specified as total cell area in report. redirect moore5.area.rpt { report_area } # The timing report is written to file. # Reports the longest path delay in the design in nanoseconds. # In the report, if the slack is negative, the design's timing as # specified in the set_max_delay command for a combinational design # or in a create_clock command for a synchronous design is not reached. # The clock period is the sum of the arrival time listed in the Path column # and the absolute value of the library setup time listed in the Incr column. redirect moore5.wo.true.option.timing.rpt { report_timing } # The timing report is written to file. # Reports the longest true path delay in the design in nanoseconds. # On a few moderate-sized or larger designs, this timing report is # more difficult to obtain than the previous report_timing command # without the -true option. # In the report, if the slack is negative, the design's timing as # specified in the set_max_delay command for a combinational design # or in a create_clock command for a synchronous design is not reached. # The clock period is the sum of the arrival time listed in the Path column # and the absolute value of the library setup time listed in the Incr column. # Obtain a state machine report. redirect moore5.fsm.rpt { report_fsm } redirect moore5.timing.rpt { report_timing -true } # Write the design to the file moore5.db in Synopsys internal database format. # The -hierarchy option is only needed when modules are instantiated. # To read the design back into dc_shell-t, the command is, read_db moore5.db. write -hierarchy -output moore5.db echo "script completed." } set_variables synthesize