1、基礎(chǔ)模塊IP化
2、模塊參數(shù)化
module ip_bus_sync #( //
parameter DATA_WDTH = 16 , //
parameter INI_VALUE = {DATA_WDTH{1'b0}} //
)(
input i_src_clk , //
input i_src_rst_n , //
input [DATA_WDTH-1:0] i_src_din , //
input i_dst_clk , //
input i_dst_rst_n , //
output reg [DATA_WDTH-1:0] o_dst_dout //
);
//邏輯代碼
endmodule
3、宏定義區(qū)分代碼分支
`ifdef FOR_ASIC_DESIGN
//ASIC logic
//參數(shù)定義
`else
//其他分支邏輯
//參數(shù)定義
`endif
`ifdef FOR_ASIC_DESIGN
generate
genvar i;
for ( i=0; i<DATA_WDTH; i=i+1 )
begin : SDFFY2D_INST
SDFFY_*CELL_TYPE* SDFFY2D //此處CELL_TYPE指的是具體的器件型號
(
.CK (i_dst_clk),
.D (i_src_din[i] ),
.Q (o_dst_dout[i]),
.SI (1'b0 ), //DFT 輸入信號,由DFT工程師在網(wǎng)表中完成連線
.SE (1'b0 ) //DFT 使能信號,由DFT工程師在網(wǎng)表中完成連線
);
end
endgenerate
`else
reg [(DATA_WDTH-1):0] din_d0; //
reg [(DATA_WDTH-1):0] din_d1; //
assign o_dst_dout = din_d1;
always @( posedge i_dst_clk )
begin
din_d0 <= i_src_din;
din_d1 <= din_d0;
end
`endif
4、使用參數(shù)選擇代碼分支
在同一個宏定義分支下(例如同在ASIC或者FPGA項目),我們可能需要獎模塊例化多份,以支持如下場景:
module xxxxx
#(
parameter FUNCTION_MODE = `MULTI_FUNCTION
)
(
//各類IO信號
) ;
generate
if (FUNCTION_MODE==`MULTI_FUNCTION) begin:MULTI_FUNCTION_CODE
//多function 邏輯
end
else begin:SINGLE_FUNCTION_CODE
// 單function 邏輯
end
end
endgenerate
5、IP接口隔離
6、std cell 隔離
我們通常會將std cell外包一層或者多層代碼,這樣就能將工藝與設(shè)計代碼盡量分離。
module ip_bit_sync #( parameter DATA_WDTH = 1 // bit width)(in
put wire i_dst_clk, // destination clockinput wire [(DATA_WDTH-1):0] i_src_din, // data inputoutput wire [(DATA_WDTH-1):0] o_dst_dout // data output);`ifdef FOR_ASIC_DESIGNgenerategenvar i;for ( i=0; i<DATA_WDTH; i=i+1 )begin : SDFFY2D_INSTSDFFY_*CELL_TYPE* SDFFY2D //此處CELL_TYPE指的是具體的器件型號( .CK (i_dst_clk),.D (i_src_din[i] ),.Q (o_dst_dout[i]),.SI (1'b0 ), //DFT 輸入信號,由DFT工程師在網(wǎng)表中完成連線.SE (1'b0 ) //DFT 使能信號,由DFT工程師在網(wǎng)表中完成連線);endendgenerate`elsereg [(DATA_WDTH-1):0] din_d0; //reg [(DATA_WDTH-1):0] din_d1; //assign o_dst_dout = din_d1;always @( posedge i_dst_clk ) begindin_d0 <= i_src_din;din_d1 <= din_d0;end`endifendmodule
這個技術(shù)研討會不要錯過!
時間:2023年9月26日 9:00~18:00
地點:深圳灣萬怡酒店4樓大宴會廳
(免費參會、免費午餐、參會贏好禮)
本文鏈接:http://www.www897cc.com/showinfo-27-9402-0.htmlIC設(shè)計思維:增加復(fù)用性的6種方法
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。郵件:2376512515@qq.com