Skip to content

Commit

Permalink
fix warnings and errors from updating lorina.
Browse files Browse the repository at this point in the history
  • Loading branch information
hriener committed May 5, 2021
1 parent daebbfb commit 8d944e6
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 18 deletions.
5 changes: 4 additions & 1 deletion experiments/aig_resubstitution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

resubstitution_params ps;
resubstitution_stats st;
Expand Down
10 changes: 8 additions & 2 deletions experiments/cut_rewriting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig, aig2;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig2 ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig2 ) ) != lorina::return_code::success )
{
continue;
}

cut_rewriting_params ps;
ps.cut_enumeration_ps.cut_size = 4;
Expand Down
6 changes: 5 additions & 1 deletion experiments/equivalence_checking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

const auto orig = aig;

xag_npn_resynthesis<aig_network> resyn;
Expand Down
5 changes: 4 additions & 1 deletion experiments/functional_reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

functional_reduction_params ps;
functional_reduction_stats st;
Expand Down
5 changes: 4 additions & 1 deletion experiments/lut_mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

lut_mapping_stats st;
mapping_view<aig_network, true> mapped_aig{aig};
Expand Down
11 changes: 9 additions & 2 deletions experiments/mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ int main()
std::vector<gate> gates;

std::istringstream in( mcnc_library );
lorina::read_genlib( in, genlib_reader( gates ) );
if ( lorina::read_genlib( in, genlib_reader( gates ) ) != lorina::return_code::success )
{
fmt::print( stderr, "[e] could not read genlib file\n" );
std::abort();
}

tech_library_params tps;
tech_library<5> lib( gates, tps );
Expand All @@ -87,7 +91,10 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

const uint32_t size_before = aig.num_gates();
const uint32_t depth_before = depth_view( aig ).depth();
Expand Down
5 changes: 4 additions & 1 deletion experiments/mig_resubstitution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ int main()
fmt::print( "[i] processing {}\n", benchmark );

mig_network mig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( mig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( mig ) ) != lorina::return_code::success )
{
continue;
}

resubstitution_params ps;
resubstitution_stats st;
Expand Down
5 changes: 4 additions & 1 deletion experiments/node_resynthesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

lut_mapping_params ps;
ps.cut_enumeration_ps.cut_size = 4u;
Expand Down
6 changes: 5 additions & 1 deletion experiments/pattern_generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

auto size_before = aig.num_gates();

pattern_generation_params ps;
Expand Down
5 changes: 4 additions & 1 deletion experiments/satlut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

mapping_view<aig_network, true> mapped_aig{aig};
lut_mapping_params ps;
Expand Down
5 changes: 4 additions & 1 deletion experiments/sim_resubstitution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

resubstitution_params ps;
resubstitution_stats st;
Expand Down
5 changes: 4 additions & 1 deletion experiments/sop_balancing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ int main()
{
fmt::print( "[i] processing {}\n", benchmark );
aig_network aig;
lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) );
if ( lorina::read_aiger( benchmark_path( benchmark ), aiger_reader( aig ) ) != lorina::return_code::success )
{
continue;
}

balancing_params ps;
balancing_stats st4, st6;
Expand Down
6 changes: 5 additions & 1 deletion test/algorithms/quality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ std::vector<Ret> foreach_benchmark( Fn&& fn )
for ( auto const& id : {17, 432, 499, 880, 1355, 1908, 2670, 3540, 5315, 6288, 7552} )
{
Ntk ntk;
lorina::read_aiger( fmt::format( "{}/c{}.aig", BENCHMARKS_PATH, id ), aiger_reader( ntk ) );
auto const result = lorina::read_aiger( fmt::format( "{}/c{}.aig", BENCHMARKS_PATH, id ), aiger_reader( ntk ) );
if ( result != lorina::return_code::success )
{
continue;
}
v.emplace_back( fn( ntk, id ) );
}
return v;
Expand Down
3 changes: 2 additions & 1 deletion test/io/aiger_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ TEST_CASE( "read a sequential ASCII Aiger file into an AIG network", "[aiger_rea
"o0 foobar\n"
"o1 barbar\n"};

lorina::diagnostic_engine diag;
lorina::text_diagnostics consumer;
lorina::diagnostic_engine diag( &consumer );
std::istringstream in( file );
auto const result = lorina::read_ascii_aiger( in, aiger_reader( named_aig ), &diag );
CHECK( result == lorina::return_code::success );
Expand Down
3 changes: 2 additions & 1 deletion test/io/bench_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ TEST_CASE( "read a BENCH file into K-LUT network", "[bench_reader]" )
"carry = LUT 0xe8 (a, b, c)\n"};

std::istringstream in( file );
lorina::read_bench( in, bench_reader( klut ) );
auto const result = lorina::read_bench( in, bench_reader( klut ) );
CHECK( result == lorina::return_code::success );

CHECK( klut.size() == 7 );
CHECK( klut.num_pis() == 3 );
Expand Down
3 changes: 2 additions & 1 deletion test/io/pla_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ TEST_CASE( "read a PLA file into an XAG", "[pla_reader]" )
".e\n"};

std::istringstream in( file );
lorina::read_pla( in, pla_reader( xag ) );
auto const result = lorina::read_pla( in, pla_reader( xag ) );
CHECK( result == lorina::return_code::success );

CHECK( xag.size() == 9 );
CHECK( xag.num_pis() == 3 );
Expand Down

0 comments on commit 8d944e6

Please sign in to comment.