From d4273cc9a6f3c00566e97ebcd71509ed14477b37 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Thu, 18 Jul 2013 08:31:16 -0400 Subject: mem: Set the cache line size on a system level This patch removes the notion of a peer block size and instead sets the cache line size on the system level. Previously the size was set per cache, and communicated through the interconnect. There were plenty checks to ensure that everyone had the same size specified, and these checks are now removed. Another benefit that is not yet harnessed is that the cache line size is now known at construction time, rather than after the port binding. Hence, the block size can be locally stored and does not have to be queried every time it is used. A follow-on patch updates the configuration scripts accordingly. --- src/sim/system.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/sim/system.cc') diff --git a/src/sim/system.cc b/src/sim/system.cc index 03f8f8180..f9799d26f 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2012 ARM Limited + * Copyright (c) 2011-2013 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -78,12 +78,13 @@ System::System(Params *p) _numContexts(0), pagePtr(0), init_param(p->init_param), - physProxy(_systemPort), - virtProxy(_systemPort), + physProxy(_systemPort, p->cache_line_size), + virtProxy(_systemPort, p->cache_line_size), loadAddrMask(p->load_addr_mask), nextPID(0), physmem(name() + ".physmem", p->memories), memoryMode(p->mem_mode), + _cacheLineSize(p->cache_line_size), workItemsBegin(0), workItemsEnd(0), numWorkIds(p->num_work_ids), @@ -100,6 +101,11 @@ System::System(Params *p) debugSymbolTable = new SymbolTable; } + // check if the cache line size is a value known to work + if (!(_cacheLineSize == 16 || _cacheLineSize == 32 || + _cacheLineSize == 64 || _cacheLineSize == 128)) + warn_once("Cache line size is neither 16, 32, 64 nor 128 bytes.\n"); + // Get the generic system master IDs MasterID tmp_id M5_VAR_USED; tmp_id = getMasterId("writebacks"); -- cgit v1.2.3