$sdf_annotate用法
- 格式:docx
- 大小:26.89 KB
- 文档页数:2
★ ISE详细步骤、作用及其理解:这里把仿真单独编号1)新建工程2)生成原文件手段CORE Generator ModuleLanguage Templates3) check syntax①Behavioral simulate我觉得从Synthesis and Simulation Design Guide文件看,应该先RTL Simulation (that is, Behavioral simulate )。
其实没有关系,综合和RTL仿真的顺序无所谓,这两个不一定要谁在前己见:注意跑行为仿真前是不需要综合的,仅是RTL代码仿真参考:[In-Depth Tutorial] Chapter 4 P914) Synthesis步骤:Entering Constraints (xcf格式) -> Entering Synthesis Options -> Synthsizing参考:[In-Depth Tutorial]P43-P50我觉得这里的constraints是 synthesis constraints:《cgd》p18已见:参《Xilinx ISE 9.X FPGA/CPLD设计指南(人民邮电)》P31综合是把HDL描述转化为使用基本门电路以及厂家库提供的基本单元进行描述的网表(Netlist)的过程。
综合时需要附加一定的约束,指导综合过程的进行,最常用的约束有管脚位置约束和附加时序约束② Post- Synthesis Simulation这里以《夏宇闻》第17章的设计为例,前面行为仿真时可以直接仿真cputop模块(专为仿真写的,不可综合),但在synthesize时,必须把cpu模块Set as Top Module,因为cputop模块是不可综合的,然后点击Generate Post-Synthesis Simulation Model,可以注意到原文件夹下会生成netgen文件夹,打开会发现有synthsis文件夹,里面有cpu_synthesis.v 文件,这个文件是专门用来仿真的。
Verilog 中常用的系统函数(2011-12-06 14:54:39)转载▼标签:分类:FPGA的研究杂谈Verilog HDL常用的系统任务1.$display(<输出格式控制列表>,<输出列表>);//显示变量的值或变量的范围,自动加换行如:$display(“dout=%d dout”,dout);2.$write();//和上面的用法相同,但是不会自动加换行3.$monitor(<格式控制>,<输出列表>);//在多模块调试的情况下,许多模块中都调用了$monitor,因为任何时刻只能有一个$monitor起作用,因此需配合$monitoron与$monitoroff使用,把需要监视的模块用$monitoron打开,在监视完毕后及时用$monitoroff关闭,以便把$monitor 让给其他模块使用。
$monitor与$display的不同处还在于$monitor 往往在initial块中调用,只要不调用$monitoroff,$monitor便不间断地对所设定的信号进行监视。
4.$time系统函数:返回64位的整数来表示当前的仿真时刻; $realtime系统函数:返回一个实型数表示当前仿真时刻。
都以模块的仿真时间尺度为基准。
5.$monitor($realtime,,"set=%b",set);//其中一个用法5.系统任务$finish:退出仿真器,返回操作系统6.系统任务$stop:暂停仿真器7.系统任务$random:$random%b或者{$random}%b8.系统任务$readmemb和$readmemh:用于从文件中读取数据到寄存器中,任何时候都可以被执行(数据方向:文件>>寄存器);有以下用法:1) $readmemb("<数据文件名>",<存贮器名>);2) $readmemb("<数据文件名>",<存贮器名>,<起始地址>);3) $readmemb("<数据文件名>",<存贮器名>,<起始地址>,<结束地址>);4) $readmemh("<数据文件名>",<存贮器名>);5) $readmemh("<数据文件名>",<存贮器名>,<起始地址>);6) $readmemh("<数据文件名>",<存贮器名>,<起始地址>,<结束地址>);其中文件中的地址表示方式@hhhh--hh,但是寄存器中的地址可直接用数表示。
1.常见错误:Failed to find INSTANCE ...,问题出在下面所示的第2步或第4步。
正确处理步骤:(1)Quartus中编译测试码欲调用的顶层模块(设模块名:xxx),设置EDA tool 的simulation 工具,如verilog ,以产生xxx.vo文件及xxx_v.sdo延时文件;(2)打开modelsim,新建工程,添加xxx.vo文件、测试用激励波形文件testbench.v、所用器件的网表文件(以cyclone为例:$Quartus\eda\sim_lib\cyclone_atoms.v)。
全部编译。
!!:确认testbench.v中不包含顶层模块xxx代码。
(3)xxx_v.sdo复制到modelsim工程目录。
(4)最后,建立仿真配置文件:在workspace的project页中右键单击,选simulation configuration,如下图于是,workspace中得到simulation 1。
按下图设置:注意,上面的框中添加xxx_v.sdo,下面的文本框中设置作用域,格式为:\testbench模块名\xxx的实例名。
(5)`timescale 影响仿真结果显示效果。
=================例===================[1]//文件count4.vmodule count4(out,reset,clk);output[3:0] out;input reset, clk;reg[3:0] out;always @(posedge clk)beginif (reset)out <= 0;elseout <= out + 1;endendmodule[2]//测试文件count_tp.v`timescale 1ns/1nsmodule count_tp;reg clk,reset;wire[3:0] out;parameter DELY = 100;count4 mycount(out,reset,clk);always #(DELY/2) clk = ~clk;initialbeginclk = 0; reset = 0;#DELY reset = 1;#DELY reset = 0;#(DELY*20) $finish;endinitial $monitor($time,,,"clk=%d reset=%d out=%d",clk,reset,out); endmodule[3]所用器件:cyclone[4]结果:明显产生了时延p.s.-----------------------网上有朋友指出勾选SDF中的两个选项,将原来的警告禁止,将原来的错误变为警告, 可以成功地进行反标注并运行仿真,但这样做并没有解决实际问题,只能产生功能仿真,没有得到带时延的时序仿真2.** Error: D:/ModelSim_6.5/ModelSimnear "'t": Illegal base specifier in numeric constant.syntax error, unexpected "BASE", expecting "class"错误原因:不是’timescale 而是`timescale,那个是键盘左上角的点,不是一撇。
VCS仿真指南VCS-verilog compiled simulator是synopsys公司的产品.其仿真速度相当快,而且支持多种调用方式;使用的步骤和modelsim类似,都要先做编译,再调用仿真.Vcs包括两种调试界面:Text-based:Command Line Interface(CLI) 和GUI-based(VirSim);仿真主要的两个步骤是编译,运行:>vcs design.v//编译verilog的源文件并且生成一个可执行文件simv>simv//运行simv一般情况下都存在vcs 做编译的时候的compile_time_options和运行时候的run_time_options,这些我们在下面再具体介绍.一.VCS的三种调试模式使用vcs存在三种调试模式:CLI调试模式,VirSim交互调试模式和VirSim后处理调试模式.下面举例说明: 1. CLI调试模式CLI调试模式存在两种调用方法,一种是编译后马上执行,一种是把编译执行分开处理>vcs source.v +cli+3 –R –s或者>vcs source.v +cli+3>simv source.v –s其中+cli+[1 2 3 4]是指调试时候交互调试的能力.+cli+[<module_name>=]1|2|3|4Enable CLI debugging.1 enables you to see the values of nets and registers and deposit values to registers.2 also enables breakpoints on value changes of nets and registers.3 also enables you to force a value on nets.4 also enables you to force a value on a register.You can specify a module to enable CLI debugging only for instances of the module.-line 能够支持单步调试但是这些都是会增加运行时间的.这里不详细介绍CLI 命令具体可以参考usrerguide.注意我们也可以把CLI的命令写成一个script的文件在vcs编译时调用.>vcs source.v –R –s –include script_file或者在cli下调用cli>source script_file2. VirSim交互调试模式启动VirSim交互调试模式和调用CLI一样也是有两中方法.>vcs source.v –RI –line +vcsd +cfgfile+filename或者>vcs source.v –I –line +vcsd>vcs source.v -RIG +cfgfile+filename其中-RI 作用有两个:编译生成可以在VirSim中可执行的文件并且编译后马上启动Virsim;要编译成可以在VirSim中可执行的文件必须在编译阶段加-I,在要生成vcd或vpd时这个参数一定要添加;-RIG通过一个已编译完成的默认的simv文件启动Virsim,在启动之前一定要通过vcs –RI或者-I对源文件做过编译.使用vcs编译源文件之后会发现目录下多了simv和/csrc等文件,其中simv是默认的可执行文件,可以在vcs 做编译的时候–o filename改变输出的名字,/csrc是存的增量编译的结果,/simv.daidir如果设置中使用到了PLI就会创建.具体如何使用VirSim做交互调试这里也不具体介绍,可以参考VirSim的userguide和vcs安装下面的doc 的tutorial.3. VirSim的后处理调试模式注意什么时候用后处理调试模式,什么时候使用交换模式那?在初步仿真的过程使用交互模式,若是调试一个成熟的设计或者很多人一起做调试这样子可以使用post-processing mode.其主要的方法是通过仿真运行dump数据在vcd或者vpd文件中,运行结束后通过vcd或者vpd观察运行过程的情况,交互调试能力相对较差,但是通过记录的数据可以观察出其中异常的地方;也就是包括两个步骤Write VCD+ file,View result.>vcs source.v –line –R -PP +vcsd其中-R自动运行并且生成vcd+文件-PP编译的时候是faster VirSim post_processing>vcs –RPP source.v +vpdfile+vcdplus.vpd注意:VirSim只能处理VCD+ file.VCD文件可以被转换成VCD+格式的文件.VCD+和VCD有什么不一样那?更快,更小.VCD+系统任务可以在testbench中使用也可以在仿真的时候添加.(注意使用到这些系统函数时,在vcs编译的时候一定要添加-I或者-RI.)$vcdpluson(level_number,module_instance,….|net_or reg,….)level_numbers指定记录的层次0- 记录整个指定module_instance的所有信号1- 记录指定module_instance顶层信号n- 记录从顶层开始到下面的n层例化模块的信号module_instance 指定例化名net_ or reg 指定特定的wire或者reg作为记录的对象,默认是所有信号.$vcdplusoff(module_instance,….|net_ or reg,…)其他系统函数可以参见VCS quick reference.二. 其他情况注意区别的两个方面:1. –R –I 不同于-RI-R –I是编译成VirSim的可执行文件而且马上运行仿真, -RI是编译成VirSim的可执行文件并且调用VirSim.2. –R –PP 不同于-RPP-R –PP是编译成VirSim的可执行文件并且在运行的时候加快输出VCD+文件-RPP是在存在VCD+的条件下调用VirSim进行post processing的调试.门级仿真需要反标SDF文件,可以在testbench中添加$sdf_annotate系统函数.并且在编译的时候注意要使用standcell的仿真库.Compile-Time Options********************-f <filename>Specifies a file that contains a list of pathnames to source filesand compile-time options.-F <filename>Same as the -f option but allows you to specify a path to the fileand the source files listed in the file do not have to be absolutepathnames.-hDisplays a succinct description of the most commonly used compile-timeand runtime options.-l <filename>(lower case L) Specifies a log file where VCS records compilationmessages and runtime messages if you include the -R, -RI, or-RIG options.-lineEnables stepping through the code and source line breakpoints in VirSim.-MEnables incremental compilation, but do not overwrite the makefile.-MupdateEnable incremental compilation and overwrite the make file.-noticeEnables verbose diagnostic messages.-o <name>Specifies the name of the executable file that is the product ofcompilation. The default name is simv (simv.exe on Windows).-ova_covEnables functional coverage.-P <pli.tab>Specifies a PLI table file.-RRun the executable file immediately after VCS links together the executable file. You can add any runtime option to the vcs command line.-sStop simulation just as it begins. Use this option with the -R and+cli options.-timescale=<time_unit>/<time_precision>If only some source files contain the `timescale compiler directive and the ones that don't appear first on the vcs command line, use this option to specify the time scale for these source files.-VEnables the verbose mode.-v <filename>Specifies a Verilog library file to search for module definitions.-veraSpecifies the standard VERA PLI table file and object library.-y <directory_pathname>Specifies a Verilog library directory to search for module definitions.+2stateEnables 2 state simulation.+cli+[<module_name>=]1|2|3|4Enable CLI debugging.1 enables you to see the values of nets and registers and deposit values to registers.2 also enables breakpoints on value changes of nets and registers.3 also enables you to force a value on nets.4 also enables you to force a value on a register.You can specify a module to enable CLI debugging only for instances of the module.+define+<macro_name>=<value>Defines a text macro. Test for this definition in your Verilogsource code using the `ifdef compiler directive.+incdir+<directory>Specifies the directories that contain the files you specified withthe `include compiler directive. You can specify more that one directory, separating each path name with the + character.+libext+<extension>Specifies that VCS only search the source files in a Verilog library directory with the specified extension. You can specify more than one extension, separating each extension with the + character.For example, +libext++.v specifies searches library files with no extension and library files with the .v extension.Enter this option when you enter the -y option.+maxdelaysUse maximum value when min:typ:max values are encountered in delay specifications SDF files.+mindelaysUse minimum value when min:typ:max values are encountered in delay specifications and SDF files.+notimingcheckSuppresses timing checks in specify blocks.+plusarg_ignoreAlso enter this option in the file that you specify with the -f optionso that VCS does not pass to the simv executable or to VirSim the options that follow in the file. Use this option with the+plusarg_save option to specify that other options shouldnot be passed.+raceSpecifies that VCS generate a report, during simulation, of all therace conditions in the design and write this report in the race.outfile.+race=allAnalyzes the source code during compilation to look for codingstyles that cause race conditions.+rad or +rad+2Performs aggressive optimizations on your design.+rad+1 or +radlite or +radlightPerforms less aggressive optimizations on your design.+v2kEnables the use of new Verilog constricts in the 1364-2001 standard.Runtime Options***************-i <filename>Specifies a file containing CLI commands that VCS executes whensimulation starts.-l <filename>Specifies writing all messages from simulation to the specifiedfile as well as displaying these messages in the standard output.This option begins with the letter "l" (lowercase "L") for log file.-ova_covEnables functional coverage reporting.-sStops simulation just as it beings, and enters interactive mode.Use with the +cli+<number> option.-VVerbose mode. Print VCS version and extended summary information. Prints VCS compile and run-time version numbers, and copyright information, at start of simulation.-vcd <filename>Sets the output VCD file name to the specified file.The default filename is verilog.dump.A $dumpfile system task in the Verilog source code will overridethis option.+maxdelaysSpecies using the compiled SDF file for maximum delays generatedby the +allmtm compile-time option.Also specifies using maximum delays for SWIFT VMC or SmartModelsor Synopsys hardware models if you also enter the+override_model_delays runtime option.+mindelaysSpecifies using the compiled SDF file for minimum delays generatedby the +allmtm compile-time option.Also specifies using minimum delays for SWIFT VMC or SmartModelsor Synopsys hardware models if you also enter the+override_model_delays runtime option.+notimingcheckSuppress timing checks.+override_model_delaysEnables you to use the +mindelays, +typdelays, or +maxdelays runtime options to specify timing for SWIFT SmartModels or Synopsys hardware models.+sdfverboseEnables the display of more than ten warning and ten error messages about SDF back annotation.+vcs+dumpoff+<t>+<ht>Turn off value change dumping ($dumpvars system task) at time <t>.<ht> is the high 32 bits of a time value greater than 32 bits.+vcs+dumpon+<t>+<ht>Suppress $dumpvars system task until time <t>.<ht> is the high 32 bits of a time value greater than 32 bits.+vcs+dumpvarsoffSuppress $dumpvars system tasks.+vcs+finish+<t>+<ht>Finish simulation at time <t>.<ht> is the high 32 bits of a time value greater than 32 bits.Options for Using VirSim Interactively or in Post-Processing************************************************************+cfgfile+<filename>Specifies using a configuration file that you recorded in aprevious session with VirSim.+vslogfile[+<filename>]Enables logging of VirSim commands in a VirSim log file. If you do not specify a filename, the log is automatically saved to the workingdirectory as VirSim.log.Options For Using VirSim************************the following are options for using VirSim. You enter them on thevcs command line and also specify the source files.Options for Using VirSim interactively with VCS+++++++++++++++++++++++++++++++++++++++++++++++ -RIRun Interactive. Starts VirSim immediately after compilation.-RIGRun Interactive Debug. Start VirSim using an existing executablefile (such as the simv or simv.exe file). VCS does no compilation.+sim+<simv_name>Use with the -RIG option. You need this option to specify the nameof the simv executable file that isn't named simv but has a differentname that you specified with the -o compile-time option.+vslogfilesim[+<filename>]Enables the logging of VCS communication messages in the VirSim logfile. If you use both +vslogfile and +vslogfilesim, VirSim commandsand VCS messages are saved to the same file.If you do not specify a filename, the log is automatically savedto the working directory as VirSim.log.+vpdfile+<filename>At runtime, defines an alternative name of the VCD+ file that VCSwrites instead of the default name vcdplus.vpd.Options for Using VirSim in Post-Processing+++++++++++++++++++++++++++++++++++++++++++-RPPRun Post-Processing mode. Starts VirSim for post-processing a VCD+file.+vcdfile+<filename>Specifies the VCD file you want to use for post-processing.+vpdfile+<filename>[+start+<start_time>+end+<end_time>]In post-processing, specifies the VCD+ file you wish to view inVirSim. The optional +start+<start_time> and +end+<end_time>arguments specify you only want VirSim to display the resultsfrom between these simulation times.Options for Specifying How VCS Writes the VCD+ File+++++++++++++++++++++++++++++++++++++++++++++++++++ -PPEnables system tasks and options for VCD+ files and optimizationsfor faster post-processing.-IEnables system tasks and options for VCD+ files.+vpdbufsize+<MB>VCS uses an internal buffer to store value changes before it writesthem to the VCD+ file on disk. VCS makes this buffer size either 5MB or large enough to record 15 value changes for all nets andregisters in your design, which ever is larger.You can use this option to override the buffer size that VCScalculates for the buffer size. You specify a buffer size inmegabytes.+vpddriversTells VCS to record the values of all the drivers of all the nets.+vpdfilesize+<MB>Specifies the maximum size of the VCD+ file. When VCS reaches this limit, VCS overwrites the oldest simulation history data in the file with the newest.+vpdignoreTells VCS to ignore $vcdplus system tasks so VCS does not write a VCD+ file.+vpdportsTells VCS to record, in the VCD+ file, the port direction of signals that are ports.+vpdnocompressDisables the automatic compressing of the data in VCD+ files.+vpdupdateIf VCS is writing a VCD+ file during simulation, this option enables you to have VCS halt writing to the VCD+ file while the simulationis running and so that you can view the recorded results in VirSim. This option enables you to use the update feature in VirSim.+vpdnostrengthsDisables recording strength information in the VCD+ file.Options For CAlling The vcd2vpd and vpd2vcd Utilities*****************************************************-vcd2vpd <vcd_filename> <vcdplus_filename>Tells VCS to find and run the vcd2vpd utility that converts a VCDfile to a VCD+ file. VCS inputs to the utility the specified VCDfile and the utility outputs the specified VCD+ file.-vpd2vcd <vcdplus_filename> <vcd_filename>Tells VCS to find and run the vpd2vcd utility that converts a VCD+ file to a VCD file. VCS inputs to the utility the specified VCD+file and the utility outputs the specified VCD file.The Virsim debugger and the vpd2vcd and vcd2vpd translator utilities are best invoked via the vcs command line.Summary of vcs options for the $vcdpluson tasks:-------------------------------------------------I enable interactive/postprocessing debugging capabilities-PP enable optimizer postprocessing capabilities for vcd++vcsd enable the VCS DKI (Direct Kernel Interface); +vpdports,+vpddrivers, output and interactivesimulation currently are not available in +vcsd mode.Summary of vcs options for the Virsim GUI:-------------------------------------------RI after compilation, run simulation under Virsim (implies -I)-RIG run simulation under Virsim without compiling (executable has to exist)-RPP run Virsim in postprocessing mode (requires file created by $vcdpluson)Additional Virsim Verilog and $vcdpluson flags:-----------------------------------------------VirSim 4.3.R11 Virtual Simulator EnvironmentCopyright (C) 1993-2003 by Synopsys, Inc.Licensed Software. All Rights Reserved.Usage: vcs [-RI|-RIG|-RPP] [[+vpdfile+<vpdname>]...] [[+vcdfile+<vcdname>]...] [[+cfgfile+<cfgname>]...][sim-opts] [vpd-opts-to-pli] [other-opts] files+vpdfile+<vpdname> Multiple VPD files can be opened using several+vpdfile+ commands+vcdfile+<vcdname> Multiple VCD files can be opened using several+vcdfile+ commands+cfgfile+<cfgname> Multiple (incremental) configuration files can be loadedsim-opts:+sim+<simulator-path> Sets simulator path name+simtype+<simulator> Sets simulator type exactly as listed in SimulatorInvocation Dialog+simargs+<parameters> Sets additional simulator arguments. Double quotes around multiple arguments.+simargs+"+vpdfile+<vpdname>" Sets name of VPD file to be created by VCD+ PLI vpd-opts-to-pli: Options for VCD+ generation by an interactivesimulation run started by virsim+vpdports Stores port type information for hierarchy+vpddrivers Stores data for changes on drivers of resolved nets+vpdbufsize+<#MB> Changes the default size of the internal VCD+ buffer+vpdfilesize+<#MB> Sets file size when storing data in wraparound mode+vpdupdate Enables VPD file locking+vpdignore Tells simulator to ignore all calls to generate VPD+vslogfile Enables message logging. Does not log simulation communication messages +vslogfile+<filename> Enables message logging. Logs messages in filename+vslogfilesim Enables logging of simulation communication messagesother-opts: Sets regular options to compile verilog code+v2k Enables supported verilog 2000 additionsfiles: Verilog source code file(s) listSummary of vcd2vpd options:---------------------------Usage: vcs -vcd2vpd <options> <evcd_options> <vcd_file> <vpd_file><options>-b# Buffer size in KB used to store Value Change Data beforewriting it to disk.-f# Maximum output file size in KB. Wrap around occurs ifthe specified file size is reached.-h Translate hierarchy information only.-m Give tranlsation metrics during translation.-q Suppress printing of copyright and other informational messages.+deltacycle Add delta cycle information to each signal value change.+glitchon Add glitch event detection data.+nocompress Turn data compression off.+nocurrentvalue Do not include object's current value at the beginning of each VCB. <evcd_options>+dut+<dut_prefix> Modifies the string identifier for the Device-Under-Testhalf of the split signal. Default is "DUT".+tf+<tf_prefix> Modifies the string identifier for the Test-Fixturehalf of the split signal. Default is "TF".+indexlast Appends the bit index of a vector bit as the lastelement of the name.Summary of vpd2vcd options:---------------------------Usage: vcs -vpd2vcd <vpd_file> [<vcd_file>]Summary of vpd2vcd command line options-h Translate hierarchy information only.-q Suppress printing of copyright and other informational messages.-s Allow sign extension for vectors. Reduces size of <vcd_file>.-x Expand vector variables to full length when displaying$dumpoff value blocks.+zerodelayglitchfilter Zero delay glitch filtering for multiple value changes within the same time unit.+morevhdl Translates the vhdl types that are not directly mappable to verilog types in addition to the ones that are mappable.+start+<value> Translate value changes starting after start time <value> +end+<value> Translate value changes ending before end time <value> (Note) If both start and end values are input, value changesoccuring between start and end time are translated.。
VCS使⽤SDF⽂件进⾏后仿反标概述从概念上来说,数字验证包含两⽅⾯的内容,⼀个是验证功能,另⼀个是验证时序。
对应的仿真模型(不论是model,standard cell等)也不外乎这两个部分,功能部分由逻辑,udp元件或gate构成,时序部分则包括了时序反标和时序检查两⼩块。
平时我们所说的功能验证,也就是前仿真,实现了对功能进⾏验证的⽬的,时序被默认为理想情况,不包含延迟信息。
门级仿真,也称为后仿真,除了功能验证外,最主要就是⽤来检查时序是否满⾜,有没有时序违例的情形。
门级仿真根据⽹表不同,⼜可以分为综合后仿真,以及pnr后仿真。
前者是⽤综合后的⽹表进⾏仿真,这时由于hold没有修,所以会出现不少时序违例的情况,真正timing clean的⽹表是后端做完布局布线,修修补补完timing的⽹表,我们称为pnr⽹表。
进⾏pnr⽹表的后仿真时,我们需要告知仿真⼯具cell与cell之间的延迟,D端到Q端的延迟,这⾥,我们就要请出主⾓SDF⽂件,闪亮登场!什么是SDF⽂件?SDF(Standard delay file)⽂件是把布局布线过程中器件延时和线延时的信息保留下来,据此就可以在路径时序分析时将整条路径的时序计算出来,再判断时序约束条件就能知道是否满⾜时序要求了。
如何反标SDF⽂件?反标SDF⽂件有两种⽅法,⼀种作为elaboration的选项指定,另⼀种是在bench中调⽤系统函数$sdf_annotate来完成。
作为elaboration的选项-sdfmin|typ|max:instance_name:file.sdf如vcs-sdf min:top.i_test.:test.sdf使⽤系统函数$sdf_annotate$sdf_annotate (“sdf_file”[, module_instance] [,“sdf_configfile”][,“sdf_logfile”][,“mtm_spec”] [,“scale_factors”][,“scale_type”]);这⾥除了sdf_file必须给出外,其他参数可以使⽤默认值,如:$sdf_annotate(“test.sdf”);要说明下参数scale_type,sdf⽂件中时序信息都会由3个数字组成,分别对应是minimum,typical,maximum三种情形下的延迟(当然,有时候会只有minimum和maximum的情况,那么typical的延迟没有就省略)scale_type的可取值为:FROM_MINIMUX选择SDF⽂件中mininum timingFROM_TYPICAL选择SDF⽂件中typical timingFROM_MAXIMUM选择SDF⽂件中maximum timingFROM_MTM系统默认如何确认成功反标呢?反标完成后,可以从log中看到这样⼀句话:例⼦这样我们就反标完成了,接下来让我们通过后仿波形,验证下设计中延迟和sdf⽂件中延迟是否⼀致。
$sdf_annotate用法-回复sdf_annotate是一种自然语言处理工具,可以对文本进行分析和注释。
它能够提供一些有用的标注信息,如词性标注、句法分析、实体识别等,帮助研究人员和开发者更好地理解和处理文本数据。
在本文中,我们将详细介绍sdf_annotate的用法和一些示例,帮助读者更好地理解如何使用这个工具。
首先,让我们先了解一下sdf_annotate工具的安装和设置过程。
为了使用sdf_annotate,请确保您的计算机上已经安装了Python和pandas库。
然后,您可以通过以下步骤来安装sdf_annotate:步骤一:打开命令提示符或终端窗口,并输入以下命令来安装sdf_annotate:pip install sdf_annotate步骤二:安装完成后,您可以在Python中导入sdf_annotate库:pythonimport sdf_annotate现在,我们已经完成了sdf_annotate的安装和设置,接下来让我们一起来看一些具体的使用示例。
示例一:词性标注词性标注是将每个单词与其对应的词性进行配对的过程。
sdf_annotate 可以通过以下代码实现词性标注:pythonimport sdf_annotatefrom sdf_annotate import pos_tagtext = "I love natural language processing."tags = pos_tag(text)print(tags)输出结果如下:[('I', 'PRP'), ('love', 'VB'), ('natural', 'JJ'), ('language', 'NN'),('processing', 'NN')]在这个例子中,我们使用了一个简单的句子,并使用pos_tag()函数对其进行了词性标注。
后仿----转载1.后仿是否必要随着芯⽚规模的增⼤,关于IC设计流程中的后仿是否必要,有多种声⾳。
认为不必要的理由是:布局布线后的⽹表,已经可以通过STA保证时序,后仿只不过是确认⼀遍电路的时序。
⽽且随着电路规模不断增⼤,仿真⼯具的仿真速度的提升仍不明显,后仿必然是⼀个很耗时的步骤,时间代价⼤⽽收益不明显。
认为有必要的理由是,从公司以往多个项⽬的经验来看,后仿中也发现了⼀些问题。
⽽对于有些设计,STA并不能完全覆盖所有的路径。
后仿的⼯作是对后端实现最后的check。
本⽂认为,以公司现阶段的研发⼒量,后仿还是必须的。
2.前后仿的区别前仿:RTL的仿真后仿:门级仿真。
⼜分为综合后仿真和布局布线后仿真a.关注点不同;前仿:关注RTL在功能上是否正确(符合设计)后仿:关注电路在各种⼯作条件下,插⼊了延时后,功能是否依然正确。
b.仿真对象不同;前仿:仿真的对象是RTL后仿:仿真的对象是门级⽹表+sdf⽂件(可能包括⼀些IP的sdf)综合后仿真⽤的是综合后的⽹表+PreSTA产⽣的sdf(⽆net延时,cell延时不准确,时钟树不准确)布局布线后仿真⽤的是PR后的⽹表+PostSTA产⽣的sdfc.外部激励与响应检查;所⽤的激励和响应检查应⼀致后仿可能让时钟漂移以模拟极端的情况3.后仿的各种组合情况如果考虑OSC漂移以及三种Corner,可以组合以下六种情况Fast OSC + Fast SDFSlow OSC + Fast SDFFast OSC + Typ SDFSlow OSC + Typ SDFFast OSC + Slow SDFSlow OSC + Slow SDF说明:对于普通的设计,实际只需考虑3中sdf即可。
对于osc偏移可能带来的影响(如,flash编程),则后仿需要考虑更多Osc偏移带来的影响(时序不满⾜)4. 认识sdf⽂件sdf = 标准延时⽂件请参考附录1中对于sdf⽂件的注释5. Sdf反标反标:vcs将sdf⽂件中的延时信息添加到门级⽹表中对应的地⽅6.后仿违背的类型a.时序器件Setup/hold违背(posedge D -> posedge CK , negedge D -> posedge CK)Recovary/Removal违背(posedge CDN -> posedge CK ,posedge SDN -> posedge CK)Width违背(CK,CDN,SDN)b.IP时序违背IP接⼝时序不符合datasheet7.针对违背采取的措施a.同步处理第⼀级寄存器的违背i.⽅法⼀1,建⽴⽂件Sync.v,格式如下:initial beginforce Top.uXX.uYY.uZZ_reg.notifier = 1'b0;…………end2,在SimTop中的include此⽂件;解决了寄存器输出为x的情况,但仿真会报很多warningii.⽅法⼆1,建⽴⽂件Sync.v,格式如下instance {Top.uXX.uYY.uZZ_reg,……} {noTiming}2,在runsim⽂件中加⼊ +optconfigfile+./Sync.vb.其他i.时序约束是否存在问题ii.时钟树是否合理iii.电路设计是否有潜在风险iv.接⼝设计是否遵循datasheet8.后仿脚本1,+neg_tchk寄存器可能出现负的setup limit和hold limit。
关于后仿1. 后仿的步骤:先做zero_delay仿真,确保加载的⽹标⽂件是正确的,然后,再将SDF⽂件反标到⽹标⽂件上。
2. 加载SDF的语法:`ifdef SDFinitialbegin$sdf_annotate("../../rtl/post_sim/U_sramc.sdf",u_top,,"sdf.log",);end`endif3. x 信号的来源a. 未初始化的信号,如⼀些memory model,clock/reset;b. timing violation4. 常⽤的参数:例如:module ND(X,A1,A2)output X ;input A1,A2 ;specify(A1 => X) = 50 ;(A2 => X) = 50 ;endspecifyendmodule 在标准单元中,定义输⼊A1到输出X的路径延时为50 time unit。
+nospeicy:vcs不加⼊50 time unit的延时+delay_mode_zero:将标准单元中定义的延时替换为0+notimingcheck :时序检查开关,⽐如setup/hold/width检查等等,如使⽤开关,则仿真时不检查时序,如后仿真,时序检查不满⾜,可能导致X扩散。
+no_notifier:在库⾥⾯有⼀些检查,width,setup,removal等等,⼀旦有violation,它就将notifier寄存器翻转,这样就出现X态,为了不让仿真中出现这个情况,可以再仿真时加上 +no_notifier,这样仿真不会翻转notifier寄存器,也不会出现X态,不过会display出各种违例。
DC综合以及后仿问题总结日期:2013.08.241 关于DC综合出现的一些warning以及解决方法:1)当出现这种unsign to signed warning出现的时候一般是代码中出现了一下两种不规范的写法:第一种:例如:wire data_A assign data_A=(判断条件)?1:0;即:定义一个wire 类型的信号data_A,然后通过一个判断条件的真假来个data_A进行赋1或者0,那么这样的写法就会造成上面例句的warning,这是因为在verilog中直接写1或者0,那么verilog 就会把1或者0默认为整型变量,而整型变量默认的是有符号数,而我们定义的data_A是一个无符号信号,那么正确的写法应该为wire data_A assign data_A=(判断条件)?1’b1:1’b0,这样写才是规范的写法。
第二种:这种情况warning主要出现在一些用到了有符号数运算的电路中,比如我们要计算两个8bit有符号数的加法、减法、乘法等,而其中一个有符号数要通过别的寄存器进行赋值,比如总线寄存器(即:要进行运算的数通过总线赋值),那么我们可能会这样写:wire signed [7:0] A; assign A=bus_data_reg[7:0],这样写verilog就会把bus_data_reg[7:0]默认为一个无符号数,可是我们的A要求是一个有符号数,故就会出现上面列举的warning,正确的写法应该是wire signed [7:0] A; assign A=$signed(bus_data_reg[7:0]);,总的来说就是,我们要给一个有符号数的信号赋值,那么我们就应该保证等号两边都是有符号数,verilog 中可以用$signed将一个数定义成有符号数。
同样当出现signed to unsigned这样的warning后,我们用上面同样的方法进行分析就可以解决了2)当综合之后出现这种类型的warning时,说明你的代码中在实例化某个模块的时候你只把该信号的某几bit连接到了该模块的端口上,这种警告的出现是比较常见的,比如上图所示:这表明在代码中send_check_bus_addr是一个11bit的输入信号,它的第6~10bit没有连接到该模块的端口上,即:这样的警告的出现是正常的,对DC综合的结果没有太大的影响。
VCS简易教程1. 编译所有点v文件:vcs *.v -debug_all -R -gui -l top_log-debug_all表示调用UCLI和DVE,并为进一步的DVE调试建立必要的文档;-R表示编译之后立即运行仿真;-gui表示在仿真0时刻打开DVE界面;-l表示记录编译过程日志,后跟日志文件名2.在Hierarchy Browser窗口中选中module(左图),则其端口信号会显示在Data Pane窗口中(右图)在Data Pane窗口中选中要显示的信号,右击add to waves->new wave view (波形窗口打开)4.设置仿真时间在空格栏中输入仿真时间,点击左边的下箭头,开始仿真,右下角的2,1/2是波形放大缩小5.调试波形显示后,如果又添加了新的信号,则重新点restart图标,这时波形不显示(modelsim仍然保留),点击工具栏的加载波形,如下图的下拉箭头如果要调试内部某个模块的信号,先在Hierarchy Browser窗口选中module(上面的第3步),可以通过RTL 代码的例化名查找,如上例:例化了双口RAM 例化名为code_u,添加code_u的所有信号都波形窗口,信号很多,包括内部的很多wire,buffer等。
可在波形窗口中过滤这些信号,只留下输入输出端口,方法如下:点击上图中过滤信号下拉箭头,将不需要的信号过滤(把勾号去掉,默认为所有勾都选上)Wave窗口中只剩下输入输出信号。
然后进行仿真。
若要区分不同的信号组,以便观察,可以插入分割信号:菜单signale->Insert Divider后端网表仿真》后仿真,需在tb文件中加入sdf文件,如下:initialbegin$sdf_annotate("XXXX.sdf",top_module_name); // 例:(“xxx.sdf”,soc_i) end(sdf要在PT中生成,DC输出的sdf可能会有写warning)》标准单元库文件有两种,分别为tsmc18_neg 和tsmc18 ,前者支持neg_tchk负延迟检查,后者不支持。
$sdf_annotate用法
一、概述
$s df_a nn ot at e是一个功能强大的工具,可以帮助用户对SD F文件进
行注释和标记。
通过$s df_a nn ot at e,用户可以在S DF文件中添加各种
注释和标记,以便于数据的分析、查询和可视化。
二、基本用法
1.安装和配置
首先,确保你的操作系统中已经安装了$s d f_an no ta te工具。
然后,
进入$s df_a nn ot ate的安装目录,并进行配置。
配置主要包括指定输入
文件路径、输出文件路径等参数。
2.添加注释
使用$s df_a nn ot ate可以轻松地给S DF文件中的化合物添加注释。
注
释可以包括分子式、分子量、化学名称等信息。
在命令行中输入以下命令
来添加注释:
$s df_a nn ot at e-iin p ut.s df-o ou tp ut.s df--
a n no ta te"m ol ec ula r_f or mu la"--a nno t at e"mo le cu la r_w e ig ht"--
a n no ta te"c he mi cal_na me"
这个命令将会在输出文件中添加分子式、分子量和化学名称的注释。
3.标记特定分子
除了注释功能之外,$s df_a nn ot a t e还可以帮助用户标记特定的分子。
标记可以根据用户指定的条件来进行,比如分子量大于某个阈值、含有特
定官能团等等。
以下是一个例子:
$s df_a nn ot at e-iin p ut.s df-o ou tp ut.s df--
m a rk"m ol ec ul ar_we i gh t>300"--
m a rk"s ub st ru ct ure('c1c cc cc1')"
这个命令将会在输出文件中标记分子量大于300和含有苯环的分子。
三、高级用法
1.自定义注释和标记
$s df_a nn ot at e支持自定义注释和标记。
用户可以根据自己的需要定义注释和标记的规则。
例如,用户可以添加一个自定义的注释"l og P"来计算化合物的疏水性:
$s df_a nn ot at e-iin p ut.s df-o ou tp ut.s df--
a n no ta te"l og P=cal c ul at e_lo gP()"
这个命令将会在输出文件中添加一个名为"l og P"的注释,其值为计算得到的化合物疏水性。
2.批量处理多个文件
$s df_a nn ot at e还支持批量处理多个SD F文件。
用户可以指定一个包含多个文件路径的列表,并通过循环迭代的方式进行处理。
以下是一个示例:
$s df_a nn ot at e-iin p ut1.sd fi np ut2.s d fi np ut3.sd f-
o o ut pu t1.s df ou tpu t2.sd fo ut pu t3.sd f
这个命令将会分别对三个输入文件进行处理,并将结果输出到相应的输出文件中。
四、总结
$s df_a nn ot at e是一个非常实用的工具,可以帮助用户对SD F文件进行注释和标记。
通过$s df_a nn ot at e,用户可以方便地添加注释、标记特定分子,甚至自定义注释和标记规则。
希望本文档对你理解和使用
$s df_a nn ot at e有所帮助。
如果有任何问题或建议,请随时与我们联系。
谢谢!。