Ignore:
Timestamp:
May 26, 2015, 4:56:01 PM (4 years ago)
Author:
nmedfort
Message:

More work on multiplexing

File:
1 edited

Legend:

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

    r4578 r4579  
    44#include <pablo/codegenstate.h>
    55#include <slab_allocator.h>
    6 #include <unordered_map>
     6#include <queue>
    77#include <pablo/analysis/bdd/bdd.hpp>
    88#include <boost/graph/adjacency_list.hpp>
     
    2222    using PathGraph = boost::adjacency_matrix<boost::undirectedS>;
    2323    using SubsetGraph = boost::edge_list<std::pair<unsigned, unsigned>>;
    24     using MappingGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS>;
     24    using MultiplexSetGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS>;
    2525    using IndependentSetGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::undirectedS, unsigned>;
    2626    using Advances = std::vector<Advance *>;
     27    using TopologicalSortGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::directedS, PabloAST *>;
     28    using TopologicalSortQueue = std::queue<TopologicalSortGraph::vertex_descriptor>;
    2729
    2830    using RNG = std::mt19937;
     
    3840    bdd::Engine initialize(const std::vector<Var *> & vars, const PabloBlock & entry);
    3941    void characterize(bdd::Engine & engine, const PabloBlock & entry);
    40     bool generateMultiplexSets(RNG & rng);
     42    void createMultiplexSetGraph();
     43    bool generateMultiplexSets(RNG & rng);   
    4144    void addMultiplexSet(const IndependentSet & set);
    4245    void approxMaxWeightIndependentSet(RNG & rng);
    4346    void applySubsetConstraints();
    4447    void multiplexSelectedIndependentSets();
    45     void topologicalSort();
     48    void topologicalSort(PabloBlock & entry) const;
     49    void topologicalSort(TopologicalSortGraph & G, TopologicalSortQueue & Q) const;
    4650
    4751private:
     
    5357    SubsetGraph             mSubsetGraph;
    5458    Advances                mAdvance;
    55     MappingGraph            mMappingGraph;
     59    MultiplexSetGraph       mMultiplexSetGraph;
    5660};
    5761
Note: See TracChangeset for help on using the changeset viewer.