首页 验证与VCS使用

验证与VCS使用

举报
开通vip

验证与VCS使用 第四章 验证与 VCS使用 本章将讲述的内容: 第一节 验证 。什么是验证 。为什么需要验证 。验证的重要性 。如何进行验证 第二节 VCS简单使用方法 2.1什么是 VCS 2.2VCS可以做什么 2.3怎样进行验证 2.4VCS的工作方式 2.5VCS使用方法 举个简单例子 2.6VirSim的图形方式和每个窗口的介绍 附录 A. VCS的参数 附录 B. virsim简明帮助 附录 C. simv简明帮助 第一节 验证 当代码编写完之后,怎么确定是正...

验证与VCS使用
第四章 验证与 VCS使用 本章将讲述的内容: 第一节 验证 。什么是验证 。为什么需要验证 。验证的重要性 。如何进行验证 第二节 VCS简单使用方法 2.1什么是 VCS 2.2VCS可以做什么 2.3怎样进行验证 2.4VCS的工作方式 2.5VCS使用方法 举个简单例子 2.6VirSim的图形方式和每个窗口的介绍 附录 A. VCS的参数 附录 B. virsim简明帮助 附录 C. simv简明帮助 第一节 验证 当代码编写完之后,怎么确定是正确的呢,代码能不能符合设计 要求 对教师党员的评价套管和固井爆破片与爆破装置仓库管理基本要求三甲医院都需要复审吗 ,能不能完成所需 要的功能,这就是验证所要做的工作。验证在设计中有很重要的地位,从设计 流程 快递问题件怎么处理流程河南自建厂房流程下载关于规范招聘需求审批流程制作流程表下载邮件下载流程设计 中可以看 到,几乎设计工作每前进一步,都要进行验证。 对验证的要求,大多数人认为只要编译通过之后,能实现功能就可以了,其实决不仅仅 这么简单,验证的目的应该是尽量多的找到代码中的错误,不管是编写错误还是功能错误, 找出的错误越多,验证工作就做的越好越好。 既然验证这么重要,如何进行验证呢?对于验证来说,不同等级的验证,它的方法是不 一样的。什么是验证的等级,从设计流程(下图)可以看到,验证可以大致分为单独子模块 验证、功能模块验证、系统顶级验证。 。单独子模块验证,需要做的工作是验证它的功能和逻辑是否符合设计要求 。功能模块验证,需要验证这个模块的功能可不可以满足要求,是否会有非法数据或不 该有的输出,错误的状态等。 。系统顶级验证,更关注于系统整体的行为方式,模块间的联系和通讯,总线信号,数 据流路径是否满足设计要求,数据处理或时序正确与否等。 验证需要一个支持的平台,这就是 test_bench,在这个测试平台上,有激励信号产生器、 被测模块、响应分析和监测器,(下图) 激励与控制:输入端口设置,测试向量,测试模式设置,同步。 响应分析器和监测器:可以及时监控输出信号变化,可以判断输出信号是正确、合法、错误、 非法等等。 testbench可以用 verilog描述语言搭建,也可以用 C语言编写,如果用 C语言编写,还 需要相关的编译器并和与 verilog的接口。 第二节 VCS的简单使用方法 2.1 什么是 VCS VCS的全称是Verilog Compile Simulator,是Synopsys公司的强有力的电路仿真工具,可 以进行电路的时序模拟。 2.2 VCS的工作方式 VCS运行首先把输入的verilog源文件编译,然后生成可执行的模拟文件,也可以生成 VCD或者VCD+记录文件。然后运行这个可执行的文件,可以进行调试与分析;或者查看 生成的 VCD或者 VCD+记录文件。还生成了一些供分析和查看的文件,以便于调试。 2.3 怎样进行仿真和验证 仿真测试一个模块的大致步骤如下: (1) 首先需要编写好模块的 verilog代码。 (2) 搭建 testbench,充分了解被测模块的特性,编写测试向量,输入端口的激励, 编写响应分析和监测部分。 (3) 运行 VCS进行模拟,查看输出或者波形。 (4) 若发现错误,分析错误类型和原因,修改代码或者修正测试方法,直到符合测 试要求。 2.4 VCS的运行方式 VCS的运行方式有两种,一种是交互模式(interactive mode),一种是批处理模式(batch mode),两种方式各有优劣,具体用在不同的情况下。在测试小模块或者底层模块,情况不 太复杂的时候,而又需要很详细信息的时候,可以采用交互模式,交互性能更好,显示更直 观;当进行复杂测试而关注于整体性能,而不必去查看每个信号的时候,只需要查看所需要 关心的信号即可,这种情况可以用批处理模式。 2.5 VCS简单使用例子 Module Monitor & Analyzer Stimulus & Control veronica 高亮 下面用一个简单的例子来说明如何使用 VCS 这是个四位全加器的 verilog代码,存储为 add4.v, module addr4 (clk,in1, in2, sum, carry); output [3:0] sum; output carry; input clk; input [3:0] in1, in2; reg [3:0] sum; reg carry; integer temp; initial begin sum = 0; carry = 0; end always @(posedge clk) begin temp = in1+in2; sum=temp; if (temp > 15) carry = 1; else carry = 0; end endmodule 然后再根据这个模块写一个测试模块,也称之为 testbench,存为 top.v, module top; reg clk_reg; reg [3:0] in1_reg, in2_reg; wire [3:0] sum; wire carry; addr4 a4 (clk_reg,in1_reg, in2_reg, sum, carry); parameter d = 100; initial begin clk_reg=0; in1_reg = 0; in2_reg = 0; repeat (16*100) begin #d in1_reg = in1_reg+1; in2_reg = in2_reg+1; // $display($stime,,"in1_reg +%d in2_reg+ %d = sum %d carry is %d", in1_reg, in2_reg, sum, carry); // $display($stime,," %b + %b = %b and carry is %b", in1_reg, in2_reg, sum, carry); end // $strobe($stime,,"in1_reg %b in2_reg %b sum %b carry %b", in1_reg, in2_reg, sum, carry); #1 $finish(2); end always begin #50 clk_reg= ~clk_reg; end always @(sum) begin //$display($stime,,"in1_reg +%d in2_reg+ %d = sum %d carry_reg is %d", in1_reg, in2_reg, sum, carry_reg); $display($stime,,"now at a clock posedge,the operation is :: %d + %d = %d and carry is %d", in1_reg, in2_reg, sum, carry); //$stop; end endmodule 最简单的仿真,只要运行 vcs filename即可,filename可以有很多个, 比如上面的例子: vcs top.v add4.v 然后,如果没有发现编译错误,将会出现 VCS 的说明和一些信息,接下来的就是它的 执行情况,翻译 top.v和 add4.v,可以自动发现顶层模块,如果定义了 timescale将显示用的 timescale信息,如果没有,就显示 No TimeScale specified。然后将产生一个名为 simv的可 执行文件,这个就是模拟仿真文件。 下面是运行结果: Parsing design file 'top.v' Parsing design file 'add4.v' Top Level Modules: top No TimeScale specified 1 of 2 unique modules to generate 1 of 1 modules done Invoking loader... simv generation successfully completed 下面我们来运行一下这个 simv可执行文件, simv 结果将显示: Chronologic VCS simulator copyright 1991-2001 Contains Synopsys proprietary information. Compiler version 6.0; Runtime version 6.0; Jan 8 15:37 2002 0 now at a clock posedge,the operation is :: 0 + 0 = 0 and carry is 0 150 now at a clock posedge,the operation is :: 1 + 1 = 2 and carry is 0 250 now at a clock posedge,the operation is :: 2 + 2 = 4 and carry is 0 350 now at a clock posedge,the operation is :: 3 + 3 = 6 and carry is 0 450 now at a clock posedge,the operation is :: 4 + 4 = 8 and carry is 0 550 now at a clock posedge,the operation is :: 5 + 5 = 10 and carry is 0 650 now at a clock posedge,the operation is :: 6 + 6 = 12 and carry is 0 750 now at a clock posedge,the operation is :: 7 + 7 = 14 and carry is 0 850 now at a clock posedge,the operation is :: 8 + 8 = 0 and carry is 1 950 now at a clock posedge,the operation is :: 9 + 9 = 2 and carry is 1 1050 now at a clock posedge,the operation is :: 10 + 10 = 4 and carry is 1 1150 now at a clock posedge,the operation is :: 11 + 11 = 6 and carry is 1 1250 now at a clock posedge,the operation is :: 12 + 12 = 8 and carry is 1 1350 now at a clock posedge,the operation is :: 13 + 13 = 10 and carry is 1 1450 now at a clock posedge,the operation is :: 14 + 14 = 12 and carry is 1 1550 now at a clock posedge,the operation is :: 15 + 15 = 14 and carry is 1 1650 now at a clock posedge,the operation is :: 0 + 0 = 0 and carry is 0 1750 now at a clock posedge,the operation is :: 1 + 1 = 2 and carry is 0 1850 now at a clock posedge,the operation is :: 2 + 2 = 4 and carry is 0 1950 now at a clock posedge,the operation is :: 3 + 3 = 6 and carry is 0 2050 now at a clock posedge,the operation is :: 4 + 4 = 8 and carry is 0 2150 now at a clock posedge,the operation is :: 5 + 5 = 10 and carry is 0 2250 now at a clock posedge,the operation is :: 6 + 6 = 12 and carry is 0 2350 now at a clock posedge,the operation is :: 7 + 7 = 14 and carry is 0 2450 now at a clock posedge,the operation is :: 8 + 8 = 0 and carry is 1 ⋯⋯⋯⋯(略) $finish at simulation time 160001 V C S S i m u l a t i o n R e p o r t Time: 160001 CPU Time: 0.100 seconds; Data structure size: 0.0Mb Tue Jan 8 15:37:31 2002 验证输出的这些信息,就可以发现,模块的设计是正确的,满足和全加器的设计要求。 注意到 top.v文件中的注释掉的几行,也可以用其他方式显示,特殊情况需要特殊处理。 2.6 图形方式的 VCS 下面用图形方式启动 VCS,可以进行更方便的控制和监测, 运行 VCS –RI top.v add4.v (-RI的选项就是打开交互式图形界面,是指 Run Interactive) 运行上面的命令会打开 VirSim主程序,Interactive窗口会自动打开。 2.6.1 VirSim概况 Virsim是基于 OSF/Motif的图形化仿真调试系统,Virsim可以和 VCS、EPIC powermill 以及 Timemill一起协同工作。利用 Virsim与 VCS交互式的工作方式可以在模拟的过程中显 示仿真结果,结果可以存到一种叫做 VCD+的文件中。 这种图形化的调试系统可以支持三种基本的调试方式:波形、结构和代码。这几种方式 可以同时地使用。支持标准 Verilog 的所有函数、语法、系统调用和编程语言接口(PLI, Programming Language Interface)。Virsim是一个多窗口调试系统,可以允许用户根据需要打 开很多个调试窗口。 VirSim可以有两种方式运行:交互模式(interactive mode)和后处理模式(post-processing mode)。第一种模式允许实时的控制仿真的进行,允许在模拟的过程中改变寄存器的值或者 设置,这些改变会实时地影响到模拟的结果。第二种模式先输出用户指定选择的信号及其变 化过程到一个文件中,然后可以用 VirSim来分析这个文件。该文件是 VCD+类型的,VCD+ 文件是一种二进制的格式,里面记录了 VCS模拟的结果,和信号的变化历史等信息。 下面这就是VirSim的主窗口: VirSim是一个整体集成包,有六个相互有关联关系的工具,主要的工具就是交互环境 interactive窗口,还有可以查看模块结构的hierarchy窗口,查看源代码的source窗口,查看逻 辑连接的logic窗口,查看波形状况的有waveform窗口,查看寄存器、变量等的register窗口。 通过点击VirSim主窗口的按钮可以打开这几个窗口,也可以在这几个窗口里面通过菜单或者 快捷键打开其他的窗口。 2.6.2 interactive窗口 下面这个是 interactive窗口,可以看到,模拟刚开始先停在 0时刻。 在 interactive窗口,在这个窗口中,可以进行随时的交互式的控制,随时监控电路的模 拟状况。如果已经写了输入信号序列,如果在 testbench 中写了$stop,可以执行到这个硬断 点。 这里说明几种调试中的断点类型:硬断点,是调用了 verilog的系统函数$stop的这类断 点;软断点,是在交互环境中用 tbreak命令产生的断点;信号变化断点,是在模拟过程中定 义了敏感信号,当这个信号一旦有变化,就会中断模拟过程。设置合适的断点是调试的技巧 和重要的手段。 veronica 高亮 2.6.3 hierarchy窗口 点击主窗口中的 hierarchy按钮打开 hierarchy窗口,在这个窗口中系统会用不同的颜色 来表示设计的层次结构,可以表示出来的有:模块、任务、函数、有名块、信号、寄存器、 线网、输入输出等。这个窗口可以认为是一个查看器(brower),用户可以用鼠标把需要查 看的对象拖动到其他相应的窗口中,后面会讲述到怎么拖动和如何查看。 这个窗口有三个区域,结构查看区域、搜索区域、选择区域,如下图所示。 (1) 结构查看区域:在这里可以查看设计中的各个模块层次结构,选择、拖拉,这个区 域提供两种查看方式:单级(one level)和多级(multi level)。点击菜单的display 可以切换。在单级方式下可以依次地打开每一级,在此区域中只显示当前的模块下 属的子模块。如下所示,根模块是top,下面只有一个子模块uar,在uar的下面有五 个子模块,下面三幅图是依次打开三级模块: 如果在多级方式下,就会在这个区域里面显示多级结构,这样结构化更明显,但是 如果设计太复杂,会显得比较杂乱,显示的情况如下所示。两种方式各有优劣。 在这个窗口中,可以定义一些书签(book mark),比如在一个模块上点右键,然后选择 create bookmark,然后点击 ,就可以看到增加了一个刚才所添加的模块的项,这样 的方法在模块比较复杂的时候很方便就可以到所要查看的模块了。 (2) 搜索区域:在这个区域里面,可以寻找符合指定样式的信号或者模块名。搜索的范 围有三种,所有(All)、子模块(children)、当前所选模块(selected)。搜索到 的会在搜索区域中显示出来。可以用*匹配所有字符,用?可以匹配一个字符 (3) 选择区域,在这里,有一个过滤器,可以指定显示哪些的信号或者端口名。用*可以 匹配所有字符,用?可以匹配一个字符。 这里有个选择框 ,S表示的是信号(signal),P表示的是端口(port), 表示显示的包含信号还是端口或者都包括。 总之在这个 hierarchy 窗口中可以查看模块的层次结构,还可以查看到每个层次的寄存 器、变量、线、输入输出端口等。这个窗口中的内容有的可以拖动到其他的窗口中,比如, 打开 waveform窗口,在 hierarchy窗口,把想要查看的变量选中,然后点 add或者用鼠标中 键拖到 waveform 窗口中,因为 virsims 启动的时候电路模拟是停在 0 时刻的,所以看到 waveform现在的值都还是 X。如果把其他的窗口也打开了,比如把模块或者信号拖到 source 窗口,就会显示包含这个模块或者信号的代码文件;把模块或者信号或者端口拖到 logic窗 口,就可以显示出连接状况;把信号或者寄存器拖到 register窗口中,可以显示出这个信号 或者寄存器的值以及他的变化情况。这样就可以提供了很多种方便而有力的调试和监测方式 2.6.4 waveform窗口 这个窗口可以显示每个信号的波形状况。可以提供指针来指明时刻,可以定义标签来定 义断点,用表达式可以指定和跟踪模拟中的事件。 还可以允许用户定义表达式、信号组、 断点组。这几种方式提供了方便又强大的手段来控制仿真模拟。 veronica 高亮 waveform 窗口是基于时间线的,可以查看波形,也可以进行即时模拟,让电路运行到 某一个信号发生变化然后暂停,也可以一直运行到预先定义的硬断点。比如某个选中信号, 然后再在波形上点右键按住不放,选 next edge,或者敲击键盘的 n 键,即运行到这个信号 的下一个变化沿。 如果我们点击一下 interactive 窗口的 ,模拟就会一直执行下去,直到硬断点或 者以前设置过了的断点处,同时,看到 waveform窗口的波形已经出来了。因为注意到在 top.v 中没有设置硬断点,所以会一直执行到结束。 可以看到,每一个时钟上升沿的时候,sum=in1+in2,carry为进位输出。 下面介绍几个比较有用的功能,信号分组,标记和断点分组 (1) 信号分组,可以把几个信号定义成一个组,方法是选择几个信号,然后选择菜单 edit->Group,可以定义一个新的组名,再点击 add就创建了一个新的组。 也可以把信号加入到原来已经存在的的组中,还可以更改组名。 veronica 高亮 veronica 高亮 veronica 高亮 定义好了组之后,在 waveform窗口中有一个 按钮,按下这个按钮,就可以看 到所有的组,可以很快的查看需要的信号。 (2) 标记,marker是一个时间标签,可以定义一个时刻的别名。在波形图上,在需要加 入marker的时刻点击鼠标左键,然后选择菜单edit->Makers,在弹出的对话框中填写 一个名字然后点add,这时候可以看到波形图上有一条线,线上是marker名,如图所 示: (3) 断点,breakpoint是定义的一套基于表达式搜索的集合,当表达式成立的时候,VirSim 就会暂停下来。断点可以进行分组,这样可以方便的控制模拟的进行。 2.6.5 logic窗口 下面看看 logic窗口,把信号,或者模块用中键从 hierarchy窗口拖到 logic窗口中,就 可以看的电路的拓扑结构,可以顺着信号线查看他的连接,当模块结构比较复杂的时候,这 种方法很方便就可以检查到是否有连接错误。 在这个窗口中,有个很方便的功能,就是信号变化软中断,如果选中了某一个信号线或 者寄存器,在模拟开始或者任何一种暂停状态下,点击绿色的 ,就会模拟到这个信号 的下一个变化时刻,并且暂停下来;倘若没有选择信号,点击红色的 ,就模拟运行到 当前视图上的任意一个信号发生变化的时候暂停模拟。两种方式中,waveform 窗口也会同 步变化。这样就给了很方便的方式随时监测信号的变化和电路工作方式。 2.6.6 source窗口 veronica 高亮 veronica 高亮 veronica 高亮 下面再来打开 source窗口,把信号或者模块从 hierarchy窗口拖到这里,就马上可以看 到相关的源代码了。VCS还提供单步执行的调试方式,这需要在运行 VCS的时候加上选项 -line: vcs –RI –line filename 下面显示的是 source窗口的样子, 这样,在 source窗口中,点击黄色的 ,就可以单步执行,可以看到,每一步执行的 是哪一条语句,同时,如果打开了 waveform、logic、register窗口,还可以看到信号也是即 时变化的。 在 source 窗口中,可以直接定义断点,在行的前面点击一下,就会有个红色的圆点, 这样很方便就设置了一个断点。如果设置了断点,可以看到红色的按钮 ,按下这个按 钮,将执行到断点的位置。断点可以设置很多个。 2.6.7 register窗口 下面打开 register窗口,在 hierachy中选择几个信号或者寄存器,用中键拖到这个窗口 中,上面有个红色的 按钮,按下这个按钮,可以让模拟执行到选定的这些信号中的任 意一个发生变化,并且会红色高亮显示出来。在这个窗口中,还可以自己画一些辅助图形, 比如把信号编组然后放在一起,用矩形括起来,并加上一个标签,这在当模块复杂,需要监 视的信号很多的情况下是很方便的。这些辅助也可以被存储下来,下一次模拟的时候可以方 便地直接调用出来。 这几个窗口之间的关系是相互关联的,他们的关联关系都是通过 关联起来的,(当 然也可以断开其中之一的关联)。在实际的调试过程中,可以综合运用多种方式,结合起来 进行调试,综合运用各种断点,随时监视信号的变化是不是符合设计要求。 总之,VCS 提供了多种调试方法,功能非常强大。另外说明一点,调试工作是很烦杂 的,需要对 verilog 很熟悉,还要有很丰富的调试经验,出了问 快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题 的时候需要分析是什么问 题,再逐步缩小范围,问题查找需要耐心和方法。 附录 A. VCS 的参数: 一般的,如果不知道参数怎样使用,可以用命令帮助来看大多数的参数的使用 下面是 vcs -h的输出结果: Note: Bumping stack limit from 8192 to 65536 Kbytes. Below is a summary of the commonly used vcs options and environment variables. Many of these options have important modifiers. Please refer to the vcs manual for more information. Summary of vcs compile options: ------------------------------- -ASFLAGS "opts" pass 'opts' to the assembler -B generate long call instructions in native assembly code (HP only) -CC "opts" pass 'opts' to C compiler -CFLAGS "opts" pass 'opts' to C compiler -LDFLAGS "opts" pass 'opts' to C compiler on load line only -I enable interactive/postprocessing debugging capabilities -ID get host identification information -M enable incremental compilation (see manual) -Mupdate enable incremental compilation and keep the Makefile up-to-date -Marchive[=N] create intermediate libs to reduce link line length; N objs per lib -P plitab compiles user-defined pli definition table 'plitab' -PP enable optimizer postprocessing capabilities for vcd+ -R after compilation, run simulation executable -RI after compilation, run simulation under xvcs (Implies -I) -RIG run simulation under xvcs without compiling (executable has to exist) -RPP run xvcs in postprocessing mode (requires file created by vcdpluson) -V[t] verbose mode; with 't', include time information -as foo use foo as the assembler -cc foo use foo as the C compiler -cpp foo use foo as the C++ compiler -e specify the name of your main() routine. (see manual section 7-11 for more details). -f file reads 'file' for other options -gen_c generate C code (for HP and Sun, default is -gen_obj) -gen_asm generate native assembly code (HP and Sun only) -gen_obj generate native object code (HP and Sun only) -ld foo use foo as the linker. (refer vcs manual for compatibility with -cpp option) -line enable single-stepping/breakpoints for source level debugging -lmc-swift include lmc swift interface -lmc-hm include lmc hardware modeler interface -vera add VERA 4.5+ libraries -vera_dbind add VERA 4.5+ libraries for dynamic binding -location display full pathname to vcs installation for this platform -vhdlobj generate a vhdl obj for simulating in a vhdl design -mixedhdl include MixedHDL-1.0 interface -mhdl include MixedHDL-2.0 interface and library -q quiet mode -platform display name of vcs installation subdirectory for this platform -syslib 'libs' specify system libraries (placed last on the link line) eg -lm -o exec name the executable simulation model 'exec' (default is 'simv') -u treat all non text string characters as uppercase -v file search for unresolved module references in 'file' -y libdir search for unresolved module references in directory 'libdir' +acc enable pli applications to use acc routines (see manual) +ad include anlog simulation interface and library +adfmi="files" ADFMI support for vcs-ace +cliedit enable command line edit/recall (see doc/readline.ps) +cli enable command line interactive debugging (see manual) +cmod Enabling cmodule feature +cmodext+cmodext Changing cmodule extension to cmodext +cmodincdir+cmoddir Cmodule Include directory +cmoddefine+macro define cmodule source 'macro' in the form of XX=YY +define+macro define hdl source 'macro' to have value "macro" +plusarg_save hardwire the plusargs, which follow this flag, into simv +plusarg_ignore turn off +plusarg_save +prof tells vcs to profile the the design and generate vcs.prof file +race tells vcs to generate a report of all race conditions during simulation and write this report in the race.out file +rad+1 enable level 1 radiant optimizations (See Release Notes) +rad+2 enable level 2 radiant optimizations (See Release Notes) +libext+lext use extension 'lext' when searching library directorys +librescan search from beginning of library list for all undefined mods +incdir+idir for `include files, search directory 'idir' +nospecify suppress path delays and timing checks +notimingchecks suppress timing checks +optconfigfile+foo use 'foo' as the optimization config file (See Release Notes) +vcsd enable the VCS Direct sim kernel interface -cmhelp enable CoverMeter help. CoverMeter should be installed and environment variable CM_HOME should be set. -cm enable VCS to first run cmSource to instrument the Verilog source files on the command line, and then to compile the instrumented source files -cm_all enable VCS to link CoverMeter into the VCS executable in a way that enables line, condition, and FSM coverage and establishes the direct link. Enabling all types of coverage and the direct link is the default condition when you include the -cm option so you can omit this option -cm_lineonly enable VCS to link CoverMeter into the VCS executable in a way that only enables line coverage when it also establishes the direct link. Use this option for faster simulation and when you only need line coverage Summary of vcs runtime options: ------------------------------- -V verbose mode -grw file send $gr_waves output to 'file' -i file upon entering interactive mode, read 'file' as list of commands -k file|off rename (or disable) the 'vcs.key' file -l logfile write output to 'logfile' -q quiet mode -s stop at time 0 and enter interactive mode -vcd file send $dumpvars output to 'file' -vhdlrun "opts" pass 'opts' to Scirocco (scsim) for MixedHDL simulation +cliecho enable echoing of cli commands when sourcing a command file +vcs+dumpon+t turn on $dumpvars at time 't' +vcs+dumpoff+t turn off $dumpvars at time 't' +vcs+finish+t terminate simulation at time 't' +vcs+stop+t stop simulation at time 't' Summary of vcs environment variables: ------------------------------------- VCS_HOME indicate alternate vcs distribution directory VCS_CC indicate the C compiler to be used VCS_LOG indicate a runtime log file VCS_CMODLIB Specify Cmodule library 如果需要更详细的 vcs的参数说明,可以用参看 vcs的 manual手册 用 man vcs命令可以看到。 下面列举一下常用的 vcs的参数: -h 列举 vcs简明帮助 -Moption=value ,M后面的选项有很多个,下表说明 Option Default Comment directory csrc 产生的 C 语言文件和目标文件的 目录位置 filename Null 基本的 C 源文件和目标文件的基 名 makefile Makefile 产生的 makefile的文件名 srclist Filelist 包含有 makefile的文件名列表 makeprogram make 用 make来产生目标文件 update null 如果不为空,就重新产生 makefile swift null 如果不为空,就用 swift来做接口 loadlist null 如果是 yes,直接用 ld来链接程序 ldcmd null 格式化字符串来调用直接调用 ld +acc ? +cli ? -o file 指明 vcs的输出的文件名,或者是一系列文件名的基名。如果没有指定,默认 得输出文件是 simv,输出的目标都是类似于 vpidpattern.o,pid 是当前的进程 号,pattern是一系列的随机数。 -c 翻译/编译源文件,但是不链接。 -C 翻译成 C代码,但是不进行编译。 -V 显示详细的编译过程。在编译的过程中显示使用了哪些程序,有 C 编译器, 汇编器,链接器等。 -Vt 同上,但是还增加了每一个程序占用 CPU的时间。 -line 可以在源程序级进行单步执行。 -R 在完成了翻译、编译和链接之后,调用最近的那个可执行的目标文件,比如 simv这个文件。 -I 这个选项使 vcs自动加入+cli和默认得 xvcs.tab文件到编译命令行中,这个文 件支持 VCS+的系统函数,比如$vcdpluson,$vcdplusoff,$vcdplustraceon等。 -CC -lname -D option 用 potion来设置 vcs1内部调试标识号 -P file 用 file做为 PLI(programming Language Interface)表文件 -L file 用 file来做为并行布局表文件,这需要用户映射不同的程序线程,需要VCS-MT 的支持, -q 用安静的方式编译,在编译过程中不显示注释等信息。 -U 用非加速的方式运行 Vcs。Vcs 默认是用加速方式的。这种方式用来和 Verilog-XL的非加速方式对应。 -a 用加速的方式运行 Vcs。默认的是打开这个选项的。 -c 这个选项指示 Vcs 编译源文件、进行语义分析、然后产生输出的文件类似于 vpattern.o -f file file这个文件中包含一些另外附加的参数,一般用在比较大的模型中,有时候 操作系统可能会限制命令行的长度,这样可以把过长的参数写在文件中然后用 -f参数指明这个文件。 -F file 和-f参数是一样的,但是区别在于,file中的内容是参数文件所在的目录。 -i file 提供给 file中的内容做为 Vcs的输入,当到达文件结尾,就把标准输入即键盘 做为输入了。这个选项生效必需要有-R选项。 -l file 所有的编译过程都记录到 file文件中,同时也输出到标准输出,也就是显示器 上。 -s 停止选项,在模拟的开始就显暂停下来,然后进入交互模式。这个选项生效必 需要有-R选项。 -u -v file 搜索库文件 file中所有的模块来支持那些没有明文说明的模块。 -y directory 指明一个目录来进行搜索。 +define+macro+ 定义一个宏名,可以在源文件中用`ifdef 来检测,提供了预编译的功 能。 +incdir+directory+ 指定`include语句搜索的目录 +libext+extention+ 定义当搜索的时候,库文件的扩展名。比如+libexr+.v+.V+,这样就 会搜索.v和.V的文件做为库文件。 +librescan 强制为每一个没有定义过的符号进行指定库的搜索。 附录 B. VirSim的简明帮助: VirSim是 VCS的一个图形
本文档为【验证与VCS使用】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_905753
暂无简介~
格式:pdf
大小:651KB
软件:PDF阅读器
页数:0
分类:互联网
上传时间:2013-10-02
浏览量:26