X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmem%2Fcache%2Fcache_blk.cc;h=c4730caebc718d29714e9b76729dbf559743c474;hb=2dd82da9b8275fab6235e2e6ff4859978a225db4;hp=d4a2eaee8c08002064bf52a2330585fc87dc5621;hpb=3952e41ab1f1dfaa2f97a6a486528e4ea0bfc5a1;p=gem5.git diff --git a/src/mem/cache/cache_blk.cc b/src/mem/cache/cache_blk.cc index d4a2eaee8..c4730caeb 100644 --- a/src/mem/cache/cache_blk.cc +++ b/src/mem/cache/cache_blk.cc @@ -1,4 +1,16 @@ /* + * Copyright (c) 2012-2013 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * * Copyright (c) 2007 The Regents of The University of Michigan * All rights reserved. * @@ -26,16 +38,49 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "base/cprintf.hh" #include "mem/cache/cache_blk.hh" +#include "base/cprintf.hh" + +void +CacheBlk::insert(const Addr tag, const bool is_secure, + const int src_master_ID, const uint32_t task_ID) +{ + // Make sure that the block has been properly invalidated + assert(status == 0); + + // Set block tag + this->tag = tag; + + // Set source requestor ID + srcMasterId = src_master_ID; + + // Set task ID + task_id = task_ID; + + // Set insertion tick as current tick + tickInserted = curTick(); + + // Insertion counts as a reference to the block + refCount = 1; + + // Set secure state + if (is_secure) { + setSecure(); + } + + // Validate block + setValid(); +} + void CacheBlkPrintWrapper::print(std::ostream &os, int verbosity, const std::string &prefix) const { - ccprintf(os, "%sblk %c%c%c\n", prefix, + ccprintf(os, "%sblk %c%c%c%c\n", prefix, blk->isValid() ? 'V' : '-', blk->isWritable() ? 'E' : '-', - blk->isDirty() ? 'M' : '-'); + blk->isDirty() ? 'M' : '-', + blk->isSecure() ? 'S' : '-'); }