2016-05-26 7 views

答えて

1

README Fileには、最も顕著な属性のリストが含まれています。 (セクション「Verilogの属性と非標準の機能」)keep_hierarchysetattrについて:次のサンプルコードを検討してください。

module test(input A, B, output X, Y); 
    test_and and_inst (.A(A), .B(B), .O(X)); 
    test_xor xor_inst (.A(A), .B(B), .O(Y)); 
endmodule 

module test_and(input A, B, output O); 
    assign O = A & B; 
endmodule 

module test_xor(input A, B, output O); 
    assign O = A^B; 
endmodule 

明らかに次がちょうど$andと回路図と$xorゲートを表示していました:

yosys -p 'prep; flatten; opt -purge; show test' test.v 

今、私たちは、細胞にkeep_hierarchy属性を設定することにより、and_instを平坦化から平らに防ぐことができます。

yosys -p 'prep; setattr -set keep_hierarchy 1 test/and_inst; flatten; opt -purge; show test' test.v 

また、test_andのすべてのインスタンスがf単にモジュール自体の属性を設定するだけでラティングされます。

yosys -p 'prep; setattr -mod -set keep_hierarchy 1 test_and; flatten; opt -purge; show test' test.v 
関連する問題