ARTICLE DETAIL

资讯详情

深耕网站视觉设计与运营推广的一线实战洞察。

Design Compiler:使用read_file命令读取RTL设计

Design Compiler:使用read_file命令读取RTL设计 相关阅读Design Compilerhttps://blog.csdn.net/weixin_45791458/category_12738116.html?spm1001.2014.3001.5482目录read_file命令读取参数化设计举例说明等价表示写在最后Design Compiler可以使用read_file读取RTL设计不建议建议使用analyze/elaborate命令本文将对此进行详细阐述。read_file命令使用read_file命令不同于analyze/elaborate命令默认不会产生中间文件(.syn、.pvl、.mr文件)而是直接将设计读取进内存。read_file -format verilog/sverilog/vhdl **以下是支持的RTL格式Verilog源代码格式以及gzip压缩格式SystemVerilog源代码格式以及gzip压缩格式VHDL源代码格式以及gzip压缩格式虽然推荐始终使用-format选项指定格式但如果未指定该选项则会尝试根据文件扩展名自动推断格式以下是支持的RTL文件拓展名不区分大小写Verilog拓展名.v、.verilog、.v.gz、.verilog.gzSystemVerilog拓展名.sv、.sverilog、.sv.gz、.sverilog.gzVHDL拓展名.vhd、.vhdl、.vhd.gz、.vhdl.gz如果文件扩展名不属于已知类型工具会默认使用ddc格式。需要注意的是ddc文件压缩后不支持使用read_file命令读取因为这种文件已经是压缩格式了。尽管read_file命令会执行隐式链接隐式链接会在读取类命令、综合类命令、报告类命令、约束类命令等大部分命令时执行强烈建议在使用读取命令后执行link命令因为如果设计存在链接问题显式执行link命令可以帮助设计者发现并修正这些问题笔者发现隐式链接在某些情况下并不会按照link_path的从左到右的顺序进行链接而是优先使用最先读取的设计进行链接。link命令将会搜索link_path以及search_path并尝试解析引用最后尝试在默认设计库WORK中解析引用。关于默认设计库参考下面这篇博客。Design Compiler使用analyze/elaborate命令读取RTL设计https://blog.csdn.net/weixin_45791458/article/details/144949582?sharetypeblogdetailsharerId144949582sharereferPCsharesourceweixin_45791458spm1011.2480.3001.8118关于link_path以及search_path的详细信息参考下面这篇博客。Design Compiler目标(target)库、链接(link)库、符号(symbol)库、综合(synthetic)库和物理(physical)库的详细解析https://blog.csdn.net/weixin_45791458/article/details/143029536?ops_request_misc%257B%2522request%255Fid%2522%253A%2522502d65d2eef7fed72c9e2e11697448a3%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257Drequest_id502d65d2eef7fed72c9e2e11697448a3biz_id0utm_mediumdistribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-3-143029536-null-null.nonecaseutm_termlinkspm1018.2226.3001.4450读取参数化设计当使用read_file命令读取参数化设计时可能会出现问题如下例所示。// 文件adder.v module adder #( parameter WIDTH 8 )( input wire [WIDTH-1:0] a, input wire [WIDTH-1:0] b, output wire [WIDTH-1:0] sum ); assign sum a b; endmodule // 文件top.v module top ( input wire [7:0] a8, b8, input wire [15:0] a16, b16, input wire [3:0] a4, b4, output wire [7:0] sum8, output wire [15:0] sum16, output wire [3:0] sum4 ); adder #(.WIDTH(8)) u_adder8 ( .a(a8), .b(b8), .sum(sum8) ); adder #(.WIDTH(16)) u_adder16 ( .a(a16), .b(b16), .sum(sum16) ); adder #(.WIDTH(4)) u_adder4 ( .a(a4), .b(b4), .sum(sum4) ); endmodule首先使用read_file命令读取设计文件。dc_shell read_file -format verilog top.v adder.v当使用link命令尝试链接时却出现了错误如下所示。dc_shell link Linking design top Using the following designs and libraries: -------------------------------------------------------------------------- Information: Building the design adder instantiated from design top with the parameters WIDTH16. (HDL-193) Warning: Cannot find the design adder in the library WORK. (LBR-1) Information: Building the design adder instantiated from design top with the parameters WIDTH4. (HDL-193) Warning: Cannot find the design adder in the library WORK. (LBR-1) Warning: Unable to resolve reference adder in top. (LINK-5)警告显示除了默认的WIDTH参数为8的情况另外两个设计尝试在默认设计库WORK中读取失败了。这是因为读取参数化设计时需要中间文件而read_file命令默认不产生中间文件使用analyze/elaborate命令读取时不存在该问题需要将hdlin_auto_save_templates变量默认值为false设置为true允许保存中间文件。dc_shell set_app_var hdlin_auto_save_templates true举例说明下面是三个分属于三个文件的模块其中顶层模块top定义在top.v文件中其中例化了adder模块而adder模块定义在ADDER.v和adder.v文件中。// 文件adder.v module adder( input wire [7:0] a, input wire [7:0] b, output wire [7:0] sum ); assign sum a * b; endmodule // 文件ADDER.v module adder( input wire [7:0] a, input wire [7:0] b, output wire [7:0] sum ); assign sum a b; endmodule // 文件top.v module top( input wire [7:0] in_a, input wire [7:0] in_b, output wire [7:0] out_sum ); adder u_adder ( .a(in_a), .b(in_b), .sum(out_sum) ); endmodule假设已经将ADDER.v保存为ADDER.ddc文件并且在link_library中指定了该文件而adder模块来自adder.v文件在默认设计库WORK中read_file命令读取top模块后会优先使用该.ddc文件而不是设计库中的adder模块来自adder.v文件如下脚本所示。define_design_lib -path ./work/ WORK analyze -format verilog adder.v set_app_var link_library ADDER.ddc read_file -format verilog top.v // 使用ADDER.ddc而不是WORK库中的adder.vread_file不仅能读取RTL设计还可以读取Verilog网表。当指定-netlist选项时Design Compiler将启动网表读取器并出现以下提示如果此时指定文件中包含高级Verilog结构则会报错*** Verilog netlist reader terminated with 1 errors. ***。Running DC verilog reader Performing read command. Verilog netlist reader completed successfully.当指定-rtl选项时Design Compiler将启动RTL读取器即HDL Compiler并出现以下提示即使指定文件中有网表也不会报错。Running PRESTO HDLC Presto compilation completed successfully.如果不指定这两个选项Design Compiler将对文件内容进行自动检测和读取并出现以下提示。Detecting input file type automatically (-rtl or -netlist). Running DC verilog reader Performing read command. Verilog netlist reader completed successfully. Detecting input file type automatically (-rtl or -netlist). Reading with Presto HDL Compiler (equivalent to -rtl option). Running PRESTO HDLC Presto compilation completed successfully.等价表示read_file -format verilog命令相当于read_verilog命令read_file -format sverilog命令相当于read_sverilog命令read_file -format vhdl命令相当于read_vhdl命令read_file -format ddc命令相当于read_ddc命令read_file -format db命令相当于read_db命令。需要注意的是对于Fusion Compiler或IC Compiler II而言read_verilog命令只能用于读取Verilog网表而不能包含任何高级Verilog结构如always块对于PrimeTime而言read_verilog命令提供了-hdl_compiler选项用于调用HDL Compiler读取RTL设计。写在最后不建议使用read_file命令以及其等价表示读取RTL设计.ddc格式的设计和网表除外使用analyze/elaborate命令读取RTL设计更稳妥功能也更加强大。Design Compiler使用analyze/elaborate命令读取RTL设计https://blog.csdn.net/weixin_45791458/article/details/144949582?ops_request_misc%257B%2522request%255Fid%2522%253A%2522c5dbc40c5cdd020929332522dc608988%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257Drequest_idc5dbc40c5cdd020929332522dc608988biz_id0utm_mediumdistribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-4-144949582-null-null.nonecaseutm_termDesignspm1018.2226.3001.4450
返回列表