lsils / mockturtle

C++ logic network library
MIT License
202 stars 136 forks source link

Fix issues with write_blif on corner cases #603

Closed Nozidoali closed 1 year ago

Nozidoali commented 1 year ago

Fix issues #600 and #587 .

Nozidoali commented 1 year ago

ps.rename_ri_using_node

Rename registers using node name if rename_ri_using_node is set to 1 ( default: 0 )

A register is represented by a ro_to_ri mapping:

 ri_node --> ro_signal

where ri_node is the register input (a combinational output node), and ro_signal is the register output (a combinational input signal).

If rename_ri_using_node is set to 1, then ri_node will be renamed (from its default name) using the node name. We write the following to the BLIF file:

.latch ri_node ro_signal

Otherwise, if rename_ri_using_node is set to 1, ri_node will be named by its default name, li_<idx>, where idx is the index of the register (based on the definition order when calling create_ri). Then we write:

.latch li_<idx> ro_signal
.names ri_node li_<idx>
1 1
codecov-commenter commented 1 year ago

Codecov Report

Merging #603 (966302a) into master (e78e5d9) will increase coverage by 0.00%. The diff coverage is 89.70%.

:exclamation: Current head 966302a differs from pull request most recent head 7c8f712. Consider uploading reports for the commit 7c8f712 to get more accurate results

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##           master     #603   +/-   ##
=======================================
  Coverage   83.14%   83.15%           
=======================================
  Files         173      173           
  Lines       23629    23660   +31     
=======================================
+ Hits        19646    19674   +28     
- Misses       3983     3986    +3     
Impacted Files Coverage Δ
include/mockturtle/networks/sequential.hpp 100.00% <ø> (ø)
include/mockturtle/io/write_blif.hpp 90.62% <89.70%> (-0.64%) :arrow_down:

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

lee30sonia commented 1 year ago

Thanks!