Ignore:
Timestamp:
Jul 16, 2015, 1:51:51 PM (4 years ago)
Author:
nmedfort
Message:

Added pablo Prototype to compiler. All Calls must be given one instead of a Name.

File:
1 edited

Legend:

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

    r4665 r4680  
    176176    flat_map<const PabloAST *, unsigned> map;   
    177177    std::stack<Statement *> scope;
    178     unsigned complexStatements = 0; // number of statements that cannot always be categorized without generating a new variable
     178    unsigned variableCount = 0; // number of statements that cannot always be categorized without generating a new variable
    179179
    180180    // Scan through and collect all the advances, calls, scanthrus and matchstars ...
     
    202202                case PabloAST::ClassTypeId::ScanThru:
    203203                case PabloAST::ClassTypeId::MatchStar:
    204                     complexStatements++;
     204                    variableCount++;
    205205                    break;
    206206                default:
     
    294294
    295295    // Initialize the BDD engine ...
    296     mManager = Cudd_Init((complexStatements + function.getParameters().size()), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0);
     296    mManager = Cudd_Init((variableCount + function.getNumOfParameters()), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0);
    297297    Cudd_AutodynDisable(mManager);
    298298
     
    303303    // Order the variables so the input Vars are pushed to the end; they ought to
    304304    // be the most complex to resolve.
    305     unsigned i = complexStatements;
    306     for (const Var * var : function.getParameters()) {
    307         mCharacterizationMap[var] = Cudd_bddIthVar(mManager, i++);
     305    for (auto i = 0; i != function.getNumOfParameters(); ++i) {
     306        mCharacterizationMap[function.getParameter(i)] = Cudd_bddIthVar(mManager, variableCount++);
    308307    }
    309308
Note: See TracChangeset for help on using the changeset viewer.