Ignore:
Timestamp:
Nov 30, 2015, 4:30:02 PM (4 years ago)
Author:
nmedfort
Message:

More work on n-ary operations. Unresolved bug in DistributionPass?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/pablo_automultiplexing.cpp

    r4880 r4885  
    2020using namespace boost::numeric::ublas;
    2121
    22 #define PRINT_DEBUG_OUTPUT
     22// #define PRINT_DEBUG_OUTPUT
    2323
    2424#if !defined(NDEBUG) && !defined(PRINT_DEBUG_OUTPUT)
     
    159159
    160160        AutoMultiplexing::topologicalSort(function);
    161 
    162161        #ifndef NDEBUG
    163162        PabloVerifier::verify(function, "post-multiplexing");
     
    469468    }
    470469
    471     const BDD Vk = bdd_ithvar(mVariables++);
    472 
    473     BDD Ck = Vk;
    474 
     470    const BDD Vk = bdd_addref(bdd_not(bdd_ithvar(mVariables++)));
     471    BDD Ck = bdd_one();
    475472    for (unsigned i = 0; i != k; ++i) {
    476473        const Advance * const ithAdv = std::get<0>(mAdvanceAttributes[i]);
     
    478475        const BDD Vi = std::get<1>(mAdvanceAttributes[i]);
    479476        if (unconstrained[i]) {
    480             Ck = bdd_addref(bdd_imp(Ck, bdd_addref(bdd_not(Vi))));
    481             Ci = bdd_addref(bdd_imp(Ci, bdd_addref(bdd_not(Vk))));
    482             // If these Advances are mutually exclusive, in the same scope, and transitively independent,
    483             // we safely multiplex them.
     477            const BDD exclusionConstraint = bdd_addref(bdd_or(Vi, Vk));
     478            Ci = bdd_addref(bdd_and(Ci, exclusionConstraint));
     479            Ck = bdd_addref(bdd_and(Ck, exclusionConstraint));
     480            // If these Advances are mutually exclusive, in the same scope and transitively independent,
     481            // we can safely multiplex them. Otherwise mark the constraint edge in the graph.
    484482            if (adv->getParent() == ithAdv->getParent()) {
    485483                continue;
Note: See TracChangeset for help on using the changeset viewer.