integration with third-凯发k8网页登录

main content

integration with third-party eda tools

generate a default script

the coder generates scripts as part of the code and test bench generation process. script files are generated in the target folder.

when hdl code is generated for a filter, filt, the coder writes these script files.

  • filt_compile.do: mentor graphics® modelsim® compilation script. this script contains commands to compile the generated filter code, but not to simulate it.

when test bench code is generated for a filter filt, the coder writes these script files.

  • filt_tb_compile.do: mentor graphics modelsim compilation script. this script contains commands to compile the generated filter and test bench code.

  • filt_tb_sim.do: mentor graphics modelsim simulation script. this script contains commands to run a simulation of the generated filter and test bench code.

you can enable or disable script generation and customize the names and content of generated script files by:

  • passing properties as 'name',value arguments to the function. see .

  • setting the corresponding options in the generate hdl tool. select the eda tool scripts tab, and click compilation script or simulation script from the menu in the left column. see customize scripts for compilation and simulation.

structure of generated script files

a generated eda script consists of three sections, which are generated and executed in this order.

  1. an initialization (init) phase. the init phase performs required setup actions, such as creating a design library or a project file.

  2. a command-per-file phase (cmd). this phase of the script is called iteratively, once per generated hdl file.

  3. a termination phase (term). this phase is the final execution phase of the script. one application of this phase is to execute a simulation of hdl code that was compiled in the cmd phase.

the coder generates scripts by passing format character vectors to the fprintf function. using the ui options (or generatehdl properties) summarized in these sections, you can pass in customized format character vectors to the script generator. some of these format character vectors take arguments, such as the top-level entity or module name.

you can use valid fprintf formatting characters. for example, '\n' inserts a newline into the script file.

customize scripts for compilation and simulation

to view and set options for generated scripts:

  1. open the generate hdl tool.

  2. click the eda tool scripts tab.

    the compilation script options group is selected, as shown.

  3. the generate eda scripts option controls the generation of script files. by default, this option is selected, as shown in the preceding image.

    if you want to disable script generation, clear this check box.

  4. the list on the left of the tool lets you select from several categories. select a category and set the options as desired. the categories are:

    • compilation script: customize scripts for compilation of generated vhdl or verilog code. see compilation script options.

    • simulation script: customize scripts for hdl simulators. see simulation script options .

    • synthesis script: customizing scripts for synthesis tools. see .

  5. the custom character vectors for each section are passed to fprintf to write each section of the selected script. you can use format character vectors supported by the fprintf function. some of the character vectors include implicit arguments.

    optionimplicit arguments
    compile initializationlibrary name
    compile command for vhdl and compile command for verilog
    • contents of the simulator flags option (an empty character vector, '', by default)

    • file name of the current module

    compile terminationno implicit argument
    compile initializationno implicit argument
    simulation command
    • library name

    • top-level module or entity name

    simulation terminationno implicit argument

compilation script options

the figure shows the compilation script pane, with the options set to their default values.

generate hdl tool

the coder generates a script called firfilt_copy_compile.do:

vlib work
vcom  firfilt_copy.vhd
if you generate a test bench for your filter, the coder also generates a script called firfilt_copy_tb_compile.do
vlib work
vcom  firfilt_copy.vhd
vcom  firfilt_copy_tb.vhd

setting simulator flags for compilation scripts.  you have the option of inserting simulator flags into your generated compilation scripts. this option is included in the compilation scripts for both the standalone filter and the test bench. for example, you can specify a compiler version. to specify the flags:

  1. click test bench in the generate hdl tool.

  2. type the flags of interest in the simulator flags field. in the figure, the tool specifies that the mentor graphics modelsim simulator use the -93 compiler option for compilation.

    test bench tab of the generate hdl tool

command-line alternative: specify simulator flags with the property of the function.

simulation script options

the coder generates a simulation script when you generate a test bench. the figure shows the simulation script pane, with the options set to their default values.

generate hdl tool, showing the eda tool scripts options

the coder generates a script called firfilt_copy_tb_sim.do:

onbreak resume
onerror resume
vsim -voptargs= acc work.firfilt_copy_tb
add wave sim:/firfilt_copy_tb/u_firfilt_copy/clk
add wave sim:/firfilt_copy_tb/u_firfilt_copy/clk_enable
add wave sim:/firfilt_copy_tb/u_firfilt_copy/reset
add wave sim:/firfilt_copy_tb/u_firfilt_copy/filter_in
add wave sim:/firfilt_copy_tb/u_firfilt_copy/filter_out
add wave sim:/firfilt_copy_tb/filter_out_ref
run -all

synthesis script options

for information about synthesis script options, see .

网站地图