하드웨어 설계/Design Compiler User Guide

Chapter5 Working With Desings in Memory Part2

가카리 2012. 8. 15. 15:18
반응형

Chapter5 Working With Desings in Memory Part2

 

Chapter5는 내용이 많아서 2개로 나눴습니다.

 

 

Design Compiler User Guide_Version F-2011.09-SP2, December 2011.pdf

 

linking designs

 

 

 

set search_path "$search_path libs cons .."

set link_library "* tcbn65lpvtwc.db"

 

linking 과정

 

1.     현재 디자인에서 무슨 라이브러리 컴포넌트를 썼는지 결정한다.

2.     link 라이브러리에서 사용된 라이브러리 컴포넌트가 있는지 찾는다,

è  첫 번째로 local_link_library 명령어를 쓴 라이브러리부터 찾는다.

è  두 번째로 ‘*’가 있으면 메모리에 이미 올려져있는 라이브러리부터 찾는다

è  마지막으로 link_library 명령어를 쓴 라이브러리에 찾는다.

3.     2번 과정에서 찾지못하면 search_path에 명시된 디렉토리에 있는 라이브러리를 찾아본다.

4.     찾았다면 references를 라이브러리에 매핑 시킨다.

 

linking 과정을 통해서 timing values and path delay, 파워 소비를 계산한다.

 

Chaging Design References

 

change_link 명령어를 사용해서 이미 link된 컴포넌트나 디자인의 매핑을 바꿀 수 있다.

바꿀때 항상 같은 포트 갯수와 같은 사이즈를 가지고있어야한다.

 

ex1)

MY_ADDER U1 U2를 다시 link를 하게 된다.

 

ex2)

이 경우는 U1셀의 링크를 lsi_10k/AN3로 바꾸는 것이다.

 

ex3)

 

 

이경우는 inv1인스턴스를 사용하는 곳이 bot1 bot2인 경우인데 이때는 –all_instance를 위와같이 써주면 bot2에 있는 inv1도 바뀐다.

 

 

 

 

Specifying Design object

 

 

set_dont_touch : dont_touch design이나 cell에 붙는 attribute로서 일단 set되고 나면 더 이상 re-optimzed되지 않습니다.

즉 단 한번만 컴파일이되고 그다음부터는 절대로 건들이지 않습니다.

 

db파일로 save하더라도 이 속성은 살아있습니다. cell set_dont_touch하면 해당 design cell이 변하지 않는 것이고 design set_dont_touch하면 해당 referece는 어디에 instatiated되건 수정되지 않습니다. 아래와 같이 사용됩니다.


dc_shell> current_design = TOP
dc_shell> set_dont_touch u1
또는 set_dont_touch find(cell, u1)
또는

dc_shell> current_design = BlockB
dc_shell> set_dont_touch find(design,BlockA)
report_referece report_cell 명령으로 attribute를 확인할 수 있고 remove_attribute로 속성을 삭제할 수 있습니다.

 

 

위에서 U3 U4 dont_touch속성을 했기때문에 첫번째 compile에서는 수행하지만 두번째 compile에서는 U3 U4를 컴파일하지 않습니다.

 

 

 

상대주소 지정법

 

 

current_design은 현재의 디자인(즉 모듈)을 지정하고 그 다음 U1/U15를 통해서 인스턴스를 지정해준다.

 

아니면 아래처럼 current_instance U1처럼 인스턴스를 지정해주고 set_dont_touch U15로 지정해주는 방법도 있다.

 

위처럼 current_instance로 지정하게되면 top module이 현재 경로가 된다.

절대주소 지정법

 

형식은

 

[file:]design/object 이며

 

file은 실제 파일명을 써준다. 이유는 다른 파일에 같은 object가 있는 경우가 있을 수도 있기 때문이다.

 

design dc_shell상의 design 이름을 써준다.

 

object는 실제 인스턴스 이름을 써준다.

 

 

 

Creating Designs

 

새로운 design을 만드는 방법

 

 

create_design을 하면 design object(port, wire, instance )이 아무것도 없다.

create_clock, create_cell, create_port등으로 design object를 추가해줘야한다.

 

 

 

Copying Designs

 

copy_design 명령어를 사용한다.

 

 

Renaming Designs

 

rename_design 명령어를 사용한다.

 

 

 

rename_design 옵션들

 

 

example) –prefix 사용방법

 

dc_shell> get_cells -hier -filter "ref_name == D" //D로 시작하는 인스턴스를 검색

{b_in_a/c_in_b/d1_in_c b_in_a/c_in_b/d2_in_c}//다음이 검색됨

 

dc_shell> rename_design D -prefix NEW_ -update_links//D NEW_로 바꿈

Information: Renaming design /test_dir/D.ddc:D to /test_dir/D.ddc:NEW_D. (UIMG-45) //바뀐것을 확인

 

dc_shell> get_cells -h -filter "ref_name == D"//D로 시작하는것을 찾아보니까 없음

# no such cells!

 

dc_shell> get_cells -h -filter "ref_name == NEW_D" //NEW_D로 검색이 됨.

{b_in_a/c_in_b/d1_in_c b_in_a/c_in_b/d2_in_c}

 

 

Changing the Design Hierarchy

 

Hierarchy를 볼 수 있는 방법은 report_hierarchy라는 명령어를 쓰면된다.

Design Hierarchy를 바꾸는 방법은 다음과 같다.

 

1.     Adding levels of hierarchy

2.     Removing levels of hierarchy

3.     Merging cells from different subdesigns

 

 

1.    Adding levels of hierarchy

그룹화를 통해서 hierarchy 레벨을 만들 수 있다.

group 명령어를 통해서  몇개의 셀을 새로운 subdesign으로 그룹화를 할 수 있다.

 

 

 

example1)

u1 u2를 그룹화 시켜서 디자인이름을 SAMPLE 셀이름을 U로 함

 

dc_shell > group {u1 u2} –design_name SAMPLE –cell_name U

 

example2)

alu로 시작하는 모든셀을 그룹화함. 디자인 이름은 uP 셀이름은 UCELL로함

 

dc_shell > group “alu*” –design_name uP –cell_name UCELL

 

example 3)

mid1의 아래에 bot1, foo1, j 를 그룹화함

 

dc_shell > group {mid1/bot1 mid1/foo1 mid1/j} –cell_name U1 –design_name SAMPLE

 

로 하거나

 

dc_shell > current_design mid

dc_shell > group {bot1 foo1 j} –cell_name U1 –design_name SAMPLE

 

 

 

 

bussed gate의 의미는 게이트가 멀티비트 signal로 연결됬을 때를 말한다.

VHDL block 예제

 

 

 

Example 1 To group all cells in the HDL function bar in the process ftj into design new_block, enter

 

dc_shell> group -hdl_block ftj/bar -design_name new_block

 

Example 2 To group all bused gates beneath process ftj into separate levels of hierarchy, enter

 

 dc_shell> group -hdl_block ftj -hdl_bussed

 

 

 

 

 

 

Removing Levels of Hierarchy

 

Design Compiler hierarchical 경계를 넘어서 최적화 하지는 않는다. 만약에 이러한 hierarchy를 없애면 타이밍 결과에 있어서 좀더 장점이 있을 것이다.

 

그래서 ungrouping이라는 방법으로 hierarchy를 없앨 수 있다. ungrouping은 최적화전이나 최적화하는 동안에 끝난다. ungrouping을 하면 해당 셀이 부모셀로 들어가게 된다.

 

유의할 점

만약에 design, subdesigns, 그리고 셀이 dont_touch 속성을 가지고 있다면 ungroup을 할 수 없다.

 

 

 

 

 

간단히 말해서

 

-flatten은 그룹을 한 개로 만들고

-start_level number 는 층이 number층이 될때까지 만들고

-prefix prefix_name ungroup된 것에 앞에 이름을 붙이고

-small number leaf cell의 갯수가 최소 number가 될 때까지 수행함.

 

 

Example 1 To ungroup a list of cells, enter

dc_shell> ungroup {high_decoder_cell low_decoder_cell}

 

 

Example 2 To ungroup the cell U1 and specify the prefix to use when creating new cells, enter

dc_shell> ungroup U1 -prefix "U1:

 

 

Example 3 To completely collapse the hierarchy of the current design, enter

dc_shell> ungroup -all flatten

 

 

Example 4 To recursively ungroup cells belonging to CELL_X, which is three hierarchical levels below the current design, enter

dc_shell> ungroup -start_level 3 CELL_X

 

 

Example 5 To recursively ungroup cells that are three hierarchical levels below the current

 

design and belong to cells U1 and U2 (U1 and U2 are child cells of the current design), enter

dc_shell> ungroup -start_level 2 {U1 U2}

 

 

Example 6 To recursively ungroup all cells that are three hierarchical levels below the current design, enter

dc_shell> ungroup -start_level 3 -all

 

 

Example 7 This example illustrates how the ungroup command can accept instance objects (cells at a lower level of hierarchy) when the parent design is unique.

 

 In the example, MID1/BOT1 is a unique instantiation of design BOT.

 

The command ungroups the cells MID1/BOT1/FOO1 and MID1/BOT1/FOO2.

dc_shell> ungroup {MID1/BOT1/FOO1 MID1/BOT1/FOO2}

 

 

The preceding command is equivalent to issuing the following two commands:

dc_shell> current_instance MID1/BOT1

dc_shell> ungroup {FOO1 FOO2}

 

 

Ungrouping Hierarchies Explicitly During Optimization

 

최적화하는 동안 ungrouping을 하려면 set_ungroup 명령어를 사용한다.

다음은 사용 방법이다.

 

For example, to ungroup cell U1 during optimization, enter the following commands:

dc_shell> set_ungroup U1

dc_shell> compile

 

만약에 ungroup 속성을 확인하고 싶으면

dc_shell > get_attribute object ungroup

 

ungroup 속성을 제거 하려면

dc_shell > set_ungroup object false

 

모든 lower level hierachy 를 제거 하려면

dc_shell > compile –ungroup_all

 

Ungrouping Hierarchies Automatically During Optimization

 

최적화하는 동안 자동적으로 ungrouping하려면 compile_ultra compile –auto_ungroup 을 쓴다

 

compile_ultra는 타이밍 최적화에 중점을 둔 ungrouping이고

 

compile –auto_ungroup area

compile –auto_ungroup delay

로 타이밍이나 area측면으로 ungrouping을 할 수 있다.

 

 

 

 

 

Preserving Hierarchical Pin Timing Constraints

 

Compile flow

Effect on hierarchical pin timing constraints

Ungrouping a hierarchy before optimization by using ungroup

timing constraint가 보존된다.

ungroup_preserve_constraints 변수를 false로 두면 보존되지않는다.

Ungrouping a hierarchy during optimization by using compile –ungroup_all or set_ungroup follwed by compile

timing constraint가 보존되지 않는다.

auto_ungroup_preserve_constraints 변수를 true로 두면 보존된다.

Automatically ungrouping a hierachy during optimizationm that is, by using the compile_ultra or compile –auto_ungroup area|delay command

timing constraint가 보존되지 않는다.

auto_ungroup_preserve_constraints 변수를 true로 두면 보존된다.

 

만약에  timing constraints를 보존하게 된다면 이 constraint는 인접한 핀으로 재할당하게 되는데 이때 인접한 핀이 leaf cell이면 size_only라는 속성을 할당하게 된다. size_only셀이 증가하면 최적화할 때 제한이 많아지게 된다.(이유는 더이상 쪼개질수 없는 leaf cell에 많은 contraint가 걸리게되므로)

 

set_false_path

set_multicycle_path

set_min_delay

set_max_delay

set_input_delay

set_output_delay

set_disable_timing

set_case_analysis

create_clock

create_generated_clock

set_propagated_clock

set_clock_latency

 

Note: The set_rtl_load constraint is not preserved. Also, only the timing constraints of the current design are preserved. Timing constraints in other designs might be lost as a result of ungrouping hierarchy in the current design.

 

 

 

Merging Cells From Differnt Subdesigns

 

다른 subdesign에서 하나의 셀로 합치는 법

 

dc_shell> group {u_add u_mult} -design alu

dc_shell> current_design alu

dc_shell> ungroup -all

dc_shell> current_design top_design

위와같은 순서로 하면 u_add u_mult alu라는 디자인으로 만들어지고 ungroup을 통해서 완전히 하나의 셀로 된다. (u_add u_mult가 각각 트리로 이루어져있으면 ungroup을 해야 하나의 완전한 셀로 된다.)

 

Editing Designs

 

다음 명령어로 메모리안에 있는 디자인을 에디트할 수 있다. 이 명령어로 외부 포맷 대신에 dc_shell로 디자인 수정을 할 수 있다.

 

 

 

example)

dc_shell> create_cell mid1/foo my_lib/AND2

 

mid1 design foo라는 셀을 추가시킴 이때 셀은 my_lib/AND2를 가져옴.

 

dc_shell> get_pins U8/*

{"U8/A", "U8/Z"}

dc_shell> all_connected U8/A

{"n66"}

dc_shell> all_connected U8/Z

{"OUTBUS[10]"}

dc_shell> remove_cell U8

Removing cell ’U8’ in design ’top’. 1

dc_shell> create_cell U8 IVP

Creating cell ’U8’ in design ’top’. 1

dc_shell> connect_net n66 [get_pins U8/A]

Connecting net ’n66’ to pin ’U8/A’. 1

dc_shell> connect_net OUTBUS[10] [get_pins U8/Z]

Connecting net ’OUTBUS[10]’ to pin ’U8/Z’.

 

위처럼 하면 all_connected 명령어를 통해서 어느 넷이나 포트 핀에 연결되있는지 확인하고 그다음 remove_cell로 셀을 삭제한다.

create_cell IVP(인버터 파워가 큰)타입으로 U8을 만들고 connect_net으로 넷을 연결 시켜주면된다..

 

위 과정을 다음 한줄로 요약할 수 있다.

 

dc_shell > change_link U8 IVP

 

 

Resize a cell

 

get_alternative_cell 명령어로 다른 라이브러리 셀을 가져온다.

그리고 size_cell 명령어로 leaf cell drive strength를 바꿀 수 있다.

 

Inserting buffers or inverter pairs

 

insert_buffer 명령어로 핀이나 포트에 버퍼를 추가 할 수 있다.

-inverter_pair 옵션을 주면 single non-inverting 라이브러리 셀 대신에 inverting library의 쌍을 삽입한다.

 

 

 

 

 

single input non inverting buffer

 

Removing buffers

 

remove_buffer 커맨드를 사용한다.

 

Translating Designs From One Technolygy to Another

 

한 디자인을 현재 라이브러리에서 다른 라이브러리로 바꿀때 translate 명령어를 사용한다.

 

Translating Designs in Design Compiler

 

1. Read in your mapped design.

dc_shell > read_file design.ddc

 

2. 타겟 라이브러리 설정

dc_shell > set target_library target_lib.db

 

3. translate 실행

dc_shell  > translate

 

Translating Designs in Design Compiler Topographical Mode – 생략

 

Restrictions on Translating Between Technologies

 

bus = driver = buffer

 

다른 Technology translating 할 때 유의해야 할 점

1. translate 는 기능적으로는 변환하지만 drive strength는 변할 수 있다. 항상 라이브러리에서 가장 작은 drive strength를 쓰기 때문이다.

2. CMOS 3-state components FPGA translate할 때 기능적으로 같은 technology에는 존재하지 않을 수도 있다.

3. Buses driven CMOS 3-state components는 반드시 모두 디코드 해야한다. 이 경우에는 Bus drivers 가 컨트롤 로직으로 translate 된다.

이렇게 하기 위해서는 translating 전에 compile_assume_fully_decoded_three_state_buses 변수를 true로 해야한다.

4. 3-state 버스가 한 디자인 안에 하나 또는 많은 수의 아웃풋 포트와 연결되었다면 버스를 translating을 할 때 포트의 기능적인 변화가 일어난다 그래서 에러가 날 것이다.

 

Removing Designs From Memory

 

dc_shell메모리에서 디자인을 지우고 싶다면 remove_design 커맨드를 쓰면된다.

-all 옵션은 모든 디자인과 라이브러리를 메모리에서 지운다.

 

dc_shell> set PORTS [all_inputs]

 {"A0", "A1", "A2", "A3"}

dc_shell> query_objects $PORTS

PORTS = {"A0", "A1", "A2", "A3"}

dc_shell> remove_design

Removing design ‘top’ 1

dc_shell> query_objects $PORTS

Error: No such collection ‘_sel2’ (SEL-001)

 

 

 

 

 

 

 

Saving Design format.

다음은 Design Compiler가 제공가는 save 포맷이다.

 

 

 

 

Commands to Save Design Files

 

저장하는 명령어는 write write_milkyway가 있다.

 

write의 사용

 

 

 

 

 

 

Example 1 The following command writes out all designs in the hierarchy of the specified design:

 

다음과같이 hierarchy 옵션을 주면 subdesign까지 모두 저장된다.

dc_shell> write -hierarchy -format ddc top

Writing ddc file top.ddc

Writing ddc file A.ddc

Writing ddc file B.ddc

 

 

Example 2 The following command writes out multiple designs to a single file:

 

다음과같이 output 파일명을 적어주면 그 파일명으로 저장된다.

dc_shell> write -format ddc -output test.ddc {ADDER MULT16}

Writing ddc file test.ddc

 

set_attribute 명령어 사용

 

dc_shell > set_attribute lsi_10K/FJK3 dont_touch true

이렇게 하면 lsi_10K dont_touch 속성이 된다.

 

dc_shell > report_attribute –obj_type object

이렇게 하면 objectattribute를 모두 볼 수 있다.

 

dc_shell> get_attribute OUT7 max_fanout

Performing get_attribute on port ’OUT7’.

{3.000000}

위처럼하면 max_fanout에 관한 속성만 볼 수 있다.

 

 

attribute 값을 저장하려면

 

dc_shell > write_script > attr.scr

 

이런식으로 write_script 연산자를 쓴다.

 

dc_shell > remove_attribute OUT7 max_fanout

 

remove_attribute 명령어를 통해서 OUT7 max_fanout 속성을 지울수 있다.

 

dc_shell> reset_design

Resetting current design ’EXAMPLE’.

1

 

reset_design을 하면 모든 클럭이나 인풋 아웃풋 딜레이, 작동조건, 타이밍 조건 등의 모든 정보들이 없어진다.

 

 

 

반응형