我正在使用YOSYS將Verilog轉換爲BLIF。輸入是一個電路(L_0_0),它只包含不是,或者基元和一些行爲鎖存代碼。Yosys中的原始碼
我使用的命令是:
> read_verilog <file>
> proc; opt; memory; opt; techmap; opt;
> write_blif <file>
輸出文件包含$ _DFF_PN0_作爲一個沒有。模型一個.SUBCKT,所以當我輸入這個文件MVSIS,它忽略所有的subckts。
我該如何映射這個子電路,讓其他工具有所瞭解?
.model L_0_0
.inputs clk rst ce ins
.outputs outs
.names $false
.names $true
1
.names $undef
.names outs r_out_1_0 ce $0\outs[0:0]
1-0 1
-11 1
.names r_out_2_0 w_out_2_0 ce $0\r_out_2_0[0:0]
1-0 1
-11 1
.names r_out_1_0 w_out_1_0 ce $0\r_out_1_0[0:0]
1-0 1
-11 1
.names r_out_0_0 w_out_0_0 ce $0\r_out_0_0[0:0]
1-0 1
-11 1
.subckt $_DFF_PN0_ C=clk D=$0\outs[0:0] Q=outs R=rst
.subckt $_DFF_PN0_ C=clk D=$0\r_out_0_0[0:0] Q=r_out_0_0 R=rst
.subckt $_DFF_PN0_ C=clk D=$0\r_out_1_0[0:0] Q=r_out_1_0 R=rst
.subckt $_DFF_PN0_ C=clk D=$0\r_out_2_0[0:0] Q=r_out_2_0 R=rst
.names r_out_0_0 r_out_1_0 w_out_0_0
1- 1
-1 1
.names r_out_2_0 r_out_2_0 w_out_1_0
1- 1
-1 1
.names r_out_0_0 ins w_out_2_0
1- 1
-1 1
.names r_out_0_0 w_in_0_0
1 1
.names r_out_1_0 w_in_0_1
1 1
.names r_out_2_0 w_in_1_0
1 1
.names r_out_2_0 w_in_1_1
1 1
.names r_out_0_0 w_in_2_0
1 1
.names ins w_in_2_1
1 1
.end
帶同步復位的新輸出如下。 Verilog輸出端口都連接好了,似乎它們也連接在BLIF中。
# Generated by Yosys 0.7 (git sha1 61f6811, i686-w64-mingw32.static-gcc 4.9.3 -Os)
.model L_0_0
.inputs clk rst ins
.outputs outs
.names $false
.names $true
1
.names $undef
.names r_out_0_0 $false rst $0\outs[0:0]
1-0 1
-11 1
.names w_out_1_0 $false rst $0\r_out_1_0[0:0]
1-0 1
-11 1
.names w_out_0_0 $false rst $0\r_out_0_0[0:0]
1-0 1
-11 1
.latch $0\outs[0:0] outs re clk 2
.latch $0\r_out_0_0[0:0] r_out_0_0 re clk 2
.latch $0\r_out_1_0[0:0] r_out_1_0 re clk 2
.names r_out_0_0 r_out_1_0 w_out_0_0
11 1
.names ins r_out_1_0 w_out_1_0
1- 1
-1 1
.names r_out_0_0 w_in_0_0
1 1
.names r_out_1_0 w_in_0_1
1 1
.names ins w_in_1_0
1 1
.names r_out_1_0 w_in_1_1
1 1
.end
謝謝。你是對的。我的重置是異步的。當我將其更改爲同步或使用techmap命令時,問題就解決了。我的新問題是,當我將此輸入到T-VPACK時,它表示存在未連接的端口並生成錯誤。即使選擇也無法解決它。你能幫助我嗎?在此先感謝 – Laleh
@Laleh我不知道任何關於T-VPACK。您的設計中是否有未連接的引腳?如果是這樣,Yosys不會丟棄它們,因爲這會改變模塊接口。未連接的輸入不應該受到傷害。如果問題是未連接的輸入,我會認爲這是T-VPACK中的一個錯誤。如果問題是未連接的輸出,我會建議用HDL代碼中的常量值來驅動它們。 – CliffordVienna
感謝您的回覆。報告的未連接端口是輸出,但實際上並未連接。我更新了問題以包含我的Verilog文件以及Yosys的新輸出。 – Laleh