system.hh (12515:e3d1a64d0260) system.hh (12680:91f4d6668b4f)
1/*
1/*
2 * Copyright (c) 2012, 2014 ARM Limited
2 * Copyright (c) 2012, 2014, 2018 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 41 unchanged lines hidden (view full) ---

52#include <utility>
53#include <vector>
54
55#include "arch/isa_traits.hh"
56#include "base/loader/symtab.hh"
57#include "base/statistics.hh"
58#include "config/the_isa.hh"
59#include "enums/MemoryMode.hh"
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 41 unchanged lines hidden (view full) ---

52#include <utility>
53#include <vector>
54
55#include "arch/isa_traits.hh"
56#include "base/loader/symtab.hh"
57#include "base/statistics.hh"
58#include "config/the_isa.hh"
59#include "enums/MemoryMode.hh"
60#include "mem/mem_master.hh"
60#include "mem/mem_object.hh"
61#include "mem/physical.hh"
62#include "mem/port.hh"
63#include "mem/port_proxy.hh"
64#include "params/System.hh"
65#include "sim/futex_map.hh"
66#include "sim/se_signal.hh"
67

--- 247 unchanged lines hidden (view full) ---

315 uint32_t numWorkIds;
316 std::vector<bool> activeCpus;
317
318 /** This array is a per-system list of all devices capable of issuing a
319 * memory system request and an associated string for each master id.
320 * It's used to uniquely id any master in the system by name for things
321 * like cache statistics.
322 */
61#include "mem/mem_object.hh"
62#include "mem/physical.hh"
63#include "mem/port.hh"
64#include "mem/port_proxy.hh"
65#include "params/System.hh"
66#include "sim/futex_map.hh"
67#include "sim/se_signal.hh"
68

--- 247 unchanged lines hidden (view full) ---

316 uint32_t numWorkIds;
317 std::vector<bool> activeCpus;
318
319 /** This array is a per-system list of all devices capable of issuing a
320 * memory system request and an associated string for each master id.
321 * It's used to uniquely id any master in the system by name for things
322 * like cache statistics.
323 */
323 std::vector<std::string> masterIds;
324 std::vector<MasterInfo> masters;
324
325 ThermalModel * thermalModel;
326
327 public:
328
325
326 ThermalModel * thermalModel;
327
328 public:
329
329 /** Request an id used to create a request object in the system. All objects
330 /**
331 * Request an id used to create a request object in the system. All objects
330 * that intend to issues requests into the memory system must request an id
331 * in the init() phase of startup. All master ids must be fixed by the
332 * regStats() phase that immediately precedes it. This allows objects in
333 * the memory system to understand how many masters may exist and
334 * appropriately name the bins of their per-master stats before the stats
332 * that intend to issues requests into the memory system must request an id
333 * in the init() phase of startup. All master ids must be fixed by the
334 * regStats() phase that immediately precedes it. This allows objects in
335 * the memory system to understand how many masters may exist and
336 * appropriately name the bins of their per-master stats before the stats
335 * are finalized
337 * are finalized.
338 *
339 * Registers a MasterID:
340 * This method takes two parameters, one of which is optional.
341 * The first one is the master object, and it is compulsory; in case
342 * a object has multiple (sub)masters, a second parameter must be
343 * provided and it contains the name of the submaster. The method will
344 * create a master's name by concatenating the SimObject name with the
345 * eventual submaster string, separated by a dot.
346 *
347 * As an example:
348 * For a cpu having two masters: a data master and an instruction master,
349 * the method must be called twice:
350 *
351 * instMasterId = getMasterId(cpu, "inst");
352 * dataMasterId = getMasterId(cpu, "data");
353 *
354 * and the masters' names will be:
355 * - "cpu.inst"
356 * - "cpu.data"
357 *
358 * @param master SimObject related to the master
359 * @param submaster String containing the submaster's name
360 * @return the master's ID.
336 */
361 */
337 MasterID getMasterId(std::string req_name);
362 MasterID getMasterId(const SimObject* master,
363 std::string submaster = std::string());
338
364
339 /** Get the name of an object for a given request id.
365 /**
366 * Registers a GLOBAL MasterID, which is a MasterID not related
367 * to any particular SimObject; since no SimObject is passed,
368 * the master gets registered by providing the full master name.
369 *
370 * @param masterName full name of the master
371 * @return the master's ID.
340 */
372 */
373 MasterID getGlobalMasterId(std::string master_name);
374
375 /**
376 * Get the name of an object for a given request id.
377 */
341 std::string getMasterName(MasterID master_id);
342
343 /** Get the number of masters registered in the system */
378 std::string getMasterName(MasterID master_id);
379
380 /** Get the number of masters registered in the system */
344 MasterID maxMasters()
345 {
346 return masterIds.size();
347 }
381 MasterID maxMasters() { return masters.size(); }
348
382
383 protected:
384 /** helper function for getMasterId */
385 MasterID _getMasterId(const SimObject* master, std::string master_name);
386
387 /**
388 * Helper function for constructing the full (sub)master name
389 * by providing the root master and the relative submaster name.
390 */
391 std::string leafMasterName(const SimObject* master,
392 const std::string& submaster);
393
394 public:
395
349 void regStats() override;
350 /**
351 * Called by pseudo_inst to track the number of work items started by this
352 * system.
353 */
354 uint64_t
355 incWorkItemsBegin()
356 {

--- 233 unchanged lines hidden ---
396 void regStats() override;
397 /**
398 * Called by pseudo_inst to track the number of work items started by this
399 * system.
400 */
401 uint64_t
402 incWorkItemsBegin()
403 {

--- 233 unchanged lines hidden ---