Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AQFP network fix #540

Merged
merged 49 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4bf03fa
Technology mapper
aletempiac Mar 30, 2021
f031922
Tech mapper fixes
aletempiac Apr 2, 2021
5340204
Tech mapper test updates
aletempiac Apr 5, 2021
f79820c
Merge remote-tracking branch 'origin/master' into aletempiac/tech_mapper
aletempiac Apr 8, 2021
b00ee0e
Updates and fixes
aletempiac Apr 27, 2021
350c1ec
Mapper updates: switching power optimization and templates restructuring
aletempiac Apr 28, 2021
b70d06f
Mapper: added option to exploit logic sharing, name modifications, te…
aletempiac Apr 30, 2021
ece0c0c
minor fixes
aletempiac Apr 30, 2021
d3c557d
Merge remote-tracking branch 'origin/master' into aletempiac/tech_mapper
aletempiac May 12, 2021
ab65a3c
Merge remote-tracking branch 'origin/master' into aletempiac/tech_mapper
aletempiac May 25, 2021
725d35c
Modified test: from exact_map to map
aletempiac May 25, 2021
fa13d31
Added P-enumeration and N-matching option in library and mapping to s…
aletempiac Jul 12, 2021
c36037a
Merge remote-tracking branch 'origin/master' into aletempiac/tech_mapper
aletempiac Jul 12, 2021
b4fefb9
Added inverter usage in exact mapping
aletempiac Jul 12, 2021
7d5e2b3
removed always_inline to avoid compiler error on Windows
aletempiac Jul 12, 2021
5c00c2b
Added mapper documentation
aletempiac Jul 13, 2021
1ddcc1f
docs fix
aletempiac Jul 19, 2021
284357c
Merge remote-tracking branch 'origin/master' into aletempiac/tech_mapper
aletempiac Aug 2, 2021
d16199f
Add binding view for mapped networks, added i/o code to write mapped …
aletempiac Aug 2, 2021
9cf7383
Added buffering in mapping
aletempiac Aug 3, 2021
fc246e5
Simplified write_verilog for mapped networks, added and updated tests…
aletempiac Aug 3, 2021
dc4cb21
Added compatibility with multiple pins in Genlib libraries, changed e…
aletempiac Aug 3, 2021
965fc8f
Support pin names from genlib, better checks on pins parsing
aletempiac Aug 3, 2021
873c8b0
Genilb test corrections
aletempiac Aug 3, 2021
c3badbf
Supergates importing and representation utilities
aletempiac Aug 6, 2021
df39afd
Updates for supergates support
aletempiac Aug 6, 2021
b92dc7a
Added supergates support
aletempiac Aug 9, 2021
f4f89eb
Moved gates usage report to binding_view
aletempiac Aug 9, 2021
183284c
Test fixes for new library structure
aletempiac Aug 9, 2021
08cfffa
Added report commands in binding_view
aletempiac Aug 9, 2021
fc41d17
Added new tests for supergates, modified supergates insertion procedu…
aletempiac Aug 9, 2021
2870bac
Added NP-configurations of supergates, use of phmap for better perfor…
aletempiac Aug 9, 2021
b4ec2a4
Added tests for binding_library
aletempiac Aug 10, 2021
8325603
Fixes
aletempiac Aug 10, 2021
7be62c5
Fixes cast
aletempiac Aug 10, 2021
de3bc6b
Added tests to improve coverage
aletempiac Aug 10, 2021
ef3e002
Header and description fixes
aletempiac Aug 10, 2021
f387bdb
Fixes in constant gates for write_verilog, extended usage of topo_vie…
aletempiac Aug 11, 2021
29a47e7
Merge branch 'master' into aletempiac/tech_mapper
aletempiac Aug 12, 2021
69c4190
Added new mapper, library, supergates, and i/o documentation
aletempiac Aug 12, 2021
4f7b9be
Updates to the documentation
aletempiac Aug 12, 2021
1cc8d56
Minor fixes and error reporting in mapper
aletempiac Aug 23, 2021
76bda99
Small fix
aletempiac Aug 23, 2021
55c11d3
Merge branch 'lsils:master' into master
aletempiac Sep 13, 2021
4ae8df7
Merge branch 'lsils:master' into master
aletempiac Oct 1, 2021
c70f802
Merge branch 'lsils:master' into master
aletempiac Mar 14, 2022
634f673
bux fix in AQFP network
aletempiac Mar 14, 2022
799aafe
fix in binding view
aletempiac Mar 14, 2022
72118f8
Removed random truth table in akers_synthesis test cases, AQFP networ…
aletempiac Mar 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions include/mockturtle/networks/aqfp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
\brief AQFP network implementation

\author Dewmini Marakkalage
\author Alessandro Tempia Calvino
*/

#pragma once
Expand Down Expand Up @@ -521,23 +522,27 @@ class aqfp_network

std::vector<signal> old_children;

for ( auto i = 0u; i <= node.children.size(); ++i )
bool replacement = false;
for ( size_t i = 0u; i < node.children.size(); ++i )
{
if ( i == node.children.size() )
{
return std::nullopt;
}

old_children.push_back( signal{ node.children[i] } );

if ( node.children[i].index == old_node )
{
node.children[i] = node.children[i].weight ? !new_signal : new_signal;
new_signal.complement ^= node.children[i].weight;
replacement = true;

// update the reference counter of the new signal
_storage->nodes[new_signal.index].data[0].h1++;
}
}

/* TODO: Do the simplifications if possible */
if ( !replacement )
{
return std::nullopt;
}

/* TODO: Do the simplifications if possible and ordering */

for ( auto const& fn : _events->on_modified )
{
Expand Down
4 changes: 2 additions & 2 deletions include/mockturtle/views/binding_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class binding_view : public Ntk
{
float tot_gate_area = gates_profile[i] * _library[i].area;

os << fmt::format( "[i] {:<15}", _library[i].name )
os << fmt::format( "[i] {:<25}", _library[i].name )
<< fmt::format( "\t Instance = {:>10d}", gates_profile[i] )
<< fmt::format( "\t Area = {:>12.2f}", tot_gate_area )
<< fmt::format( " {:>8.2f} %\n", tot_gate_area / area * 100 );
Expand All @@ -248,7 +248,7 @@ class binding_view : public Ntk
}
}

os << fmt::format( "[i] {:<15}", "TOTAL" )
os << fmt::format( "[i] {:<25}", "TOTAL" )
<< fmt::format( "\t Instance = {:>10d}", tot_instances )
<< fmt::format( "\t Area = {:>12.2f} 100.00 %\n", area );
}
Expand Down
10 changes: 7 additions & 3 deletions test/algorithms/akers_synthesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ TEST_CASE( "Check Akers for MAJ-5 in XMG", "[akers_synthesis]" )

TEST_CASE( "Check Akers for random - 4 inputs", "[akers_synthesis]" )
{
std::array<std::string, 5> tts = { "d5d0", "fe52", "ad1b", "401a", "79e2" };

for ( auto y = 0; y < 5; y++ )
{
std::vector<kitty::dynamic_truth_table> xs{6, kitty::dynamic_truth_table( 4 )};
Expand All @@ -97,7 +99,7 @@ TEST_CASE( "Check Akers for random - 4 inputs", "[akers_synthesis]" )
kitty::create_nth_var( xs[4], 2 );
kitty::create_nth_var( xs[5], 3 );

create_random( xs[0] );
create_from_hex_string( xs[0], tts[y] );

for ( auto i = 0u; i < unsigned( xs[0].num_bits() ); i++ )
{
Expand Down Expand Up @@ -134,6 +136,8 @@ TEST_CASE( "Check Akers for random - 4 inputs", "[akers_synthesis]" )

TEST_CASE( "Check Akers for random - 5 inputs", "[akers_synthesis]" )
{
std::array<std::string, 5> tts = { "e3cee67b", "bb5bee39", "b220ff4c", "fa43751f", "9ec83bf4" };

for ( auto y = 0; y < 5; y++ )
{
std::vector<kitty::dynamic_truth_table> xs{7, kitty::dynamic_truth_table( 5 )};
Expand All @@ -143,7 +147,7 @@ TEST_CASE( "Check Akers for random - 5 inputs", "[akers_synthesis]" )
kitty::create_nth_var( xs[5], 3 );
kitty::create_nth_var( xs[6], 4 );

create_random( xs[0] );
create_from_hex_string( xs[0], tts[y] );

for ( auto i = 0u; i < unsigned( xs[0].num_bits() ); i++ )
{
Expand Down Expand Up @@ -190,7 +194,7 @@ TEST_CASE( "Check Akers for random - 6 inputs", "[akers_synthesis]" )
kitty::create_nth_var( xs[6], 4 );
kitty::create_nth_var( xs[7], 5 );

create_random( xs[0] );
create_from_hex_string( xs[0], "32b43db39dde2b16" );

for ( auto i = 0u; i < unsigned( xs[0].num_bits() ); i++ )
{
Expand Down
10 changes: 5 additions & 5 deletions test/views/binding_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ TEST_CASE( "Create binding view", "[binding_view]" )
std::stringstream report_gates;
ntk.report_gates_usage( report_gates );
CHECK( report_gates.str() == "[i] Report gates usage:\n"
"[i] zero \t Instance = 1\t Area = 0.00 0.00 %\n"
"[i] inverter \t Instance = 1\t Area = 1.00 6.25 %\n"
"[i] and \t Instance = 2\t Area = 10.00 62.50 %\n"
"[i] or \t Instance = 1\t Area = 5.00 31.25 %\n"
"[i] TOTAL \t Instance = 5\t Area = 16.00 100.00 %\n" );
"[i] zero \t Instance = 1\t Area = 0.00 0.00 %\n"
"[i] inverter \t Instance = 1\t Area = 1.00 6.25 %\n"
"[i] and \t Instance = 2\t Area = 10.00 62.50 %\n"
"[i] or \t Instance = 1\t Area = 5.00 31.25 %\n"
"[i] TOTAL \t Instance = 5\t Area = 16.00 100.00 %\n" );
}

TEST_CASE( "Binding view on copy", "[binding_view]" )
Expand Down