1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 445 unchanged lines hidden (view full) --- 454#include <iostream> 455#include <string> 456 457''') 458 if self.isStateDecl: 459 code('#include "mem/protocol/AccessPermission.hh"') 460 461 if self.isMachineType: |
462 code('#include <functional>') |
463 code('#include "base/misc.hh"') 464 code('#include "mem/ruby/common/Address.hh"') 465 code('#include "mem/ruby/common/TypeDefines.hh"') 466 code('struct MachineID;') 467 468 code(''' 469 470// Class definition --- 23 unchanged lines hidden (view full) --- 494 495// Code to convert state to a string 496std::string ${{self.c_ident}}_to_string(const ${{self.c_ident}}& obj); 497 498// Code to increment an enumeration type 499${{self.c_ident}} &operator++(${{self.c_ident}} &e); 500''') 501 |
502 if self.isMachineType: 503 code(''' 504 505// define a hash function for the MachineType class 506namespace std { 507template<> 508struct hash<MachineType> { 509 std::size_t operator()(const MachineType &mtype) const { 510 return hash<size_t>()(static_cast<size_t>(mtype)); 511 } 512}; 513} 514 515''') |
516 # MachineType hack used to set the base component id for each Machine 517 if self.isMachineType: 518 code(''' 519int ${{self.c_ident}}_base_level(const ${{self.c_ident}}& obj); 520MachineType ${{self.c_ident}}_from_base_level(int); 521int ${{self.c_ident}}_base_number(const ${{self.c_ident}}& obj); 522int ${{self.c_ident}}_base_count(const ${{self.c_ident}}& obj); 523''') --- 276 unchanged lines hidden --- |