Changeset 4689 for icGREP


Ignore:
Timestamp:
Jul 22, 2015, 11:02:17 AM (4 years ago)
Author:
cameron
Message:

Ensure frame positions of nested blocks can be adjusted based on carry data size for the block.

Location:
icGREP/icgrep-devel/icgrep/pablo
Files:
2 edited

Legend:

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

    r4687 r4689  
    4040    mCarryInfoVector.resize(scopeCount);
    4141   
    42     unsigned totalCarryDataBits = enumerate(pb, 0, 0, 0);
     42    unsigned totalCarryDataBits = enumerate(pb, 0, 0);
    4343   
    4444    mTotalCarryDataBitBlocks = (totalCarryDataBits + BLOCK_SIZE - 1)/BLOCK_SIZE + 1; // One extra element for the block no.
     
    6161}
    6262
    63 unsigned CarryManager::enumerate(PabloBlock * blk, unsigned ifDepth, unsigned whileDepth, unsigned nestedframePosition) {
     63unsigned CarryManager::enumerate(PabloBlock * blk, unsigned ifDepth, unsigned whileDepth) {
    6464    llvm::raw_os_ostream cerr(std::cerr);
    6565    unsigned idx = blk->getScopeIndex();
     
    6969    cd->setIfDepth(ifDepth);
    7070    cd->setWhileDepth(whileDepth);
    71     cd->setFramePosition(nestedframePosition);
    7271    unsigned nestedOffset = cd->nested.frameOffsetinBits;
    7372 
    7473    for (Statement * stmt : *blk) {
    7574        if (If * ifStatement = dyn_cast<If>(stmt)) {
    76             const unsigned ifCarryDataBits = enumerate(&ifStatement->getBody(), ifDepth+1, whileDepth, nestedOffset);
     75            const unsigned ifCarryDataBits = enumerate(&ifStatement->getBody(), ifDepth+1, whileDepth);
    7776            PabloBlockCarryData * nestedBlockData = mCarryInfoVector[ifStatement->getBody().getScopeIndex()];
    7877#ifdef PACKING
    7978            EnsurePackHasSpace(nestedOffset, ifCarryDataBits);
    8079#endif
     80            nestedBlockData->setFramePosition(nestedOffset);
     81
    8182            nestedOffset += ifCarryDataBits;
    8283            if (cd->maxNestingDepth <= nestedBlockData->maxNestingDepth) cd->maxNestingDepth = nestedBlockData->maxNestingDepth + 1;
     
    8485        }
    8586        else if (While * whileStatement = dyn_cast<While>(stmt)) {
    86             const unsigned whileCarryDataBits = enumerate(&whileStatement->getBody(), ifDepth, whileDepth+1, nestedOffset);
     87            const unsigned whileCarryDataBits = enumerate(&whileStatement->getBody(), ifDepth, whileDepth+1);
    8788            PabloBlockCarryData * nestedBlockData = mCarryInfoVector[whileStatement->getBody().getScopeIndex()];
    8889            //if (whileStatement->isMultiCarry()) whileCarryDataBits *= whileStatement->getMaxIterations();
     
    9091            EnsurePackHasSpace(nestedOffset, whileCarryDataBits);
    9192#endif
     93            nestedBlockData->setFramePosition(nestedOffset);
    9294            nestedOffset += whileCarryDataBits;
    9395            if (cd->maxNestingDepth <= nestedBlockData->maxNestingDepth) cd->maxNestingDepth = nestedBlockData->maxNestingDepth + 1;
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.h

    r4687 r4689  
    5555    unsigned initialize(PabloBlock * blk, Value * carryDataPtr); 
    5656   
    57     unsigned enumerate(PabloBlock * blk, unsigned ifDepth, unsigned whileDepth, unsigned nestedframePosition);
     57    unsigned enumerate(PabloBlock * blk, unsigned ifDepth, unsigned whileDepth);
    5858   
    5959    void generateBlockNoIncrement();
Note: See TracChangeset for help on using the changeset viewer.