2017-02-15 16 views
0

Combinatorial synthesis: Better technology mapping results에 대한 후속 질문입니다.이 MUX가 const 인 이유는 무엇입니까? 입력이 최적화되지 않았습니까?

나는 다음과 같은 합성 스크립트 Yosys (버전 0.5+ (git sha1 f13e387, gcc 5.3.1-8ubuntu2 -O2 -fstack-protector-strong -fPIC -Os))을 사용하고 있습니다 :

module mux4(
    input i0, i1, i2, i3, 
    input s0, s1, 
    output z); 
    reg zint; 
    always @(*) begin 
    case ({s1, s0}) 
     2'b00: zint = i0; 
     2'b01: zint = i1; 
     2'b10: zint = i2; 
     2'b11: zint = i3; 
     default: zint = i3; 
    endcase 
    end 
    assign z = zint; 
endmodule 

module test (
    input a,b,c,d, 
    output result 
); 
    mux4 inst (
    .i0(a), .i1(b), .i2(c), .i3(d), 
    .s0(1'b0), .s1(1'b0),   # constants here! 
    .z(result) 
); 
endmodule 

합성 결과 : 다음 Verilog 코드 (test.v)를 합성을하는 ...

read_liberty -lib my_library.lib 
read_verilog test.v 
hierarchy -check -top test 
proc; opt; memory; opt; fsm -norecode; opt 
techmap; opt 
dfflibmap -liberty my_library.lib 
abc -liberty my_library.lib -script \ 
    +strash;ifraig;scorr;dc2;dretime;strash;&get,-n;&dch,-f;&nf,{D};&put 
hilomap -hicell LIB_TIEHI Y -locell LIB_TIELO Y 
clean 
write_verilog -noattr -noexpr output.v 
stat 

S0S1이 모두 LIB_TIELO 개의 인스턴스로 묶인 LIB_MUX4 인스턴스를 포함하십시오.

왜 Yosys는 S0S1가 일정한 대신이

module test(a, b, c, d, result); 
    input a; 
    input b; 
    input c; 
    input d; 
    output result; 
    assign result = a; 
endmodule 

같은 것을 출력을 줄일 수 있다고 보지 않는다?

은 내가 clean -purge, opt_muxtreeopt_clean 명령을 사용하여 시도했지만 성공하지 - 정적 LIB_MUX 인스턴스는 결과 네트리스트에 항상이다.

+1

저는 Yosys 전문가는 아니지만 ['flatten'] (http://www.clifford.at/yosys/cmd_flatten.html) 명령을 사용해야한다고 생각합니다. [documentation] (http://www.clifford.at/yosys/documentation.html)에 따라 많은 최적화 ('opt') 명령이 있습니다. – Greg

답변

1
  1. 당신은 당신이 계층 적 경계를 넘어 최적화를 원하는 경우 flatten를 실행해야합니다.

  2. 당신은 아마 곧 techmap를 실행하기 전에 opt -full를 실행하려면,하지만 fsmshare 같은 높은 수준의 최적화를 실행 한 후.

  3. JFYI : 테스트 사례를 실행하는 데 필요한 모든 파일을 제공하지 않으면 사람들이 당신이 말하는 것을 재현 할 수 없습니다. 나는 귀하의 my_library.lib을 가지지 않았으므로 귀하의 코드를 실행하는 데 신경 쓰지 않았습니다.