如何將RTL產生netlist後讓其他人作synthesis? (SOC) (ISE)http://www.cnblogs.com/oomusou/archive/2011/02/12/ise_ngc

(原創) 如何將RTL產生netlist後讓其他人作synthesis? (SOC) (ISE)

Abstract
有時我們與其他人一起合作,又想保護自己的RTL code,但又希望別人可以作synthesis、simulation與implementation,此時我們希望只給對方synthesis後的netfile file,而不要給對方RTL code,我們該怎麼做呢?

Introduction
使用環境:Xilinx ISE 12.3

將自己的RTL合成出netlist file

假設以下是我們想合成的RTL code

counter.v / Verilog

复制代码
     
     
1 /*
2 (C) OOMusou 2011 http://oomusou.cnblogs.com
3
4 Filename : counter.v
5 Synthesizer : Xilinx ISE 12.3
6 Description : generate netlist file (*.ngc)
7 Release : 02/12/2011 1.0
8   */
9
10   module counter (
11 clk,
12 rst_n,
13 cnt_o
14 );
15
16   input clk;
17   input rst_n;
18   output [ 1 : 0 ] cnt_o;
19
20 reg [ 1 : 0 ] cnt_o;
21
22 always @( posedge clk or negedge rst_n)
23 if ( ~ rst_n)
24 cnt_o <= 2 ' h0;
25 else
26 cnt_o <= cnt_o + 1 ' b1;
27
28 endmodule
复制代码

Step 1:

New Project

ngc001

指定project名稱與路徑

Step 2:

設定FPGA型號,並使用Xilinx XST作為synthesizer

ngc002

Step 3:
Project Summary

ngc003

Step 4:

Add Source

 ngc004

Step 5:

更改XST設定

ngc005

ngc006

選擇Category選項,並將Property display level選擇Advanced;

1.不要選擇Add I/O Buffers:一般來說,XST會為Top Module加上I/O Buffer,但因為目前我們的RTL算是IP,只是其中的一小部份,所以不需加上I/O Buffer。

2.設定Number of Clock Buffers為0:一般來說,XST會為clk信號與很多fanout的信號加上Clock Buffer,由於我們只是IP,算是其中的一小部份,所以不用加上Clock Buffers。

Step 6:

使用Xilinx XST進行Synthesize,產生netlist file:counter.ngc

 

將netlist file讓其他人作Synthesis

Step 1:

將counter.ngc與counter.v複製到對方project的目錄下

由於我們netlist只是其中一小部份,只要將counter.ngc給對方,並將counter.v的外殼給對方就好,內部的code不需給,如此就可以保護我們的RTL code。

counter.v / Verilog

复制代码
     
     
1 /*
2 (C) OOMusou 2011 http://oomusou.cnblogs.com
3
4 Filename : counter.v
5 Synthesizer : Xilinx ISE 12.3
6 Description : generate netlist file (*.ngc)
7 Release : 02/12/2011 1.0
8 */
9
10 module counter (
11 clk,
12 rst_n,
13 cnt_o
14 );
15
16 input clk;
17 input rst_n;
18 output [ 1 : 0 ] cnt_o;
19
20
21 endmodule
复制代码

Step 2:

對方的Top Module

counter_top.v / Verilog

复制代码
     
     
1 /*
2 (C) OOMusou 2011 http://oomusou.cnblogs.com
3
4 Filename : counter_top.v
5 Synthesizer : Xilinx ISE 12.3
6 Description : top module for counter_top
7 Release : 02/12/2011 1.0
8 */
9
10 module counter_top (
11 clk,
12 rst_n,
13 cnt_o
14 );
15
16 input clk;
17 input rst_n;
18 output [ 1 : 0 ] cnt_o;
19
20 counter u_counter (
21 .clk(clk),
22 .rst_n(rst_n),
23 .cnt_o(cnt_o)
24 );
25
26 endmodule
复制代码

這是對方的top module,實務上當然不會這麼簡單,還不過由於我們只是IP,只是其中的一部份而已,所以在top module中使用我們的IP。

Step 3:

進行Synthesis與Implementation

或許你會問,我們給了一個沒有body的counter.v與counter.ngc,真的對方可以合成嗎?事實上,XST會為每一個.v檔synthesize相對應的netlist (*.ngc),當synthesize到counter.v時,發現已經存在counter.ngc,就是把它當成block box使用,以下是ISE所產生的warning:

     
     
WARNING:Xst: 2211 - " counter.v " line 20 : Instantiating black box module <counter>.

完整程式碼下載
counter.7z (自己IP的project)
counter_top.7z (對方的project)

Conclusion
一般人應該不會有這種需求,我是因為在工作上跟其他公司合作,當初簽約時我們只答應提供netlist給對方作simulation與verification,並不提供RTL,所以才會找出這種方式,因為頗為特殊,特別做下紀錄。

全文完。

分类: ISE, SOC
2
0
(请您对文章做出评价)
« 上一篇: (筆記) Delegate的再進化:Action Generic Delegate (.NET) (C#)
» 下一篇: (筆記) 如何使用Visual C++ 6.0開發Win32 DLL? (C/C++) (VC++)

posted on 2011-02-12 23:22 真 OO无双 阅读(4296) 评论(3) 编辑 收藏

评论

#1楼 2011-02-14 17:59Sivar  

1、modelsim中使用`protected 和 `endprotected 加密RTL代码,将产生的.vp文件给对方;
2、将modelsim编译后的目录和数据(.dat,.asm,.vhd等)做一个库给对方;
作simulation和verification的话,不知道这2种是否可行?加密之后合成(综合)工具还能合成(综合)么?
http://pic.cnitblog.com/face/u226864.gif   回复引用

#2楼[楼主] 2011-02-15 00:43真 OO无双  

@Sivar
謝謝你的建議,我來實驗一下再跟大家報告
https://i-blog.csdnimg.cn/blog_migrate/444cc3d68edd21a5ead4e47e14330f01.gif   回复引用

#3楼22915062012/1/11 13:10:55 2012-01-11 13:10sheldon_lk  

blackbox?
   回复引用

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值