当前位置:首页 > Design Compiler简介
2-4-2 读入设计
Design Compiler提供了两种方式读入设计:
? read_file命令
dc_shell> read_file -format keyword design_file ? analyze和elaborate命令
dc_shell> analyze -format keyword design_file dc_shell> elaborate design_name
表2.3总结了使用read_file命令和analyze和elaborate命令读入设计的不同: 表2.3 read_file Versus analyze and elaborate Commands
Comparison read_file command analyze and elaborate commands Input formats All formats VHDL, Verilog When to use Netlists, precompiled designs, Synthesize VHDL or Verilog and so forth Design libraries Cannot store analyzed results Can store analyzed results in except in design library WORK specified design libraries (use the analyze command option -library or -work) Generics Cannot pass parameters (must Allows you to set parameter use directives in HDL) values on the elaborate command line Architecture Cannot specify architecture to Allows you to specify be elaborated architecture to be elaborated 当Design Compiler读入一个设计文件,它以Synopsys内部数据库格式保存在内存中。Design Compiler的优化过程仅在内存中的设计文件进行工作。
为内存中的设计,Design Compiler使用命名的惯例:path_name / design.db。path_name变量指的是原始文件所在的目录;design变量指的是设计的名称。如果你稍后读入相同名称的设计,Design Compiler将覆盖原来的设计。为防止出现这种现象,在read_file命令后加上-single_file选项。 2-4-2-1 读入.db文件
一个.db文件的版本就是生成它的Design Compiler的版本。要读入一个.db文件,文件必须与Design Compiler具有相同的版本,或版本早于正在运行的Design Compiler的版本。如果你试图读入一个由版本稍后的Design Compiler产生的.db文件,那就会出现错误信息。 2-4-2-2 读入HDL文件
利用下列的程序读入HDL设计:
? 从下到上分析顶层设计和所有子设计(满足所有从属)
? 详细描述顶层设计和任何一个需要对参数进行赋值或覆盖的子设计 1) 分析设计
analyze 命令:读入HDL源文件;检查是否有错;创建一个与HDL独立的中 间格式的HDL库对象;把中间文件存储到你所定义的位置。
如果analyze 命令报错,在HDL源文件里修改错误,然后重新分析。一旦一个设计被分析,只有
在它被改变过,才需要重新分析它。 2) 详细描述设计
elaborate命令根据分析后提供的中间文件创建一个与工艺无关的设计。在
详细描述过程中,你可以违反默认的参数值。elaborate用设计工具元件来取代HDL算术算子,决定正确的总线宽度。
2-4-3 内存中的设计清单
16
利用list_designs命令来列出装载在内存中的设计的名称:
dc_shell> list_designs A (*) B C 1
紧靠设计A的星号(*)表示设计A是当前设计。
利用-show_file选项来列出与设计名称相对应的内存文件名称:
dc_shell> list_designs -show_file /user1/designs/design_A/A.db A (*)
/home/designer/dc/B.db B C 1
紧靠设计A的星号(*)表示设计A是正在工作的设计。文件B.db包含设计B和C。
利用list_duplicate_designs命令来检查重复的设计: dc_shell> list_duplicate_designs
Warning: Multiple designs in memory with the same design name.
Design File Path ------ ---- ----
seq2 A.db /home/designer/dc seq2 B.db /home/designer/dc 1
2-4-4 设置当前设计
current_design指向当前设计,按下列方式设置:
当一个read_file命令成功完成,它将读入的设计设置为当前设计:
(1)read_file命令
dc_shell> read_file -format edif MY_DESIGN.edif Loading edif file ’/designs/ex/MY_DESIGN.edif’ Current design is now ’/designs/ex/ MY_DESIGN.edif:MY_DESIGN’ {\
(2)current_design命令
利用这个命令可设置任何一个内存中的设计为当前设计: dc_shell> current_design ANY_DESIGN Current design is ’ANY_DESIGN’. {\
显示当前设计的名称,输入: dc_shell> list current_design current_design = \my_design.db:my_design\
17
1
2-4-5 设计的链接
要完成一个设计,它就必须与涉及到的库元件和设计链接。对于每一个子设计,必然有一个基准,Design Compiler执行下列步骤来完成基准分解:
将子设计或元件与链接库相连。这个过程称为设计链接或基准分解。
(1)决定当前设计和它的层次引用哪些库元件和子设计; (2)搜索链接库,查找这些引用; (3)将设计与查找到的引用链接。
Design Compiler首先搜索local_link_library参数定义的库和设计文件,然后再搜索在一个分层的设计中,Design Compiler只考虑顶层设计的局部链接库,而忽略与子设计相关的link_library变量中定义的库和设计文件。 局部链接库。
Design Compiler使用第一找到的基准。如果它查找到了具有相同名称的额外的基准,将会产生
一个警告信息来识别这个忽视的、重复的基准。如果Design Compiler没有找到基准,警告信息建议该基准不能被分解。
图2.6显示了在链接库、单元和基准之间的链接过程,在这个例子里,Design Compiler在LIBRARY_2
图2.6 分解基准
工艺库里找到了库元件NAND2;在设计文件里找到了子设计MULTIPLIER。
你可以手动地或自动地进行设计的链接。
(1)手动链接
用link命令来手动地链接设计。在开始链接过程前,link命令移走现有的链接。 下列的dc_shell命令自动链接设计:
(2)自动链接 ? compile
? create_schematic ? group ? check_design
? report_timing, report_constraints, and other report_* commands ? compare_design
当执行自动链接时,它并不移走现有的链接。自动链接过程只工作于未链接的元件和子设计。
18
2-4-6 设计对象的清单
Design Compiler提供命令访问不同的设计对象。这些命令涉及当前设计中的设计对象。每一个
命令执行下列操作之一: (1) list:提供最小信息的清单
(2) display:提供包括设计对象属性的报告
(3) return:返回一个清单,可用作其他dc_shell命令的输入
表2.4列出了命令和它们的操作。 Object Instance Reference Por t 表2.4 Commands to Access Design Objects
Command Action list_instances Lists instances and their references. report_cell Displays information about instances. report_reference Displays information about references. report_port Displays information about ports. report_bus Displays information about bused ports. all_inputs Returns all input ports. all_outputs Returns all output ports. report_net Displays information about nets. report_bus Displays information about bused nets. report_clock Displays information about clocks. Returns all_clocks all clocks. all_registers Returns all registers. Net Clock Register 2-4-7 指定设计对象
你可以利用相对路径和绝对路径来指定设计对象。
1)使用相对路径
如果你使用相对路径来指定设计对象,它就必须在当前设计里。指定相对于当前实例的路径。当前实例是指当前设计里基准的构架。默认情况是,当前实例是当前设计的最高层。利用current_instance命令改变当前实例。
举个例子,在Count_16设计里U1和U15单元上设置dont_touch参数,可以输入: dc_shell> current_design Count_16 Current design is ’Count_16’. {\
dc_shell> set_dont_touch U1/U15 or
dc_shell> current_design Count_16 Current design is ’Count_16’. {\
dc_shell> current_instance U1
Current instance is ’/Count_16/U1’. \
dc_shell> set_dont_touch U15 2)使用绝对路径
当使用绝对路径来指定设计对象时,对象可以是内存中的任何设计。 语法如下:[ file :] design/object
举个例子,在Count_16设计里U1和U15单元上设置dont_touch参数,可以输入:
dc_shell> set_dont_touch \\
19
共分享92篇相关文档