2008年11月26日星期三

ncvlog: *E,DUPIDN (t.v,1795|25): identifier 'xx' previously declared [12.5(IEEE)]

这个ERROR明确指出该信号(xx)在前面已经定义了,那么解决办法当然是取消重复定义。但是若在前面没有找到该信号的显式定义(譬如,wire xx;),就要看该信号在前面是不是已经被使用了,譬如在例化别的模块时,用该信号作为连接信号。

解决办法在最先使用这个信号的地方显式定义该信号
引申: 在碰到这个ncvlog的ERROR时,先搜索,看前面是否有显式定义,若有则改之;若没有,则要考虑前面是否有用到这个信号的地方。

Tip
在verilog中,没有显示定义的变量,编译器会默认其类型为wire,相当于定义了该信号。当编译器解析到显式定义的地方时,就会认为是重复定义。

2008年11月13日星期四

Avoid Using Clock Gating In FPGA Emulation

For power saving consideration, clock gating is used in ASIC design. EDA tools are used to balance clocks which come from the same source clock and only the enable signals are different. But in FPGA design, no balance is done among related clocks. The skew among related clocks may be larger or smaller which can not be forecast. This may lead to unexpected results.
Besides, there is no AND/OR/LATCH… etc. only LUT/FF/BUF in FPGA.

2008年11月11日星期二

using the same coding style(both RTL or both handcode) to get generated clock to avoid RTL simulation errors

有两个generated clock: clk1和clk2.它们都是从source clock(clk_src)分频得来的。在STA的constrain中,clk1和clk2是sync的,因此CTS后,可以保证clk1和clk2是sync的。

clk1是用RTL写的:
always @ (posedge clk_src or negedge rst_)
if (!rst_)
clk1 <= 1'b0;

else
clk1 <= clk1_d;

clk2是用handcode写的:
DFCNQHVTD1 DNTCLK2 (.Q(clk2), .D(clk2_d), .CP(clk_src), .CDN(rst_));
DFCNQHVTD1是technology library里面的cell.

这两段代码在功能上是相同的。在RTL仿真中,如果DFCNQHVTD1不含delay,则clk1和clk2的相位也是相同的,即边沿对齐。但是,若在RTL仿真中,DFCNQHVTD1含有delay(CP-->Q有延时),clk1和clk2就会错开一些。这可能会导致RTL simulation出错。

所以,最好全用RTL或全用handcode来产生generated clock,以避免上述的问题。

2008年11月7日星期五

Novas Debussy for Linux终极破解

Novas公司的Debussy类似于软件行业的SourceInsight,对于代码的浏览,跟踪(trace),调试(debug)等都有很好的支持,使用非常方便,是IC前端设计人员必备的一个软件。
破解的方法是在网上找的,在这儿记录一下,同时根据我的经验做了点修改。
具体过程:
1、打开一个terminal,进入debussy/platform/LINUX/bin/
2、启动gdb, gdb debussy回车
3、设置断点, break snsCheckOut回车, 程序将返回一个地址,我的是0x8dfd8b0
4、使用objdump反汇编,输出如下(同时包含机器码和汇编代码,方便定位)
objdump -d --start-address=0x8dfd800 --stop-address=0x8dff900 debussy
08dfd8b0 <snsCheckOut>:
8dfd8b0: 55 push %ebp
8dfd8b1: 89 e5 mov %esp,%ebp
8dfd8b3: 81 ec 0c 30 00 00 sub $0x300c,%esp
8dfd8b9: 57 push %edi
8dfd8ba: 56 push %esi
8dfd8bb: 53 push %ebx
8dfd8bc: 8a 4d 18 mov 0x18(%ebp),%cl
8dfd8bf: 88 8d fb cf ff ff mov %cl,0xffffcffb(%ebp)
8dfd8c5: 8a 4d 28 mov 0x28(%ebp),%cl
5、打开KHEX编辑器,打开debussy文件(platform下的那个35M的)搜索55 89 e5 81 ec 0c 30 00 00 57 56(这组数字根据版本不同可能有所差别,只要定位上面08dfd8b0 <snsCheckOut>:后的代码即可),将头三位改为31 c0 c3 ,存盘退出。
修改后如下:

08dfd8b0<snsCheckOut>:
8dfd8b0: 31 c0 xor %eax,%eax
8dfd8b2: c3 ret
8dfd8b3: 81 ec 0c 30 00 00 sub $0x300c,%esp
8dfd8b9: 57 push %edi
8dfd8ba: 56 push %esi
8dfd8bb: 53 push %ebx
8dfd8bc: 8a 4d 18 mov 0x18(%ebp),%cl
8dfd8bf: 88 8d fb cf ff ff mov %cl,0xffffcffb(%ebp)
8dfd8c5: 8a 4d 28 mov 0x28(%ebp),%cl
7、再起debussy,一切ok.无须license,也不会trace几次就退出了。All N0v@$ products for all Operating systems can be cr@cked easily without license file.Just force the return value of the procedure "snsCheckOut" to "0" or fool the "compare and jump" instruction after calling "snsCheckOut"

about objdump:
-d --disassemble Display the assembler mnemonics for the machine instructions from objfile. This option only disassembles those sections which are expected to contain instructions.
--start-address=address Start displaying data at the specified address. This affects the output of the -d, -r and -s options.
--stop-address=address Stop displaying data at the specified address. This affects the output of the -d, -r and -s options.