VCS编译systemverilog和UVM的命令记录

正常应该看文档就可以了,但是在常看的 ug 和 VCSLCAFeatures真的找不到。估计是在其他的 文档里吧,所以就先记录在这。

1.-CFLAGS 和 -DVCS有什么用?

>> How to use the gcc compiler's option "-DVCS"?

-DVCS represents a macro defined for C source code. Please note that anything
followed by -D is treated as a macro by the gcc/g++ compiler. Along with
VCS compile-time options one should pass -DVCS with -CFLAGS so that
-DVCS gets passed to gcc/g++.

Example steps:
% vcs top.v test.c -CFLAGS -DVCS <rest_of_compile_options>

>> What's the compile environment that we need to use this option?

"-CFLAGS -DVCS" is usually required during UVM source compilation.
Therefore, if we are using an external UVM source then you must pass -DVCS. 
(If we are using -ntb_opts uvm then no need to pass this option because it is
internally passed with -ntb_opts uvm). Also, if we have any macros with
the name 'VCS' defined in any other C source then we need to pass
it with -CFLAGS -D<MACRO_NAME>

 
2.为不同的case准备不同版本的VCS,应该如何设置临时的环境变量? 

1)我的 .bashrc设置的是VCS12,因为大家都是12,如果我改成13,别人给我的12有时候编译不过。

2)但是用12编译uvm,再用dve打开,左边的文件目录是乱的,它把UVM的说有文件夹都给展开了。13则没有这个问题。但是每次改环境变量好麻烦。

3)所以就在专门为这个case 准备的 makefile 中临时改一下。只在这里有效,变成13;退出来又是12。道理就是makefile会临时开一个shell,把它之前最后设置的环境变量吃进去,用完再吐出来。就不会影响别的了。见下图Makefile的前2行:



这个编完之后就是13的,但是直接用dve打开,相当于又是12打开13,是打不开的。所以要敲 make wave,用makefile的cmd line打开,就是13打开13,成功!




  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值