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
S0
및 S1
이 모두 LIB_TIELO
개의 인스턴스로 묶인 LIB_MUX4
인스턴스를 포함하십시오.
왜 Yosys는 S0
및 S1
가 일정한 대신이
module test(a, b, c, d, result);
input a;
input b;
input c;
input d;
output result;
assign result = a;
endmodule
같은 것을 출력을 줄일 수 있다고 보지 않는다?
은 내가clean -purge
,
opt_muxtree
및
opt_clean
명령을 사용하여 시도했지만 성공하지 - 정적
LIB_MUX
인스턴스는 결과 네트리스트에 항상이다.
저는 Yosys 전문가는 아니지만 ['flatten'] (http://www.clifford.at/yosys/cmd_flatten.html) 명령을 사용해야한다고 생각합니다. [documentation] (http://www.clifford.at/yosys/documentation.html)에 따라 많은 최적화 ('opt') 명령이 있습니다. – Greg