Add Functions for Concise Tile Parsing #237
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds two functions (
parse_tile_exact
andexact_table_cover
) tofuse_h4x.py
. Theparse_tile_exact
reports an exact cover over the rows in a table, computed using theexact_table_cover
function that are 'active' in a bitstream.These functions come from the realization that the problem of determining what rows in a table were actually used can be conceptualized as an exact cover problem, assuming that no two active rows ever share fuses. So far, this assumption seems to hold up.
These functions are quite effective at cutting out 'noise'. Consider the following comparison between the output of parse_tile and parse_tile_exact for the same tile.
parse_tile
parse_tile_exact
The
xcover
package (github.com/john/xcover) makes all this possible. However, as it depends on numba and numpy, the import to xcover is 'hidden' within theexact_table_cover
function. The reasoning here is that since these functions are really only useful to developers, the developer can bear the responsibility of making the xcover package available. If the xcover package is not installed, a call toexact_table_cover
raises a ModuleNotFoundError exception, with a message on how the xcover package may be installed.