| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
Quartus Software Application Note November 1999, ver. I
Top Searches for this datasheetScripting with Quartus Software Application Note November 1999, ver. Introduction Developing running tool command language (Tcl) scripts Quartussoftware allows designers perform wide range simple complex functions, such compiling design writing procedures automate common tasks. This application note describes develop scripts Quartus software. Quartus software supports version 8.03, which supplied Scriptics Corporation (http://www.scriptics.com). What Tcl? popular scripting language that similar many shell scripting high-level programming languages. provides support control structures, variables, network socket access, application programming interfaces (APIs) integration. interpretive language that easy learn use. allows designers create custom commands procedures used multi-platform programming because works seamlessly across most development platforms like UNIX Windows literature Tcl, "References" page Using Quartus details interface functions that called while using Tcl. Users with some knowledge write scripts that automate tasks within Quartus software. Designers execute functions they were commands, creating single script that control design project, make assignments, start stop compilation, simulations. basic syntax command <command> [<argument1> <argument2> <argument3>.] command syntax either name built-in command, procedure, commands. Spaces separate command arguments, line semicolon terminates commands. Arguments commands passed strings. Altera Corporation A-AN-118-02 118: Scripting with Quartus Software Running Scripts Interactively execute commands directly Quartus Tcl/Tk Console window. launch Tcl/Tk Console window, choose Auxiliary Windows Tcl/Tk Console (View menu). Figure Figure Tcl/Tk Console Tcl/Tk Console window supports history, does allow commands span more than line. messages appear System Messages window. Altera Corporation 118: Scripting with Quartus Software Running Scripts Batch Mode Once create Script File (.tcl), typing following command Tcl/Tk Console window: source <script file> also script choosing Script (Tools menu). Running Scripts from UNIX Quartus software also supports <script file> command line arguments. This command equivalent choosing Script (Tools menu). following syntax running scripts from UNIX prompt: quartus_cmd <script file> Basic Commands commands Quartus software perform common tasks such controlling projects working with Compiler Simulator. Table outlines types files which interface saves these settings, based type assignment made. Table Types Settings Files File Type Quartus File (.quartus) Project Settings File (.psf) Compiler Settings File (.csf) Entity Settings File (.esf) Simulator Settings File (.ssf) Note: There will every entity which settings made. Description QUARTUS file contains settings entire project. contains settings entire project. contains settings Compiler. contains parameter settings individual entities nodes. contains settings Simulator. Altera Corporation 118: Scripting with Quartus Software commands listed Tables through apply finite impulse response (FIR) filter tutorial included with Quartus software. detailed list commands, search "Application Programming Interface Functions Tcl" Quartus Help. following basic commands sample file, "Example" page Creating Quartus Projects Table lists functions used creating project Quartus software. must create project open existing before performing task. Table Quartus Project Commands Command project exists <project name> Description project exists command verifies project called <project name> already exists prevent errors during project creation. project create command creates project called <project name> auxiliary files, including <project name>.quartus. project open command opens existing Quartus project called <project name>. project close command closes project that currently open. project create <project name> project open <project name> project close Making Assignments Project After create project, commands design files, assign Altera device, create project-wide entity-specific assignments. Table shows commands that remove assignments from project. Table Add/Remove Assignments Command project add_assignment <entity> <section identifier> <source> <target> <variable> <value> project remove_assignment <entity> <section identifier> <source> <target> <variable> <value> Description project add_assignment command adds assignment project. Project-wide assignments written QUARTUS file. Entity-specific assignments written file. project remove_assignment command removes existing assignment from project. Altera Corporation 118: Scripting with Quartus Software Table defines arguments commands Table Table Quartus Project Arguments Argument <entity> <section identifier> <source> <target> <variable> <value> Description <entity> argument specifies entity assignment being made. <section identifier> argument identifies name section settings file. <source> argument specifies beginning instance name range targets. <target> argument specifies ending name range targets started <source>. <variable> argument specifies variable added, changed, removed. <value> argument specifies value assigned variable. Argument values that apply must passed empty strings using quotation marks (""). example, specifying source file project project-wide assignment, thus entity-specific arguments unnecessary. unsure assignment's scope, open GUI, make assignment, which file Quartus software wrote assignment. QUARTUS file, assignment project-wide needs entity-specific arguments. ESF, entity-specific arguments must included. This method also checking your syntax. more information functions related making assignments, including syntax usage, Quartus Help. Creating Compiler Simulator Settings Before compiling simulating design, must create Compiler Simulator settings make assignments. Compiler settings saved CSF, Simulator settings saved SSF. Table lists commands used with these files. Altera Corporation 118: Scripting with Quartus Software Table Compiler Simulator Commands Command project cmp_exists <settings> project create_cmp <settings> Description project cmp_exists command checks CSF, <settings>.csf, already exists. project create_cmp command creates CSF, <settings>.csf. This function also designates settings current Compiler settings project. project set_active_cmp command specifies <settings> Compiler setting compilation Quartus software. project sim_exists command checks SSF, <settings>.ssf, already exists. project create_sim command creates SSF, <settings>.ssf. project set_active_sim command specifies <settings> Simulator settings simulation Quartus software. project set_active_cmp <settings> project sim_exists <settings> project create_sim <settings> project set_active_sim <settings> Table shows commands that used change assignments SSF. Table Making Assignments Command Description add_assignment <section identifier> <source> add_assignment command adds <target> <variable> <value> assignment current Compiler settings. remove_assignment <section identifier> <source> <target> <variable> <value> remove_assignment command removes assignment from current Compiler settings. add_assignment <section identifier> <source> add_assignment command adds <target> <variable> <value> assignment current Simulator settings. remove_assignment <section identifier> <source> <target> <variable> <value> remove_assignment command removes assignment from current Simulator settings. Altera Corporation 118: Scripting with Quartus Software Table describes arguments commands Table Table Arguments Compiler Simulator Settings Argument <section identifier> <source> <target> <variable> <value> Description <section identifier> argument identifies section name that controls assignment. <source> argument specifies beginning instance name range targets. <target> argument specifies last name range targets that began with <source>. <variable> argument specifies variable added, changed, removed SSF. <value> argument specifies value assign variable, value variable remove. more information functions related making Compiler Simulator assignments, including syntax usage, Quartus Help. Controlling Compiler Table lists commands that control Quartus Compiler after specify compilation settings. Table Compiler Commands Command start stop is_running Description start command starts Compiler active Compiler setting. stop command stops Compiler. is_running command checks status Compiler returns value Compiler running Compiler stopped. Altera Corporation 118: Scripting with Quartus Software also combine commands perform conditional steps. example, code Figure checks status compilation stops compilation still running. Figure Example Combining Commands check Compiler running, stop {[cmp is_running] stop sample while loop Figure prevents further script execution during compilation. When compilation finishes, interpreter will exit this loop. after statement while loop tells interpreter many milliseconds wait "sleep" before flushes messages (FlushEventQueue statement) checks whether Compiler still running. after value want real-time messages; high value compiling large design, real-time messaging important. Figure Sample While Loop while {[cmp is_running]} after 1000 FlushEventQueue Altera Corporation 118: Scripting with Quartus Software pipe Quartus messages stdout file handle, procedures Figure library calling script. Figure Example Code Pipe Quartus Messages proc postMessage {report msg} this function overrides postMessage procedure quartus/bin/ccl_msg.tcl split $msg line [lindex $msg [lindex $msg puts stdout $line #_postMessage_# proc InternalError {report text} this function overrides InternalError procedure quartus/bin/ccl_msg.tcl puts stdout "Q>report $report" puts stdout "Q>msg (OE) $text" #_InternalError_" Controlling Simulator Table lists commands that control Quartus Simulator after specify settings. Table Simulator Commands Command initialize <time> stop is_initialized is_running Description initialize command initializes Simulator read netlists sets simulation time zero. command starts Simulator active simulator setting. stop command stops Simulator. is_initialized command checks Simulator been initialized. is_running command checks Simulator running. Notes: more information this command, "sim run" Quartus Help. more information this command, "sim start" Quartus Help. Altera Corporation 118: Scripting with Quartus Software Performing Interactive Simulations also commands interactive simulations with Quartus Simulator. Table lists useful debugging commands. Table Interactive Simulator Commands Command Description force_value <signal name> <value> force_value command forces value signal_name signal (designate value force value high, force value low). release_value <signal name> release_value command releases value signal_name signal revert back original state, thus allowing Simulator overwrite current value while simulating future time. get_value command checks value signal_name signal. command specifies length time Simulator. command runs simulation until completion. get_time command checks current time on-going simulation. get_value <signal name> <time> get_time Notes: more information this command, "sim run" Quartus Help. more information this command, "sim start" Quartus Help. Example more information functions related running interactive simulations, including syntax usage, Quartus Help. sample file Figure shows create project, make assignments, simple compilation using Tcl. Altera Corporation 118: Scripting with Quartus Software Figure Running Simple Compilation Change working directory D:/qdesigns/tutorial check existence project, exists, delete files [project exists filtref] file delete -force filtref.quartus file delete -force filtref.psf file delete -force filtref.esf file delete -force filtref.csf file delete -force filtref.ssf file delete -force create project project create filtref open project project open filtref source files current project project add_assignment SOURCE_FILE project add_assignment SOURCE_FILE project add_assignment SOURCE_FILE project add_assignment SOURCE_FILE project add_assignment SOURCE_FILE project add_assignment SOURCE_FILE project add_assignment SOURCE_FILE filtref.bdf acc.v accum.v hvalues.v mult.v state_m.v taps.v assign signal global signal project add_assignment filref |clk" GLOBAL_SIGNAL create Compiler settings filtref project create_cmp filtref current Compiler settings filtref project set_active_cmp filtref assign device family add_assignment FAMILY APEX assign device add_assignment filtref DEVICE EP20K100TC144-1 Start compilation start Altera Corporation 118: Scripting with Quartus Software Frequently Used Commands allows command procedure customization functionality your designs, offering better control extension your projects. This section describes gives examples frequently used commands. Multicycle Path multicycle path path that intentionally requires more than cycle become stable. Declaring multicycle path tells timing analyzer adjust measurements allow clock cycles (where equals number cycles entered) that does report setup time violations given path. sample multicycle path command shown Figure creates clock setting, base_clock, with fMAX requirement project project_name. signal, clock, then assigned base_clock settings. path from register start register data_outA_out multicycle path three cycles. Figure Sample Multicycle Path project add_assignment "base_clock" FMAX_REQUIREMENT 40MHZ project add_assignment project_name "|clock" USE_CLOCK_SETTINGS base_clock project add_assignment entity_name "|start" "|data_outA_out" MULTICYCLE Altera Corporation 118: Scripting with Quartus Software Multiclock Domain multiclock domain sets clock configuration which more clocks exist within single device. multiclock domain example Figure sets multiclock domain project_name. There clocks, clock1 clock2, that assigned clock settings clock_40MHz clock_32MHz, respectively. clock_40MHz absolute clock which clock_32MHz based. Figure Sample Multiclock Domain project add_assignment "clock_40MHz" FMAX_REQUIREMENT 40MHz project add_assignment "clock_32MHz" BASED_ON_CLOCK_SETTINGS clock_40MHz project add_assignment "clock_32MHz" MULTIPLY_BASE_CLOCK_PERIOD_BY project add_assignment "clock_32MHz" DIVIDE_BASE_CLOCK_PERIOD_BY project add_assignment project_name "|clock2" USE_CLOCK_SETTINGS clock_40MHz project add_assignment project_name "|clock1" USE_CLOCK_SETTINGS clock_32MHz Assignment Propagation delay (tPD) time required signal from input propagate through combinatorial logic appear output pin. This setting specified entire project and/or input, output, buffer pin. entire design, following command. This example sets entire design's project add_assignment TPD_REQUIREMENT 11ns from logic cell, 1cell, output pin, following command. This example sets 1cell output project add_assignment entity_name "|1cell" "|output_pin" TPD_REQUIREMENT Altera Corporation 118: Scripting with Quartus Software Device device your project, add_assignment command. following example shows APEX APEX 20KE device using script. add_assignment FAMILY <family name> add_assignment entity_name DEVICE <device name> where: <family name> APEX20K, APEX20KE <device name> valid device specified family Pinout assignment, following command. add_assignment <chip_name> "<signal_name>" LOCATION Pin_<pin> where: <chip_name> name chip, which typically project name <signal_name> name signal <pin> valid number added Generating Verilog VHDL Simulation Files generate Verilog VHDL simulation files with standard Verilog VHDL simulator, following command. project add_assignment project_name EDA_SIMULATION_TOOL <simulation tool> where: <simulation tool> Modelsim, SpeedWave, VCS, Verilog-XL, VSS, Custom Verilog HDL, Custom Altera Corporation 118: Scripting with Quartus Software Using Synthesis Tool interface with industry-standard tool such Synopsys Design Complier, Synopsys FPGA Express, Exemplar Leonardo Spectrum, Synplicity Synplify, Viewlogic ViewDraw, following command. project add_assignment project_name EDA_DESIGN_ENTRY_SYNTHESIS_TOOL <EDA tool> where: <EDA tool> Design Architect, Design Compiler, FPGA Compiler FPGA Express, Leonardo Spectrum, Synplify, ViewDraw, Custom Setting Technology Mapper technology mapper instructs Compiler implement hierarchy design ROM, product-term logic, look-up table (LUT), AUTO which logic type automatically determined). technology mapper, following command. project add_assignment entity_name TECHNOLOGY_MAPPER <technology> where: <technology> ROM, product_term, LUT, AUTO Setting Optimization Technique optimize area and/or timing project, optimization technique following example. project add_assignment OPTIMIZATION_TECHNIQUE <technique> where: <technique> speed, area Altera provides extensive documentation help design with Quartus software. technical support, contact Altera Applications (800) 800-EPLD. also e-mail your technical questions Altera support@altera.com launch Quartus Support site directly from Quartus software. Altera Corporation 118: Scripting with Quartus Software References more information using Tcl, refer following sources. Practical Programming Brent Welch. Toolkit, John Ousterhout. Effective Tcl/TK Programming, Michael McLennan Mark Harrison. http://www.scriptics.com Innovation Drive Jose, 95134 (408) 544-7000 http://www.altera.com Applications Hotline: (800) 800-EPLD Customer Marketing: (408) 544-7104 Literature Services: (888) 3-ALTERA Printed Recycled Paper. Altera, APEX 20K, APEX 20KE, Quartus trademarks and/or service marks Altera Corporation United States other countries. Altera acknowledges trademarks other organizations their respective products services mentioned this document. Altera products protected under numerous U.S. foreign patents pending applications, maskwork rights, copyrights. Altera warrants performance semiconductor products current specifications accordance with Altera's standard warranty, reserves right make changes products services time without notice. Altera assumes responsibility liability arising application information, product, service described herein except expressly agreed writing Altera Corporation. Altera customers advised obtain latest version device specifications before relying published information before placing orders products services. Copyright 1999 Altera Corporation. rights reserved. Altera Corporation Other recent searchesXAPP940 - XAPP940 XAPP940 Datasheet TLV5616C - TLV5616C TLV5616C Datasheet TLV5616I - TLV5616I TLV5616I Datasheet TMS320 - TMS320 TMS320 Datasheet SF1141B-2 - SF1141B-2 SF1141B-2 Datasheet PD60030-N - PD60030-N PD60030-N Datasheet IR2213 - IR2213 IR2213 Datasheet LA9230M - LA9230M LA9230M Datasheet 9231M - 9231M 9231M Datasheet IDT74LVC32A - IDT74LVC32A IDT74LVC32A Datasheet CBTV4020 - CBTV4020 CBTV4020 Datasheet BFT25 - BFT25 BFT25 Datasheet
Privacy Policy | Disclaimer |