1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 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; --- 19 unchanged lines hidden (view full) --- 28 * Authors: Steve Reinhardt 29 */ 30 31#include "arch/utility.hh" 32#include "cpu/exetrace.hh" 33#include "cpu/simple/atomic.hh" 34#include "mem/packet_impl.hh" 35#include "sim/builder.hh" |
36#include "sim/system.hh" |
37 38using namespace std; 39using namespace TheISA; 40 41AtomicSimpleCPU::TickEvent::TickEvent(AtomicSimpleCPU *c) 42 : Event(&mainEventQueue, CPU_Tick_Pri), cpu(c) 43{ 44} --- 124 unchanged lines hidden (view full) --- 169AtomicSimpleCPU::unserialize(Checkpoint *cp, const string §ion) 170{ 171 UNSERIALIZE_ENUM(_status); 172 BaseSimpleCPU::unserialize(cp, section); 173 tickEvent.unserialize(cp, csprintf("%s.tickEvent", section)); 174} 175 176void |
177AtomicSimpleCPU::resume() 178{ 179 assert(system->getMemoryMode() == System::Atomic); 180 changeState(SimObject::Running); 181} 182 183void |
184AtomicSimpleCPU::switchOut() 185{ 186 assert(status() == Running || status() == Idle); 187 _status = SwitchedOut; 188 189 tickEvent.squash(); 190} 191 --- 262 unchanged lines hidden (view full) --- 454// 455BEGIN_DECLARE_SIM_OBJECT_PARAMS(AtomicSimpleCPU) 456 457 Param<Counter> max_insts_any_thread; 458 Param<Counter> max_insts_all_threads; 459 Param<Counter> max_loads_any_thread; 460 Param<Counter> max_loads_all_threads; 461 SimObjectParam<MemObject *> mem; |
462 SimObjectParam<System *> system; |
463 464#if FULL_SYSTEM 465 SimObjectParam<AlphaITB *> itb; 466 SimObjectParam<AlphaDTB *> dtb; |
467 Param<int> cpu_id; 468 Param<Tick> profile; 469#else 470 SimObjectParam<Process *> workload; 471#endif // FULL_SYSTEM 472 473 Param<int> clock; 474 --- 11 unchanged lines hidden (view full) --- 486 "terminate when any thread reaches this inst count"), 487 INIT_PARAM(max_insts_all_threads, 488 "terminate when all threads have reached this inst count"), 489 INIT_PARAM(max_loads_any_thread, 490 "terminate when any thread reaches this load count"), 491 INIT_PARAM(max_loads_all_threads, 492 "terminate when all threads have reached this load count"), 493 INIT_PARAM(mem, "memory"), |
494 INIT_PARAM(system, "system object"), |
495 496#if FULL_SYSTEM 497 INIT_PARAM(itb, "Instruction TLB"), 498 INIT_PARAM(dtb, "Data TLB"), |
499 INIT_PARAM(cpu_id, "processor ID"), 500 INIT_PARAM(profile, ""), 501#else 502 INIT_PARAM(workload, "processes to run"), 503#endif // FULL_SYSTEM 504 505 INIT_PARAM(clock, "clock speed"), 506 INIT_PARAM(defer_registration, "defer system registration (for sampling)"), --- 16 unchanged lines hidden (view full) --- 523 params->max_loads_all_threads = max_loads_all_threads; 524 params->deferRegistration = defer_registration; 525 params->clock = clock; 526 params->functionTrace = function_trace; 527 params->functionTraceStart = function_trace_start; 528 params->width = width; 529 params->simulate_stalls = simulate_stalls; 530 params->mem = mem; |
531 params->system = system; |
532 533#if FULL_SYSTEM 534 params->itb = itb; 535 params->dtb = dtb; |
536 params->cpu_id = cpu_id; 537 params->profile = profile; 538#else 539 params->process = workload; 540#endif 541 542 AtomicSimpleCPU *cpu = new AtomicSimpleCPU(params); 543 return cpu; 544} 545 546REGISTER_SIM_OBJECT("AtomicSimpleCPU", AtomicSimpleCPU) 547 |