Welcome to gem5 Q&A, where you can ask questions and receive answers from other members of the community.

Functions in Packet.hh file

0 votes
Can someone explain following functions in Packet.hh file

         Addr getOffset(unsigned int blk_size) const

         Addr getBlockAddr(unsigned int blk_size) const

 

Addr getOffset(unsigned int blk_size) const
    {
        return getAddr() & Addr(blk_size - 1);
    }

    Addr getBlockAddr(unsigned int blk_size) const
    {
        return getAddr() & ~(Addr(blk_size - 1));
    }
asked Jul 13 in Coding Guidelines by maq.uetian (680 points)
edited Jul 13 by maq.uetian

Please log in or register to answer this question.

...