forked from EPFL-CS-472/mockturtle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Technology mapper * Tech mapper fixes * Tech mapper test updates * Updates and fixes * Mapper updates: switching power optimization and templates restructuring * Mapper: added option to exploit logic sharing, name modifications, tests and experiments updates * minor fixes * Modified test: from exact_map to map * Added P-enumeration and N-matching option in library and mapping to support bigger cell libraries, improved mapping performances, fixed error when truth table minimization is false, increased the cut limit to 50, updated tests for changes * Added inverter usage in exact mapping * removed always_inline to avoid compiler error on Windows * Added mapper documentation * docs fix
- Loading branch information
1 parent
2f23cc6
commit 7d91cdf
Showing
13 changed files
with
650 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
Mapper | ||
------ | ||
|
||
**Header:** ``mockturtle/algorithms/mapper.hpp`` | ||
|
||
A versatile mapper that supports technology mapping and graph mapping. | ||
The mapper is independent of the underlying graph representation. Hence, | ||
it supports generic subject graph representations (e.g., AIG, and MIG) | ||
and a generic target representation (e.g. cell library, XMG). | ||
The mapper aims at finding a good mapping with respect to delay, area, | ||
and switching power. | ||
|
||
The mapper uses a library (hash table) to facilitate Boolean matching. | ||
For technology mapping, it needs `tech_library` while for graph mapping | ||
it needs `exact_library`. For technology mapping, the generation of both NP- and | ||
P-configurations of gates are supported. Generally, it is convenient to use | ||
NP-configurations for small cell libraries (<20 gates). For bigger libraries, | ||
P-configurations perform better. For graph mapping, NPN classification is used | ||
instead. | ||
|
||
The following example shows how to perform delay-oriented technology mapping | ||
from an And-inverter graph using the default settings: | ||
|
||
.. code-block:: c++ | ||
|
||
aig_network aig = ...; | ||
|
||
/* read cell library in genlib format */ | ||
std::vector<gate> gates; | ||
std::ifstream in( ... ); | ||
lorina::read_genlib( in, genlib_reader( gates ) ) | ||
tech_library tech_lib( gates ); | ||
/* perform technology mapping */ | ||
klut_network res = map( aig, tech_lib ); | ||
The mapped network is returned as a k-LUT network in which each k-LUT | ||
abstracts a cell. | ||
|
||
The next example performs area-oriented graph mapping from AIG to MIG | ||
using a NPN resynthesis database of structures: | ||
|
||
.. code-block:: c++ | ||
|
||
aig_network aig = ...; | ||
|
||
/* load the npn database in the library */ | ||
mig_npn_resynthesis resyn{ true }; | ||
exact_library<mig_network, mig_npn_resynthesis> exact_lib( resyn ); | ||
/* perform graph mapping */ | ||
map_params ps; | ||
ps.skip_delay_round = true; | ||
ps.required_time = std::numeric_limits<double>::max(); | ||
mig_network res = map( aig, exact_lib, ps ); | ||
For graph mapping, we suggest reading the network directly in the | ||
target graph representation if possible (e.g. read an AIG as a MIG) | ||
since the mapping often leads to better results in this setting. | ||
|
||
As a default setting, cut enumeration minimizes the truth tables. | ||
This helps improving the results but slows down the computation. For | ||
a faster mapping set the truth table minimization parameter to false. | ||
The maximum number of cuts stored for each node is limited to 49. | ||
To increase this limit, change `max_cut_num` in `fast_network_cuts`. | ||
|
||
**Parameters and statistics** | ||
|
||
.. doxygenstruct:: mockturtle::map_params | ||
:members: | ||
|
||
.. doxygenstruct:: mockturtle::map_stats | ||
:members: | ||
|
||
**Algorithm** | ||
|
||
.. doxygenfunction:: mockturtle::map(Ntk const&, tech_library<NInputs, Configuration> const&, map_params const&, map_stats*) | ||
.. doxygenfunction:: mockturtle::map(Ntk&, exact_library<NtkDest, RewritingFn, NInputs> const&, map_params const&, map_stats*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.