From b6ff600bcae2d1e816d0e409c1638a15e207695b Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Wed, 4 Feb 2004 21:42:00 -0800 Subject: Add support for "serializing" instructions that flush execution pipeline (Alpha trapb & excb). Add support for write memory barriers (mostly impacts store buffer). Add StaticInst flag to indicate memory barriers, though this is not modeled in the pipeline yet. arch/alpha/isa_desc: Implement trapb, excb, mb, and wmb as insts with no execution effect (empty execute() function) but with flags that indicate their side effects. Also make sure every instruction that needs to go to the execute stage has a real opClass value, since we are now using No_OpClass to signal insts that can get dropped at dispatch. StaticInst::branchTarget() is now a const method. cpu/static_inst.hh: Add flags to indicate serializing insts (trapb, excb) and memory and write barriers. Also declare some StaticInst methods as const methods. dev/etherlink.hh: sim/eventq.hh: sim/serialize.cc: sim/serialize.hh: sim/sim_object.hh: Make name() return value const. --HG-- extra : convert_revision : 39520e71469fa20e0a7446b2e06b494eec17a02c --- dev/etherlink.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dev') diff --git a/dev/etherlink.hh b/dev/etherlink.hh index 895bac2e1..e1a7957ee 100644 --- a/dev/etherlink.hh +++ b/dev/etherlink.hh @@ -89,7 +89,7 @@ class EtherLink : public SimObject Link(const std::string &name, double rate, EtherDump *dump); ~Link() {} - virtual std::string name() const { return objName; } + virtual const std::string name() const { return objName; } bool busy() const { return (bool)packet; } bool transmit(PacketPtr &packet); -- cgit v1.2.3 From da8a7022126eef87d4007b7135aa89c559eb6747 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 9 Feb 2004 10:49:48 -0500 Subject: - Whack unused code - Make the MemoryController use address ranges (via Range) instead of an address and a mask base/remote_gdb.cc: reflect name change dev/alpha_access.h: better include dev/alpha_console.cc: - FunctionalMemory no longer takes care of mapping my address into the proper address space. It must be done locally. - the memory controller no longer uses a mask, but a size, and the size is determined by the device, not the .ini file - fix up address calculations to reflect the removal of a mask - PhysicalMemory::getSize() -> PhysicalMemory::size() dev/alpha_console.hh: - FunctionalMemory no longer takes care of mapping my address into the proper address space. It must be done locally. - the memory controller no longer uses a mask, but a size, and the size is determined by the device, not the .ini file - fix up address calculations to reflect the removal of a mask - get rid of MmapDevice and inherit from FunctionalMemory --HG-- extra : convert_revision : e3a65c9debf6f899632d62c70781cbdc2826616b --- dev/alpha_access.h | 2 +- dev/alpha_console.cc | 28 ++++++++++++---------------- dev/alpha_console.hh | 19 ++++++++++--------- 3 files changed, 23 insertions(+), 26 deletions(-) (limited to 'dev') diff --git a/dev/alpha_access.h b/dev/alpha_access.h index 7502635e9..40567e96f 100644 --- a/dev/alpha_access.h +++ b/dev/alpha_access.h @@ -36,7 +36,7 @@ #define ALPHA_ACCESS_VERSION (1301) /* CH++*/ #ifndef CONSOLE -#include +#include #include class Checkpoint; #endif diff --git a/dev/alpha_console.cc b/dev/alpha_console.cc index e708be514..2dc939b97 100644 --- a/dev/alpha_console.cc +++ b/dev/alpha_console.cc @@ -49,12 +49,13 @@ using namespace std; -AlphaConsole::AlphaConsole(const string &name, SimConsole *cons, - SimpleDisk *d, int size, System *system, - BaseCPU *cpu, TlaserClock *clock, int num_cpus, - Addr addr, Addr mask, MemoryController *mmu) - : MmapDevice(name, addr, mask, mmu), disk(d), console(cons) +AlphaConsole::AlphaConsole(const string &name, SimConsole *cons, SimpleDisk *d, + System *system, BaseCPU *cpu, TlaserClock *clock, + int num_cpus, MemoryController *mmu, Addr a) + : FunctionalMemory(name), disk(d), console(cons), addr(a) { + mmu->add_child(this, Range(addr, addr + size)); + consoleData = new uint8_t[size]; memset(consoleData, 0, size); @@ -65,7 +66,7 @@ AlphaConsole::AlphaConsole(const string &name, SimConsole *cons, alphaAccess->version = ALPHA_ACCESS_VERSION; alphaAccess->numCPUs = num_cpus; - alphaAccess->mem_size = system->physmem->getSize(); + alphaAccess->mem_size = system->physmem->size(); alphaAccess->cpuClock = cpu->getFreq() / 1000000; alphaAccess->intrClockFrequency = clock->frequency(); @@ -78,7 +79,8 @@ AlphaConsole::read(MemReqPtr &req, uint8_t *data) memset(data, 0, req->size); uint64_t val; - Addr daddr = req->paddr & addr_mask; + Addr daddr = req->paddr - addr; + switch (daddr) { case offsetof(AlphaAccess, inputChar): val = console->console_in(); @@ -125,7 +127,7 @@ AlphaConsole::write(MemReqPtr &req, const uint8_t *data) return Machine_Check_Fault; } - Addr daddr = req->paddr & addr_mask; + Addr daddr = req->paddr - addr; ExecContext *other_xc; switch (daddr) { @@ -243,11 +245,9 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(AlphaConsole) SimObjectParam sim_console; SimObjectParam disk; - Param size; Param num_cpus; SimObjectParam mmu; Param addr; - Param mask; SimObjectParam system; SimObjectParam cpu; SimObjectParam clock; @@ -258,11 +258,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(AlphaConsole) INIT_PARAM(sim_console, "The Simulator Console"), INIT_PARAM(disk, "Simple Disk"), - INIT_PARAM_DFLT(size, "AlphaConsole size", sizeof(AlphaAccess)), INIT_PARAM_DFLT(num_cpus, "Number of CPU's", 1), INIT_PARAM(mmu, "Memory Controller"), INIT_PARAM(addr, "Device Address"), - INIT_PARAM(mask, "Address Mask"), INIT_PARAM(system, "system object"), INIT_PARAM(cpu, "Processor"), INIT_PARAM(clock, "Turbolaser Clock") @@ -271,10 +269,8 @@ END_INIT_SIM_OBJECT_PARAMS(AlphaConsole) CREATE_SIM_OBJECT(AlphaConsole) { - return new AlphaConsole(getInstanceName(), sim_console, - disk, size, system, - cpu, clock, num_cpus, - addr, mask, mmu); + return new AlphaConsole(getInstanceName(), sim_console, disk, + system, cpu, clock, num_cpus, mmu, addr); } REGISTER_SIM_OBJECT("AlphaConsole", AlphaConsole) diff --git a/dev/alpha_console.hh b/dev/alpha_console.hh index c39b8e8d4..54a2af6d5 100644 --- a/dev/alpha_console.hh +++ b/dev/alpha_console.hh @@ -33,9 +33,10 @@ #ifndef __ALPHA_CONSOLE_HH__ #define __ALPHA_CONSOLE_HH__ -#include "sim/host.hh" +#include "base/range.hh" #include "dev/alpha_access.h" -#include "mem/functional_mem/mmap_device.hh" +#include "mem/functional_mem/functional_memory.hh" +#include "sim/host.hh" class BaseCPU; class SimConsole; @@ -68,7 +69,7 @@ class SimpleDisk; * primarily used doing boot before the kernel has loaded its device * drivers. */ -class AlphaConsole : public MmapDevice +class AlphaConsole : public FunctionalMemory { protected: union { @@ -82,15 +83,15 @@ class AlphaConsole : public MmapDevice /** the system console (the terminal) is accessable from the console */ SimConsole *console; + Addr addr; + static const Addr size = 0x80; // equal to sizeof(alpha_access); + public: /** Standard Constructor */ - AlphaConsole(const std::string &name, SimConsole *cons, - SimpleDisk *d, int size, - System *system, BaseCPU *cpu, - TlaserClock *clock, int num_cpus, - Addr addr, Addr mask, MemoryController *mmu); + AlphaConsole(const std::string &name, SimConsole *cons, SimpleDisk *d, + System *system, BaseCPU *cpu, TlaserClock *clock, + int num_cpus, MemoryController *mmu, Addr addr); - public: /** * memory mapped reads and writes */ -- cgit v1.2.3