gem5/src/arch/sparc/vtophys.cc

134 lines
4.8 KiB
C++
Raw Normal View History

split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 Setup fullsys build options Start to make fullsystem compile src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: RCS to BitKeeper src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add support for doing virtual to physical translation using the in-memory page table src/arch/sparc/vtophys.cc: a tad bit of error checking src/arch/sparc/vtophys.hh: Cleanup of full-system global variables, primarily in simple_cpu.cc, to allow multi-system simulations. (Multiple systems not yet yested though.) Also changes to build sim_smt in full-system mode (though with only SimpleCPU and not the full timing CPU for now). Still to do: minimize changes in SimpleCPU code between full-system and application modes... way too many ifdefs there. Much of the full-system stuff moved into SimpleCPU should be put in a new System object to allow multiprocessor simulations. Converted last remaining modules from C to C++ (mostly in /old). Renamed all .c files to .cc and a few .h files to .hh. Renamed architecture-specific files in arch/$TARGET from $TARGET.{cc,hh,def} to machine.{cc,hh,def} to get rid of pointless intermediate files in object directory. Split exo-specific definitions out of machine.hh into machine_exo.h. Specifics: In machine.def, null resource descriptors must be FUClamd_NA (and not NA) to pass C++ type checking. Enhanced error checking/reporting in bas src/arch/sparc/vtophys.cc: - Get rid of my String class, the Vector class, the bitvector class, and my doubly linked list class. - Convert tokenize, to_number (formerly StringToNumber) and eat_white to function on stl strings. - Change most cases of char * and const char * to string, or const string & - Some formatting and style nits, but not too many. src/arch/sparc/vtophys.cc: simplify src/arch/sparc/vtophys.cc: Renamed SimpleCPU::(read|write)_(byte|half|word|qword) to just read & write, overloaded on the type of the 'data' argument. Merged the full-system and non-full-system implementations of these eight original functions into two common template functions. To support this, also renamed (read|write)[1248] on memory_object and derivatives to just read & write, again overloaded on the type of the 'data' argument. Many of these functions could now be condensed into a few template functions (though with a level of indirection so that the interface can remain virtual). I did not do that though. src/arch/sparc/vtophys.cc: First pass at compiling with gcc 3.x. Lots of "std::" in header files, "using namespace std" in source files. (Note policy of not putting "using" statements in headers or before includes in sources.) Still not able to compile with gcc 3.2. Errors: - Can't create an ifstream from a file descriptor anymore (breaks IniFile). - "`class MSHR::MSHRegister' is private" errors in mshr.cc and prefetch_cache.cc: not clear why since it's in the public part of the class declaration. - cpu.cc:879: can't match a reference and 0 (specifically "no match for `bool ? SimObjectParam<PipeTrace*>& : int' operator") - pipetrace.cc: "invalid conversion from `int' to `std::_Ios_Fmtflags'" Warnings: - strstream now deprecated... needs some rewriting in sat_counter.hh and hybrid_pred.hh (need to get all that code out of the headers anyway) - trace.hh macro problem: cpp now says 'pasting "::" and "Event" does not give a valid preprocessing token' - major "implicit typename" issues in base/sized.hh src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Implement some interval statistics for full system mode. Create a callpal function that is called when a callpal occurs so it's easier to manipulate the statics. Rework the vtophys stuff to make it a bit cleaner. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Get rid of almost all old-style object names. This commit is equivalent to running the following script on the current head: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' \) -exec perl -pi -e '\ s/\bmemory_object\b(?!\.hh)/FunctionalMemory/g;\ s/\bvirtual_memory\b(?!\.hh)/VirtualMemory/g;\ s/\bmain_memory\b(?!\.hh)/MainMemory/g;\ s/\bphysical_memory\b(?!\.hh)/PhysicalMemory/g;\ s/\bspec_memory\b(?!\.hh)/SpeculativeMemory/g;\ s/\bMemObj\b(?!\.hh)/TimingMemObj/g;\ s/\bmemory_translation\b(?!\.hh)/AddressTranslator/g;\ s/\balpha_tlb\b(?!\.hh)/AlphaTlb/g;\ s/\balpha_itb\b(?!\.hh)/AlphaItb/g;\ s/\balpha_dtb\b(?!\.hh)/AlphaDtb/g;\ s/\bmemory_controller\b(?!\.hh)/MemoryController/g;\ s/\bstorebuffer_t\b(?!\.hh)/StoreBuffer/g;\ s/\bstorebuffer_entry_t\b(?!\.hh)/StoreBufferEntry/g;\ s/\bcreate_vector_t\b(?!\.hh)/CreateVector/g;\ s/\bcv_spec_state\b(?!\.hh)/CreateVecSpecState/g;\ s/\bspec_state_list\b(?!\.hh)/SpecStateList/g;\ s/\bdyn_inst_t\b(?!\.hh)/DynInst/g;' {} \; src/arch/sparc/vtophys.cc: since cprintf properly deals with 64-bit types, stop using FMT* as much as possible src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Change byte_t etc. to C99 standard int8_t etc. Other than old/host.h, all other changes were produced by this script: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' -o -name '*.c' -o -name '*.h' -o -name 'machine.def' \) -exec perl -pi -e '\ s/\bbyte_t\b(?!\.hh)/uint8_t/g;\ s/\bsbyte_t\b(?!\.hh)/int8_t/g;\ s/\bhalf_t\b(?!\.hh)/uint16_t/g;\ s/\bshalf_t\b(?!\.hh)/int16_t/g;\ s/\bword_t\b(?!\.hh)/uint32_t/g;\ s/\bsword_t\b(?!\.hh)/int32_t/g;\ s/\bqword_t\b(?!\.hh)/uint64_t/g;\ s/\bsqword_t\b(?!\.hh)/int64_t/g;\ s/\bbool_t\b(?!\.hh)/bool/g;\ s/\bdfloat_t\b(?!\.hh)/double/g;\ s/\bsfloat_t\b(?!\.hh)/float/g;' {} \; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add CVS Id tags src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Massive renaming to (almost) eliminate all md_* and MD_* names in preparation for total exorcism of machine.def. Most of the changes in this commit were performed with the following perl script (perl -pi <script> <files>). A small amount of manual fixup was needed to (mostly getting rid of the Addr typedefs in the various memory objects now that the former md_addr_t has that name). # rename machine-dependent types and constants (will be moving into ISA traits object) s/md_addr_t/Addr/g; s/md_intreg_t/IntReg/g; s/md_gpr_t/IntRegFile/g; s/md_fpreg_t/FloatReg/g; s/md_fpr_t/FloatRegFile/g; s/md_ctrlreg_t/MiscReg/g; s/md_ctrl_t/MiscRegFile/g; s/md_ipr_t/InternalProcReg/g; s/md_anyreg_t/AnyReg/g; s/md_inst_t/MachInst/g; s/regs_t/RegFile/g; # manually fix declaration in old/regs.h and a few forward decls s/struct RegFile/RegFile/g; s/MD_NUM_IREGS/NumIntRegs/g; s/MD_NUM_FREGS/NumFloatRegs/g; s/MD_NUM_CREGS/NumMiscRegs/g; s/MD_IPR_NUM/NumInternalProcRegs/g; s/MD_TOTAL_REGS/TotalNumRegs/g; s/MD_REG_ZERO/ZeroReg/g; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: New ISA description system. No more machine.def! Instructions are now decoded into StaticInst objects, and all static instruction properties (including execution behavior) are associated with those objects. Extended documentation in progress. Currently supports Alpha only; PISA will not compile. Use END_OF_MACHINE_DOT_DEF tag to extract previous version. src/arch/sparc/vtophys.cc: get rid of MD_IPR_foo and call it IPR_foo add some comments to describe what the various PALtemp registers do formatting src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: license src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: a little style src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add attribution to license. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Make include paths explicit. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: CopyData and CopyString moved from kernel.cc to vtophys.cc kernel.cc and kernel.hh moved to kern/tru64 src/arch/sparc/vtophys.hh: Include isa_traits.hh for Addr src/arch/sparc/vtophys.cc: formatting fixes src/arch/sparc/vtophys.cc: fix up vtophys to deal with translations if there is no ptbr, and to deal with PAL addresses add ptomem which is just a wrapper for dma_addr src/arch/sparc/vtophys.hh: add ptomem which is a wrapper for dma_addr with the same usage as vtomem src/arch/sparc/vtophys.cc: Fix to remote debugger while in PAL code src/arch/sparc/vtophys.cc: Remote an old hack that is now unnecessary src/arch/sparc/vtophys.cc: Removed buggy code that tries to fix PAL addresses (may cause problems while trying to debug in PAL code, but that should do this fix outside of vtophys) src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Updated Copyright src/arch/sparc/vtophys.cc: added back some code andrew removed and couldn't remember why. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: rename CopyData to CopyOut and implement CopyIn to copy data from the simulator into the simulatee src/arch/sparc/vtophys.cc: fixed a bad merge from linux<->tru64 src/arch/sparc/vtophys.cc: Check max address pal can be at so we don't do the wrong conversion if gdb asks for an unaligned access. src/arch/sparc/vtophys.cc: PGOFSET -> ALPHA_PGOFSET to avoid include file problems src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: in the arch/alpha directory we should use arch/alpha, not targetarch. sort includes while we're here. src/arch/sparc/vtophys.cc: use new constants, functions and structs to clean up the vtophys code. src/arch/sparc/vtophys.hh: Clean up a little bit and make the protypes match new changes. src/arch/sparc/vtophys.cc: deal with isa addition src/arch/sparc/vtophys.cc: shuffle files around for new directory structure src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Remove RCS Id string src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Update copyright dates and author list src/arch/sparc/vtophys.cc: Added a using directive for AlphaISA src/arch/sparc/vtophys.hh: Added the AlphaISA namespace specifier where needed src/arch/sparc/vtophys.hh: Made Addr a global type src/arch/sparc/vtophys.cc: Change access to the IPR to go through the XC. src/arch/sparc/vtophys.cc: Avoid directly accessing objects within the XC. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: fixed for new memory system put in namespace AlphaISA src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: Remove authors from copyright. src/arch/sparc/vtophys.cc: bk cp alpha/vtophys.cc sparc/vtophys.cc src/arch/sparc/vtophys.hh: bk cp alpha/vtophys.hh sparc/vtophys.hh src/arch/sparc/SConscript: remove fullsystem files that don't exist src/arch/sparc/isa_traits.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs src/arch/sparc/regfile.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 src/arch/sparc/system.cc: src/arch/sparc/system.hh: Add system level tick storage to make stick be syncronized across multiple processors src/arch/sparc/vtophys.hh: start to create a vtophys for Sparc src/base/loader/symtab.hh: Addr is defined in sim/host.hh --HG-- extra : convert_revision : ae4658e6bc2e2b51d7fb1c711d069ffe99e1377d
2006-05-29 22:53:47 +02:00
/*
* Copyright (c) 2002-2005 The Regents of The University of Michigan
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer;
* redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution;
* neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Authors: Ali Saidi
split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 Setup fullsys build options Start to make fullsystem compile src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: RCS to BitKeeper src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add support for doing virtual to physical translation using the in-memory page table src/arch/sparc/vtophys.cc: a tad bit of error checking src/arch/sparc/vtophys.hh: Cleanup of full-system global variables, primarily in simple_cpu.cc, to allow multi-system simulations. (Multiple systems not yet yested though.) Also changes to build sim_smt in full-system mode (though with only SimpleCPU and not the full timing CPU for now). Still to do: minimize changes in SimpleCPU code between full-system and application modes... way too many ifdefs there. Much of the full-system stuff moved into SimpleCPU should be put in a new System object to allow multiprocessor simulations. Converted last remaining modules from C to C++ (mostly in /old). Renamed all .c files to .cc and a few .h files to .hh. Renamed architecture-specific files in arch/$TARGET from $TARGET.{cc,hh,def} to machine.{cc,hh,def} to get rid of pointless intermediate files in object directory. Split exo-specific definitions out of machine.hh into machine_exo.h. Specifics: In machine.def, null resource descriptors must be FUClamd_NA (and not NA) to pass C++ type checking. Enhanced error checking/reporting in bas src/arch/sparc/vtophys.cc: - Get rid of my String class, the Vector class, the bitvector class, and my doubly linked list class. - Convert tokenize, to_number (formerly StringToNumber) and eat_white to function on stl strings. - Change most cases of char * and const char * to string, or const string & - Some formatting and style nits, but not too many. src/arch/sparc/vtophys.cc: simplify src/arch/sparc/vtophys.cc: Renamed SimpleCPU::(read|write)_(byte|half|word|qword) to just read & write, overloaded on the type of the 'data' argument. Merged the full-system and non-full-system implementations of these eight original functions into two common template functions. To support this, also renamed (read|write)[1248] on memory_object and derivatives to just read & write, again overloaded on the type of the 'data' argument. Many of these functions could now be condensed into a few template functions (though with a level of indirection so that the interface can remain virtual). I did not do that though. src/arch/sparc/vtophys.cc: First pass at compiling with gcc 3.x. Lots of "std::" in header files, "using namespace std" in source files. (Note policy of not putting "using" statements in headers or before includes in sources.) Still not able to compile with gcc 3.2. Errors: - Can't create an ifstream from a file descriptor anymore (breaks IniFile). - "`class MSHR::MSHRegister' is private" errors in mshr.cc and prefetch_cache.cc: not clear why since it's in the public part of the class declaration. - cpu.cc:879: can't match a reference and 0 (specifically "no match for `bool ? SimObjectParam<PipeTrace*>& : int' operator") - pipetrace.cc: "invalid conversion from `int' to `std::_Ios_Fmtflags'" Warnings: - strstream now deprecated... needs some rewriting in sat_counter.hh and hybrid_pred.hh (need to get all that code out of the headers anyway) - trace.hh macro problem: cpp now says 'pasting "::" and "Event" does not give a valid preprocessing token' - major "implicit typename" issues in base/sized.hh src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Implement some interval statistics for full system mode. Create a callpal function that is called when a callpal occurs so it's easier to manipulate the statics. Rework the vtophys stuff to make it a bit cleaner. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Get rid of almost all old-style object names. This commit is equivalent to running the following script on the current head: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' \) -exec perl -pi -e '\ s/\bmemory_object\b(?!\.hh)/FunctionalMemory/g;\ s/\bvirtual_memory\b(?!\.hh)/VirtualMemory/g;\ s/\bmain_memory\b(?!\.hh)/MainMemory/g;\ s/\bphysical_memory\b(?!\.hh)/PhysicalMemory/g;\ s/\bspec_memory\b(?!\.hh)/SpeculativeMemory/g;\ s/\bMemObj\b(?!\.hh)/TimingMemObj/g;\ s/\bmemory_translation\b(?!\.hh)/AddressTranslator/g;\ s/\balpha_tlb\b(?!\.hh)/AlphaTlb/g;\ s/\balpha_itb\b(?!\.hh)/AlphaItb/g;\ s/\balpha_dtb\b(?!\.hh)/AlphaDtb/g;\ s/\bmemory_controller\b(?!\.hh)/MemoryController/g;\ s/\bstorebuffer_t\b(?!\.hh)/StoreBuffer/g;\ s/\bstorebuffer_entry_t\b(?!\.hh)/StoreBufferEntry/g;\ s/\bcreate_vector_t\b(?!\.hh)/CreateVector/g;\ s/\bcv_spec_state\b(?!\.hh)/CreateVecSpecState/g;\ s/\bspec_state_list\b(?!\.hh)/SpecStateList/g;\ s/\bdyn_inst_t\b(?!\.hh)/DynInst/g;' {} \; src/arch/sparc/vtophys.cc: since cprintf properly deals with 64-bit types, stop using FMT* as much as possible src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Change byte_t etc. to C99 standard int8_t etc. Other than old/host.h, all other changes were produced by this script: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' -o -name '*.c' -o -name '*.h' -o -name 'machine.def' \) -exec perl -pi -e '\ s/\bbyte_t\b(?!\.hh)/uint8_t/g;\ s/\bsbyte_t\b(?!\.hh)/int8_t/g;\ s/\bhalf_t\b(?!\.hh)/uint16_t/g;\ s/\bshalf_t\b(?!\.hh)/int16_t/g;\ s/\bword_t\b(?!\.hh)/uint32_t/g;\ s/\bsword_t\b(?!\.hh)/int32_t/g;\ s/\bqword_t\b(?!\.hh)/uint64_t/g;\ s/\bsqword_t\b(?!\.hh)/int64_t/g;\ s/\bbool_t\b(?!\.hh)/bool/g;\ s/\bdfloat_t\b(?!\.hh)/double/g;\ s/\bsfloat_t\b(?!\.hh)/float/g;' {} \; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add CVS Id tags src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Massive renaming to (almost) eliminate all md_* and MD_* names in preparation for total exorcism of machine.def. Most of the changes in this commit were performed with the following perl script (perl -pi <script> <files>). A small amount of manual fixup was needed to (mostly getting rid of the Addr typedefs in the various memory objects now that the former md_addr_t has that name). # rename machine-dependent types and constants (will be moving into ISA traits object) s/md_addr_t/Addr/g; s/md_intreg_t/IntReg/g; s/md_gpr_t/IntRegFile/g; s/md_fpreg_t/FloatReg/g; s/md_fpr_t/FloatRegFile/g; s/md_ctrlreg_t/MiscReg/g; s/md_ctrl_t/MiscRegFile/g; s/md_ipr_t/InternalProcReg/g; s/md_anyreg_t/AnyReg/g; s/md_inst_t/MachInst/g; s/regs_t/RegFile/g; # manually fix declaration in old/regs.h and a few forward decls s/struct RegFile/RegFile/g; s/MD_NUM_IREGS/NumIntRegs/g; s/MD_NUM_FREGS/NumFloatRegs/g; s/MD_NUM_CREGS/NumMiscRegs/g; s/MD_IPR_NUM/NumInternalProcRegs/g; s/MD_TOTAL_REGS/TotalNumRegs/g; s/MD_REG_ZERO/ZeroReg/g; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: New ISA description system. No more machine.def! Instructions are now decoded into StaticInst objects, and all static instruction properties (including execution behavior) are associated with those objects. Extended documentation in progress. Currently supports Alpha only; PISA will not compile. Use END_OF_MACHINE_DOT_DEF tag to extract previous version. src/arch/sparc/vtophys.cc: get rid of MD_IPR_foo and call it IPR_foo add some comments to describe what the various PALtemp registers do formatting src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: license src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: a little style src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add attribution to license. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Make include paths explicit. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: CopyData and CopyString moved from kernel.cc to vtophys.cc kernel.cc and kernel.hh moved to kern/tru64 src/arch/sparc/vtophys.hh: Include isa_traits.hh for Addr src/arch/sparc/vtophys.cc: formatting fixes src/arch/sparc/vtophys.cc: fix up vtophys to deal with translations if there is no ptbr, and to deal with PAL addresses add ptomem which is just a wrapper for dma_addr src/arch/sparc/vtophys.hh: add ptomem which is a wrapper for dma_addr with the same usage as vtomem src/arch/sparc/vtophys.cc: Fix to remote debugger while in PAL code src/arch/sparc/vtophys.cc: Remote an old hack that is now unnecessary src/arch/sparc/vtophys.cc: Removed buggy code that tries to fix PAL addresses (may cause problems while trying to debug in PAL code, but that should do this fix outside of vtophys) src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Updated Copyright src/arch/sparc/vtophys.cc: added back some code andrew removed and couldn't remember why. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: rename CopyData to CopyOut and implement CopyIn to copy data from the simulator into the simulatee src/arch/sparc/vtophys.cc: fixed a bad merge from linux<->tru64 src/arch/sparc/vtophys.cc: Check max address pal can be at so we don't do the wrong conversion if gdb asks for an unaligned access. src/arch/sparc/vtophys.cc: PGOFSET -> ALPHA_PGOFSET to avoid include file problems src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: in the arch/alpha directory we should use arch/alpha, not targetarch. sort includes while we're here. src/arch/sparc/vtophys.cc: use new constants, functions and structs to clean up the vtophys code. src/arch/sparc/vtophys.hh: Clean up a little bit and make the protypes match new changes. src/arch/sparc/vtophys.cc: deal with isa addition src/arch/sparc/vtophys.cc: shuffle files around for new directory structure src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Remove RCS Id string src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Update copyright dates and author list src/arch/sparc/vtophys.cc: Added a using directive for AlphaISA src/arch/sparc/vtophys.hh: Added the AlphaISA namespace specifier where needed src/arch/sparc/vtophys.hh: Made Addr a global type src/arch/sparc/vtophys.cc: Change access to the IPR to go through the XC. src/arch/sparc/vtophys.cc: Avoid directly accessing objects within the XC. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: fixed for new memory system put in namespace AlphaISA src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: Remove authors from copyright. src/arch/sparc/vtophys.cc: bk cp alpha/vtophys.cc sparc/vtophys.cc src/arch/sparc/vtophys.hh: bk cp alpha/vtophys.hh sparc/vtophys.hh src/arch/sparc/SConscript: remove fullsystem files that don't exist src/arch/sparc/isa_traits.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs src/arch/sparc/regfile.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 src/arch/sparc/system.cc: src/arch/sparc/system.hh: Add system level tick storage to make stick be syncronized across multiple processors src/arch/sparc/vtophys.hh: start to create a vtophys for Sparc src/base/loader/symtab.hh: Addr is defined in sim/host.hh --HG-- extra : convert_revision : ae4658e6bc2e2b51d7fb1c711d069ffe99e1377d
2006-05-29 22:53:47 +02:00
*/
#include <string>
#include "arch/sparc/tlb.hh"
2011-04-15 19:44:06 +02:00
#include "arch/sparc/vtophys.hh"
split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 Setup fullsys build options Start to make fullsystem compile src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: RCS to BitKeeper src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add support for doing virtual to physical translation using the in-memory page table src/arch/sparc/vtophys.cc: a tad bit of error checking src/arch/sparc/vtophys.hh: Cleanup of full-system global variables, primarily in simple_cpu.cc, to allow multi-system simulations. (Multiple systems not yet yested though.) Also changes to build sim_smt in full-system mode (though with only SimpleCPU and not the full timing CPU for now). Still to do: minimize changes in SimpleCPU code between full-system and application modes... way too many ifdefs there. Much of the full-system stuff moved into SimpleCPU should be put in a new System object to allow multiprocessor simulations. Converted last remaining modules from C to C++ (mostly in /old). Renamed all .c files to .cc and a few .h files to .hh. Renamed architecture-specific files in arch/$TARGET from $TARGET.{cc,hh,def} to machine.{cc,hh,def} to get rid of pointless intermediate files in object directory. Split exo-specific definitions out of machine.hh into machine_exo.h. Specifics: In machine.def, null resource descriptors must be FUClamd_NA (and not NA) to pass C++ type checking. Enhanced error checking/reporting in bas src/arch/sparc/vtophys.cc: - Get rid of my String class, the Vector class, the bitvector class, and my doubly linked list class. - Convert tokenize, to_number (formerly StringToNumber) and eat_white to function on stl strings. - Change most cases of char * and const char * to string, or const string & - Some formatting and style nits, but not too many. src/arch/sparc/vtophys.cc: simplify src/arch/sparc/vtophys.cc: Renamed SimpleCPU::(read|write)_(byte|half|word|qword) to just read & write, overloaded on the type of the 'data' argument. Merged the full-system and non-full-system implementations of these eight original functions into two common template functions. To support this, also renamed (read|write)[1248] on memory_object and derivatives to just read & write, again overloaded on the type of the 'data' argument. Many of these functions could now be condensed into a few template functions (though with a level of indirection so that the interface can remain virtual). I did not do that though. src/arch/sparc/vtophys.cc: First pass at compiling with gcc 3.x. Lots of "std::" in header files, "using namespace std" in source files. (Note policy of not putting "using" statements in headers or before includes in sources.) Still not able to compile with gcc 3.2. Errors: - Can't create an ifstream from a file descriptor anymore (breaks IniFile). - "`class MSHR::MSHRegister' is private" errors in mshr.cc and prefetch_cache.cc: not clear why since it's in the public part of the class declaration. - cpu.cc:879: can't match a reference and 0 (specifically "no match for `bool ? SimObjectParam<PipeTrace*>& : int' operator") - pipetrace.cc: "invalid conversion from `int' to `std::_Ios_Fmtflags'" Warnings: - strstream now deprecated... needs some rewriting in sat_counter.hh and hybrid_pred.hh (need to get all that code out of the headers anyway) - trace.hh macro problem: cpp now says 'pasting "::" and "Event" does not give a valid preprocessing token' - major "implicit typename" issues in base/sized.hh src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Implement some interval statistics for full system mode. Create a callpal function that is called when a callpal occurs so it's easier to manipulate the statics. Rework the vtophys stuff to make it a bit cleaner. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Get rid of almost all old-style object names. This commit is equivalent to running the following script on the current head: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' \) -exec perl -pi -e '\ s/\bmemory_object\b(?!\.hh)/FunctionalMemory/g;\ s/\bvirtual_memory\b(?!\.hh)/VirtualMemory/g;\ s/\bmain_memory\b(?!\.hh)/MainMemory/g;\ s/\bphysical_memory\b(?!\.hh)/PhysicalMemory/g;\ s/\bspec_memory\b(?!\.hh)/SpeculativeMemory/g;\ s/\bMemObj\b(?!\.hh)/TimingMemObj/g;\ s/\bmemory_translation\b(?!\.hh)/AddressTranslator/g;\ s/\balpha_tlb\b(?!\.hh)/AlphaTlb/g;\ s/\balpha_itb\b(?!\.hh)/AlphaItb/g;\ s/\balpha_dtb\b(?!\.hh)/AlphaDtb/g;\ s/\bmemory_controller\b(?!\.hh)/MemoryController/g;\ s/\bstorebuffer_t\b(?!\.hh)/StoreBuffer/g;\ s/\bstorebuffer_entry_t\b(?!\.hh)/StoreBufferEntry/g;\ s/\bcreate_vector_t\b(?!\.hh)/CreateVector/g;\ s/\bcv_spec_state\b(?!\.hh)/CreateVecSpecState/g;\ s/\bspec_state_list\b(?!\.hh)/SpecStateList/g;\ s/\bdyn_inst_t\b(?!\.hh)/DynInst/g;' {} \; src/arch/sparc/vtophys.cc: since cprintf properly deals with 64-bit types, stop using FMT* as much as possible src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Change byte_t etc. to C99 standard int8_t etc. Other than old/host.h, all other changes were produced by this script: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' -o -name '*.c' -o -name '*.h' -o -name 'machine.def' \) -exec perl -pi -e '\ s/\bbyte_t\b(?!\.hh)/uint8_t/g;\ s/\bsbyte_t\b(?!\.hh)/int8_t/g;\ s/\bhalf_t\b(?!\.hh)/uint16_t/g;\ s/\bshalf_t\b(?!\.hh)/int16_t/g;\ s/\bword_t\b(?!\.hh)/uint32_t/g;\ s/\bsword_t\b(?!\.hh)/int32_t/g;\ s/\bqword_t\b(?!\.hh)/uint64_t/g;\ s/\bsqword_t\b(?!\.hh)/int64_t/g;\ s/\bbool_t\b(?!\.hh)/bool/g;\ s/\bdfloat_t\b(?!\.hh)/double/g;\ s/\bsfloat_t\b(?!\.hh)/float/g;' {} \; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add CVS Id tags src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Massive renaming to (almost) eliminate all md_* and MD_* names in preparation for total exorcism of machine.def. Most of the changes in this commit were performed with the following perl script (perl -pi <script> <files>). A small amount of manual fixup was needed to (mostly getting rid of the Addr typedefs in the various memory objects now that the former md_addr_t has that name). # rename machine-dependent types and constants (will be moving into ISA traits object) s/md_addr_t/Addr/g; s/md_intreg_t/IntReg/g; s/md_gpr_t/IntRegFile/g; s/md_fpreg_t/FloatReg/g; s/md_fpr_t/FloatRegFile/g; s/md_ctrlreg_t/MiscReg/g; s/md_ctrl_t/MiscRegFile/g; s/md_ipr_t/InternalProcReg/g; s/md_anyreg_t/AnyReg/g; s/md_inst_t/MachInst/g; s/regs_t/RegFile/g; # manually fix declaration in old/regs.h and a few forward decls s/struct RegFile/RegFile/g; s/MD_NUM_IREGS/NumIntRegs/g; s/MD_NUM_FREGS/NumFloatRegs/g; s/MD_NUM_CREGS/NumMiscRegs/g; s/MD_IPR_NUM/NumInternalProcRegs/g; s/MD_TOTAL_REGS/TotalNumRegs/g; s/MD_REG_ZERO/ZeroReg/g; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: New ISA description system. No more machine.def! Instructions are now decoded into StaticInst objects, and all static instruction properties (including execution behavior) are associated with those objects. Extended documentation in progress. Currently supports Alpha only; PISA will not compile. Use END_OF_MACHINE_DOT_DEF tag to extract previous version. src/arch/sparc/vtophys.cc: get rid of MD_IPR_foo and call it IPR_foo add some comments to describe what the various PALtemp registers do formatting src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: license src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: a little style src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add attribution to license. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Make include paths explicit. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: CopyData and CopyString moved from kernel.cc to vtophys.cc kernel.cc and kernel.hh moved to kern/tru64 src/arch/sparc/vtophys.hh: Include isa_traits.hh for Addr src/arch/sparc/vtophys.cc: formatting fixes src/arch/sparc/vtophys.cc: fix up vtophys to deal with translations if there is no ptbr, and to deal with PAL addresses add ptomem which is just a wrapper for dma_addr src/arch/sparc/vtophys.hh: add ptomem which is a wrapper for dma_addr with the same usage as vtomem src/arch/sparc/vtophys.cc: Fix to remote debugger while in PAL code src/arch/sparc/vtophys.cc: Remote an old hack that is now unnecessary src/arch/sparc/vtophys.cc: Removed buggy code that tries to fix PAL addresses (may cause problems while trying to debug in PAL code, but that should do this fix outside of vtophys) src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Updated Copyright src/arch/sparc/vtophys.cc: added back some code andrew removed and couldn't remember why. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: rename CopyData to CopyOut and implement CopyIn to copy data from the simulator into the simulatee src/arch/sparc/vtophys.cc: fixed a bad merge from linux<->tru64 src/arch/sparc/vtophys.cc: Check max address pal can be at so we don't do the wrong conversion if gdb asks for an unaligned access. src/arch/sparc/vtophys.cc: PGOFSET -> ALPHA_PGOFSET to avoid include file problems src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: in the arch/alpha directory we should use arch/alpha, not targetarch. sort includes while we're here. src/arch/sparc/vtophys.cc: use new constants, functions and structs to clean up the vtophys code. src/arch/sparc/vtophys.hh: Clean up a little bit and make the protypes match new changes. src/arch/sparc/vtophys.cc: deal with isa addition src/arch/sparc/vtophys.cc: shuffle files around for new directory structure src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Remove RCS Id string src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Update copyright dates and author list src/arch/sparc/vtophys.cc: Added a using directive for AlphaISA src/arch/sparc/vtophys.hh: Added the AlphaISA namespace specifier where needed src/arch/sparc/vtophys.hh: Made Addr a global type src/arch/sparc/vtophys.cc: Change access to the IPR to go through the XC. src/arch/sparc/vtophys.cc: Avoid directly accessing objects within the XC. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: fixed for new memory system put in namespace AlphaISA src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: Remove authors from copyright. src/arch/sparc/vtophys.cc: bk cp alpha/vtophys.cc sparc/vtophys.cc src/arch/sparc/vtophys.hh: bk cp alpha/vtophys.hh sparc/vtophys.hh src/arch/sparc/SConscript: remove fullsystem files that don't exist src/arch/sparc/isa_traits.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs src/arch/sparc/regfile.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 src/arch/sparc/system.cc: src/arch/sparc/system.hh: Add system level tick storage to make stick be syncronized across multiple processors src/arch/sparc/vtophys.hh: start to create a vtophys for Sparc src/base/loader/symtab.hh: Addr is defined in sim/host.hh --HG-- extra : convert_revision : ae4658e6bc2e2b51d7fb1c711d069ffe99e1377d
2006-05-29 22:53:47 +02:00
#include "base/chunk_generator.hh"
2011-04-15 19:44:06 +02:00
#include "base/compiler.hh"
split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 Setup fullsys build options Start to make fullsystem compile src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: RCS to BitKeeper src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add support for doing virtual to physical translation using the in-memory page table src/arch/sparc/vtophys.cc: a tad bit of error checking src/arch/sparc/vtophys.hh: Cleanup of full-system global variables, primarily in simple_cpu.cc, to allow multi-system simulations. (Multiple systems not yet yested though.) Also changes to build sim_smt in full-system mode (though with only SimpleCPU and not the full timing CPU for now). Still to do: minimize changes in SimpleCPU code between full-system and application modes... way too many ifdefs there. Much of the full-system stuff moved into SimpleCPU should be put in a new System object to allow multiprocessor simulations. Converted last remaining modules from C to C++ (mostly in /old). Renamed all .c files to .cc and a few .h files to .hh. Renamed architecture-specific files in arch/$TARGET from $TARGET.{cc,hh,def} to machine.{cc,hh,def} to get rid of pointless intermediate files in object directory. Split exo-specific definitions out of machine.hh into machine_exo.h. Specifics: In machine.def, null resource descriptors must be FUClamd_NA (and not NA) to pass C++ type checking. Enhanced error checking/reporting in bas src/arch/sparc/vtophys.cc: - Get rid of my String class, the Vector class, the bitvector class, and my doubly linked list class. - Convert tokenize, to_number (formerly StringToNumber) and eat_white to function on stl strings. - Change most cases of char * and const char * to string, or const string & - Some formatting and style nits, but not too many. src/arch/sparc/vtophys.cc: simplify src/arch/sparc/vtophys.cc: Renamed SimpleCPU::(read|write)_(byte|half|word|qword) to just read & write, overloaded on the type of the 'data' argument. Merged the full-system and non-full-system implementations of these eight original functions into two common template functions. To support this, also renamed (read|write)[1248] on memory_object and derivatives to just read & write, again overloaded on the type of the 'data' argument. Many of these functions could now be condensed into a few template functions (though with a level of indirection so that the interface can remain virtual). I did not do that though. src/arch/sparc/vtophys.cc: First pass at compiling with gcc 3.x. Lots of "std::" in header files, "using namespace std" in source files. (Note policy of not putting "using" statements in headers or before includes in sources.) Still not able to compile with gcc 3.2. Errors: - Can't create an ifstream from a file descriptor anymore (breaks IniFile). - "`class MSHR::MSHRegister' is private" errors in mshr.cc and prefetch_cache.cc: not clear why since it's in the public part of the class declaration. - cpu.cc:879: can't match a reference and 0 (specifically "no match for `bool ? SimObjectParam<PipeTrace*>& : int' operator") - pipetrace.cc: "invalid conversion from `int' to `std::_Ios_Fmtflags'" Warnings: - strstream now deprecated... needs some rewriting in sat_counter.hh and hybrid_pred.hh (need to get all that code out of the headers anyway) - trace.hh macro problem: cpp now says 'pasting "::" and "Event" does not give a valid preprocessing token' - major "implicit typename" issues in base/sized.hh src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Implement some interval statistics for full system mode. Create a callpal function that is called when a callpal occurs so it's easier to manipulate the statics. Rework the vtophys stuff to make it a bit cleaner. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Get rid of almost all old-style object names. This commit is equivalent to running the following script on the current head: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' \) -exec perl -pi -e '\ s/\bmemory_object\b(?!\.hh)/FunctionalMemory/g;\ s/\bvirtual_memory\b(?!\.hh)/VirtualMemory/g;\ s/\bmain_memory\b(?!\.hh)/MainMemory/g;\ s/\bphysical_memory\b(?!\.hh)/PhysicalMemory/g;\ s/\bspec_memory\b(?!\.hh)/SpeculativeMemory/g;\ s/\bMemObj\b(?!\.hh)/TimingMemObj/g;\ s/\bmemory_translation\b(?!\.hh)/AddressTranslator/g;\ s/\balpha_tlb\b(?!\.hh)/AlphaTlb/g;\ s/\balpha_itb\b(?!\.hh)/AlphaItb/g;\ s/\balpha_dtb\b(?!\.hh)/AlphaDtb/g;\ s/\bmemory_controller\b(?!\.hh)/MemoryController/g;\ s/\bstorebuffer_t\b(?!\.hh)/StoreBuffer/g;\ s/\bstorebuffer_entry_t\b(?!\.hh)/StoreBufferEntry/g;\ s/\bcreate_vector_t\b(?!\.hh)/CreateVector/g;\ s/\bcv_spec_state\b(?!\.hh)/CreateVecSpecState/g;\ s/\bspec_state_list\b(?!\.hh)/SpecStateList/g;\ s/\bdyn_inst_t\b(?!\.hh)/DynInst/g;' {} \; src/arch/sparc/vtophys.cc: since cprintf properly deals with 64-bit types, stop using FMT* as much as possible src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Change byte_t etc. to C99 standard int8_t etc. Other than old/host.h, all other changes were produced by this script: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' -o -name '*.c' -o -name '*.h' -o -name 'machine.def' \) -exec perl -pi -e '\ s/\bbyte_t\b(?!\.hh)/uint8_t/g;\ s/\bsbyte_t\b(?!\.hh)/int8_t/g;\ s/\bhalf_t\b(?!\.hh)/uint16_t/g;\ s/\bshalf_t\b(?!\.hh)/int16_t/g;\ s/\bword_t\b(?!\.hh)/uint32_t/g;\ s/\bsword_t\b(?!\.hh)/int32_t/g;\ s/\bqword_t\b(?!\.hh)/uint64_t/g;\ s/\bsqword_t\b(?!\.hh)/int64_t/g;\ s/\bbool_t\b(?!\.hh)/bool/g;\ s/\bdfloat_t\b(?!\.hh)/double/g;\ s/\bsfloat_t\b(?!\.hh)/float/g;' {} \; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add CVS Id tags src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Massive renaming to (almost) eliminate all md_* and MD_* names in preparation for total exorcism of machine.def. Most of the changes in this commit were performed with the following perl script (perl -pi <script> <files>). A small amount of manual fixup was needed to (mostly getting rid of the Addr typedefs in the various memory objects now that the former md_addr_t has that name). # rename machine-dependent types and constants (will be moving into ISA traits object) s/md_addr_t/Addr/g; s/md_intreg_t/IntReg/g; s/md_gpr_t/IntRegFile/g; s/md_fpreg_t/FloatReg/g; s/md_fpr_t/FloatRegFile/g; s/md_ctrlreg_t/MiscReg/g; s/md_ctrl_t/MiscRegFile/g; s/md_ipr_t/InternalProcReg/g; s/md_anyreg_t/AnyReg/g; s/md_inst_t/MachInst/g; s/regs_t/RegFile/g; # manually fix declaration in old/regs.h and a few forward decls s/struct RegFile/RegFile/g; s/MD_NUM_IREGS/NumIntRegs/g; s/MD_NUM_FREGS/NumFloatRegs/g; s/MD_NUM_CREGS/NumMiscRegs/g; s/MD_IPR_NUM/NumInternalProcRegs/g; s/MD_TOTAL_REGS/TotalNumRegs/g; s/MD_REG_ZERO/ZeroReg/g; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: New ISA description system. No more machine.def! Instructions are now decoded into StaticInst objects, and all static instruction properties (including execution behavior) are associated with those objects. Extended documentation in progress. Currently supports Alpha only; PISA will not compile. Use END_OF_MACHINE_DOT_DEF tag to extract previous version. src/arch/sparc/vtophys.cc: get rid of MD_IPR_foo and call it IPR_foo add some comments to describe what the various PALtemp registers do formatting src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: license src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: a little style src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add attribution to license. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Make include paths explicit. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: CopyData and CopyString moved from kernel.cc to vtophys.cc kernel.cc and kernel.hh moved to kern/tru64 src/arch/sparc/vtophys.hh: Include isa_traits.hh for Addr src/arch/sparc/vtophys.cc: formatting fixes src/arch/sparc/vtophys.cc: fix up vtophys to deal with translations if there is no ptbr, and to deal with PAL addresses add ptomem which is just a wrapper for dma_addr src/arch/sparc/vtophys.hh: add ptomem which is a wrapper for dma_addr with the same usage as vtomem src/arch/sparc/vtophys.cc: Fix to remote debugger while in PAL code src/arch/sparc/vtophys.cc: Remote an old hack that is now unnecessary src/arch/sparc/vtophys.cc: Removed buggy code that tries to fix PAL addresses (may cause problems while trying to debug in PAL code, but that should do this fix outside of vtophys) src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Updated Copyright src/arch/sparc/vtophys.cc: added back some code andrew removed and couldn't remember why. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: rename CopyData to CopyOut and implement CopyIn to copy data from the simulator into the simulatee src/arch/sparc/vtophys.cc: fixed a bad merge from linux<->tru64 src/arch/sparc/vtophys.cc: Check max address pal can be at so we don't do the wrong conversion if gdb asks for an unaligned access. src/arch/sparc/vtophys.cc: PGOFSET -> ALPHA_PGOFSET to avoid include file problems src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: in the arch/alpha directory we should use arch/alpha, not targetarch. sort includes while we're here. src/arch/sparc/vtophys.cc: use new constants, functions and structs to clean up the vtophys code. src/arch/sparc/vtophys.hh: Clean up a little bit and make the protypes match new changes. src/arch/sparc/vtophys.cc: deal with isa addition src/arch/sparc/vtophys.cc: shuffle files around for new directory structure src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Remove RCS Id string src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Update copyright dates and author list src/arch/sparc/vtophys.cc: Added a using directive for AlphaISA src/arch/sparc/vtophys.hh: Added the AlphaISA namespace specifier where needed src/arch/sparc/vtophys.hh: Made Addr a global type src/arch/sparc/vtophys.cc: Change access to the IPR to go through the XC. src/arch/sparc/vtophys.cc: Avoid directly accessing objects within the XC. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: fixed for new memory system put in namespace AlphaISA src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: Remove authors from copyright. src/arch/sparc/vtophys.cc: bk cp alpha/vtophys.cc sparc/vtophys.cc src/arch/sparc/vtophys.hh: bk cp alpha/vtophys.hh sparc/vtophys.hh src/arch/sparc/SConscript: remove fullsystem files that don't exist src/arch/sparc/isa_traits.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs src/arch/sparc/regfile.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 src/arch/sparc/system.cc: src/arch/sparc/system.hh: Add system level tick storage to make stick be syncronized across multiple processors src/arch/sparc/vtophys.hh: start to create a vtophys for Sparc src/base/loader/symtab.hh: Addr is defined in sim/host.hh --HG-- extra : convert_revision : ae4658e6bc2e2b51d7fb1c711d069ffe99e1377d
2006-05-29 22:53:47 +02:00
#include "base/trace.hh"
Change ExecContext to ThreadContext. This is being renamed to differentiate between the interface used objects outside of the CPU, and the interface used by the ISA. ThreadContext is used by objects outside of the CPU and is specifically defined in thread_context.hh. ExecContext is more implicit, and is defined by files such as base_dyn_inst.hh or cpu/simple/base.hh. Further renames/reorganization will be coming shortly; what is currently CPUExecContext (the old ExecContext from m5) will be renamed to SimpleThread or something similar. src/arch/alpha/arguments.cc: src/arch/alpha/arguments.hh: src/arch/alpha/ev5.cc: src/arch/alpha/faults.cc: src/arch/alpha/faults.hh: src/arch/alpha/freebsd/system.cc: src/arch/alpha/freebsd/system.hh: src/arch/alpha/isa/branch.isa: src/arch/alpha/isa/decoder.isa: src/arch/alpha/isa/main.isa: src/arch/alpha/linux/process.cc: src/arch/alpha/linux/system.cc: src/arch/alpha/linux/system.hh: src/arch/alpha/linux/threadinfo.hh: src/arch/alpha/process.cc: src/arch/alpha/regfile.hh: src/arch/alpha/stacktrace.cc: src/arch/alpha/stacktrace.hh: src/arch/alpha/tlb.cc: src/arch/alpha/tlb.hh: src/arch/alpha/tru64/process.cc: src/arch/alpha/tru64/system.cc: src/arch/alpha/tru64/system.hh: src/arch/alpha/utility.hh: src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: src/arch/mips/faults.cc: src/arch/mips/faults.hh: src/arch/mips/isa_traits.cc: src/arch/mips/isa_traits.hh: src/arch/mips/linux/process.cc: src/arch/mips/process.cc: src/arch/mips/regfile/float_regfile.hh: src/arch/mips/regfile/int_regfile.hh: src/arch/mips/regfile/misc_regfile.hh: src/arch/mips/regfile/regfile.hh: src/arch/mips/stacktrace.hh: src/arch/sparc/faults.cc: src/arch/sparc/faults.hh: src/arch/sparc/isa_traits.hh: src/arch/sparc/linux/process.cc: src/arch/sparc/linux/process.hh: src/arch/sparc/process.cc: src/arch/sparc/regfile.hh: src/arch/sparc/solaris/process.cc: src/arch/sparc/stacktrace.hh: src/arch/sparc/ua2005.cc: src/arch/sparc/utility.hh: src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: src/base/remote_gdb.cc: src/base/remote_gdb.hh: src/cpu/base.cc: src/cpu/base.hh: src/cpu/base_dyn_inst.hh: src/cpu/checker/cpu.cc: src/cpu/checker/cpu.hh: src/cpu/checker/exec_context.hh: src/cpu/cpu_exec_context.cc: src/cpu/cpu_exec_context.hh: src/cpu/cpuevent.cc: src/cpu/cpuevent.hh: src/cpu/exetrace.hh: src/cpu/intr_control.cc: src/cpu/memtest/memtest.hh: src/cpu/o3/alpha_cpu.hh: src/cpu/o3/alpha_cpu_impl.hh: src/cpu/o3/alpha_dyn_inst_impl.hh: src/cpu/o3/commit.hh: src/cpu/o3/commit_impl.hh: src/cpu/o3/cpu.cc: src/cpu/o3/cpu.hh: src/cpu/o3/fetch_impl.hh: src/cpu/o3/regfile.hh: src/cpu/o3/thread_state.hh: src/cpu/ozone/back_end.hh: src/cpu/ozone/cpu.hh: src/cpu/ozone/cpu_impl.hh: src/cpu/ozone/front_end.hh: src/cpu/ozone/front_end_impl.hh: src/cpu/ozone/inorder_back_end.hh: src/cpu/ozone/lw_back_end.hh: src/cpu/ozone/lw_back_end_impl.hh: src/cpu/ozone/lw_lsq.hh: src/cpu/ozone/lw_lsq_impl.hh: src/cpu/ozone/thread_state.hh: src/cpu/pc_event.cc: src/cpu/pc_event.hh: src/cpu/profile.cc: src/cpu/profile.hh: src/cpu/quiesce_event.cc: src/cpu/quiesce_event.hh: src/cpu/simple/atomic.cc: src/cpu/simple/base.cc: src/cpu/simple/base.hh: src/cpu/simple/timing.cc: src/cpu/static_inst.cc: src/cpu/static_inst.hh: src/cpu/thread_state.hh: src/dev/alpha_console.cc: src/dev/ns_gige.cc: src/dev/sinic.cc: src/dev/tsunami_cchip.cc: src/kern/kernel_stats.cc: src/kern/kernel_stats.hh: src/kern/linux/events.cc: src/kern/linux/events.hh: src/kern/system_events.cc: src/kern/system_events.hh: src/kern/tru64/dump_mbuf.cc: src/kern/tru64/tru64.hh: src/kern/tru64/tru64_events.cc: src/kern/tru64/tru64_events.hh: src/mem/vport.cc: src/mem/vport.hh: src/sim/faults.cc: src/sim/faults.hh: src/sim/process.cc: src/sim/process.hh: src/sim/pseudo_inst.cc: src/sim/pseudo_inst.hh: src/sim/syscall_emul.cc: src/sim/syscall_emul.hh: src/sim/system.cc: src/cpu/thread_context.hh: src/sim/system.hh: src/sim/vptr.hh: Change ExecContext to ThreadContext. --HG-- rename : src/cpu/exec_context.hh => src/cpu/thread_context.hh extra : convert_revision : 108bb97d15a114a565a2a6a23faa554f4e2fd77e
2006-06-06 23:32:21 +02:00
#include "cpu/thread_context.hh"
#include "debug/VtoPhys.hh"
#include "mem/port_proxy.hh"
split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 Setup fullsys build options Start to make fullsystem compile src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: RCS to BitKeeper src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add support for doing virtual to physical translation using the in-memory page table src/arch/sparc/vtophys.cc: a tad bit of error checking src/arch/sparc/vtophys.hh: Cleanup of full-system global variables, primarily in simple_cpu.cc, to allow multi-system simulations. (Multiple systems not yet yested though.) Also changes to build sim_smt in full-system mode (though with only SimpleCPU and not the full timing CPU for now). Still to do: minimize changes in SimpleCPU code between full-system and application modes... way too many ifdefs there. Much of the full-system stuff moved into SimpleCPU should be put in a new System object to allow multiprocessor simulations. Converted last remaining modules from C to C++ (mostly in /old). Renamed all .c files to .cc and a few .h files to .hh. Renamed architecture-specific files in arch/$TARGET from $TARGET.{cc,hh,def} to machine.{cc,hh,def} to get rid of pointless intermediate files in object directory. Split exo-specific definitions out of machine.hh into machine_exo.h. Specifics: In machine.def, null resource descriptors must be FUClamd_NA (and not NA) to pass C++ type checking. Enhanced error checking/reporting in bas src/arch/sparc/vtophys.cc: - Get rid of my String class, the Vector class, the bitvector class, and my doubly linked list class. - Convert tokenize, to_number (formerly StringToNumber) and eat_white to function on stl strings. - Change most cases of char * and const char * to string, or const string & - Some formatting and style nits, but not too many. src/arch/sparc/vtophys.cc: simplify src/arch/sparc/vtophys.cc: Renamed SimpleCPU::(read|write)_(byte|half|word|qword) to just read & write, overloaded on the type of the 'data' argument. Merged the full-system and non-full-system implementations of these eight original functions into two common template functions. To support this, also renamed (read|write)[1248] on memory_object and derivatives to just read & write, again overloaded on the type of the 'data' argument. Many of these functions could now be condensed into a few template functions (though with a level of indirection so that the interface can remain virtual). I did not do that though. src/arch/sparc/vtophys.cc: First pass at compiling with gcc 3.x. Lots of "std::" in header files, "using namespace std" in source files. (Note policy of not putting "using" statements in headers or before includes in sources.) Still not able to compile with gcc 3.2. Errors: - Can't create an ifstream from a file descriptor anymore (breaks IniFile). - "`class MSHR::MSHRegister' is private" errors in mshr.cc and prefetch_cache.cc: not clear why since it's in the public part of the class declaration. - cpu.cc:879: can't match a reference and 0 (specifically "no match for `bool ? SimObjectParam<PipeTrace*>& : int' operator") - pipetrace.cc: "invalid conversion from `int' to `std::_Ios_Fmtflags'" Warnings: - strstream now deprecated... needs some rewriting in sat_counter.hh and hybrid_pred.hh (need to get all that code out of the headers anyway) - trace.hh macro problem: cpp now says 'pasting "::" and "Event" does not give a valid preprocessing token' - major "implicit typename" issues in base/sized.hh src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Implement some interval statistics for full system mode. Create a callpal function that is called when a callpal occurs so it's easier to manipulate the statics. Rework the vtophys stuff to make it a bit cleaner. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Get rid of almost all old-style object names. This commit is equivalent to running the following script on the current head: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' \) -exec perl -pi -e '\ s/\bmemory_object\b(?!\.hh)/FunctionalMemory/g;\ s/\bvirtual_memory\b(?!\.hh)/VirtualMemory/g;\ s/\bmain_memory\b(?!\.hh)/MainMemory/g;\ s/\bphysical_memory\b(?!\.hh)/PhysicalMemory/g;\ s/\bspec_memory\b(?!\.hh)/SpeculativeMemory/g;\ s/\bMemObj\b(?!\.hh)/TimingMemObj/g;\ s/\bmemory_translation\b(?!\.hh)/AddressTranslator/g;\ s/\balpha_tlb\b(?!\.hh)/AlphaTlb/g;\ s/\balpha_itb\b(?!\.hh)/AlphaItb/g;\ s/\balpha_dtb\b(?!\.hh)/AlphaDtb/g;\ s/\bmemory_controller\b(?!\.hh)/MemoryController/g;\ s/\bstorebuffer_t\b(?!\.hh)/StoreBuffer/g;\ s/\bstorebuffer_entry_t\b(?!\.hh)/StoreBufferEntry/g;\ s/\bcreate_vector_t\b(?!\.hh)/CreateVector/g;\ s/\bcv_spec_state\b(?!\.hh)/CreateVecSpecState/g;\ s/\bspec_state_list\b(?!\.hh)/SpecStateList/g;\ s/\bdyn_inst_t\b(?!\.hh)/DynInst/g;' {} \; src/arch/sparc/vtophys.cc: since cprintf properly deals with 64-bit types, stop using FMT* as much as possible src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Change byte_t etc. to C99 standard int8_t etc. Other than old/host.h, all other changes were produced by this script: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' -o -name '*.c' -o -name '*.h' -o -name 'machine.def' \) -exec perl -pi -e '\ s/\bbyte_t\b(?!\.hh)/uint8_t/g;\ s/\bsbyte_t\b(?!\.hh)/int8_t/g;\ s/\bhalf_t\b(?!\.hh)/uint16_t/g;\ s/\bshalf_t\b(?!\.hh)/int16_t/g;\ s/\bword_t\b(?!\.hh)/uint32_t/g;\ s/\bsword_t\b(?!\.hh)/int32_t/g;\ s/\bqword_t\b(?!\.hh)/uint64_t/g;\ s/\bsqword_t\b(?!\.hh)/int64_t/g;\ s/\bbool_t\b(?!\.hh)/bool/g;\ s/\bdfloat_t\b(?!\.hh)/double/g;\ s/\bsfloat_t\b(?!\.hh)/float/g;' {} \; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add CVS Id tags src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Massive renaming to (almost) eliminate all md_* and MD_* names in preparation for total exorcism of machine.def. Most of the changes in this commit were performed with the following perl script (perl -pi <script> <files>). A small amount of manual fixup was needed to (mostly getting rid of the Addr typedefs in the various memory objects now that the former md_addr_t has that name). # rename machine-dependent types and constants (will be moving into ISA traits object) s/md_addr_t/Addr/g; s/md_intreg_t/IntReg/g; s/md_gpr_t/IntRegFile/g; s/md_fpreg_t/FloatReg/g; s/md_fpr_t/FloatRegFile/g; s/md_ctrlreg_t/MiscReg/g; s/md_ctrl_t/MiscRegFile/g; s/md_ipr_t/InternalProcReg/g; s/md_anyreg_t/AnyReg/g; s/md_inst_t/MachInst/g; s/regs_t/RegFile/g; # manually fix declaration in old/regs.h and a few forward decls s/struct RegFile/RegFile/g; s/MD_NUM_IREGS/NumIntRegs/g; s/MD_NUM_FREGS/NumFloatRegs/g; s/MD_NUM_CREGS/NumMiscRegs/g; s/MD_IPR_NUM/NumInternalProcRegs/g; s/MD_TOTAL_REGS/TotalNumRegs/g; s/MD_REG_ZERO/ZeroReg/g; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: New ISA description system. No more machine.def! Instructions are now decoded into StaticInst objects, and all static instruction properties (including execution behavior) are associated with those objects. Extended documentation in progress. Currently supports Alpha only; PISA will not compile. Use END_OF_MACHINE_DOT_DEF tag to extract previous version. src/arch/sparc/vtophys.cc: get rid of MD_IPR_foo and call it IPR_foo add some comments to describe what the various PALtemp registers do formatting src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: license src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: a little style src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add attribution to license. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Make include paths explicit. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: CopyData and CopyString moved from kernel.cc to vtophys.cc kernel.cc and kernel.hh moved to kern/tru64 src/arch/sparc/vtophys.hh: Include isa_traits.hh for Addr src/arch/sparc/vtophys.cc: formatting fixes src/arch/sparc/vtophys.cc: fix up vtophys to deal with translations if there is no ptbr, and to deal with PAL addresses add ptomem which is just a wrapper for dma_addr src/arch/sparc/vtophys.hh: add ptomem which is a wrapper for dma_addr with the same usage as vtomem src/arch/sparc/vtophys.cc: Fix to remote debugger while in PAL code src/arch/sparc/vtophys.cc: Remote an old hack that is now unnecessary src/arch/sparc/vtophys.cc: Removed buggy code that tries to fix PAL addresses (may cause problems while trying to debug in PAL code, but that should do this fix outside of vtophys) src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Updated Copyright src/arch/sparc/vtophys.cc: added back some code andrew removed and couldn't remember why. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: rename CopyData to CopyOut and implement CopyIn to copy data from the simulator into the simulatee src/arch/sparc/vtophys.cc: fixed a bad merge from linux<->tru64 src/arch/sparc/vtophys.cc: Check max address pal can be at so we don't do the wrong conversion if gdb asks for an unaligned access. src/arch/sparc/vtophys.cc: PGOFSET -> ALPHA_PGOFSET to avoid include file problems src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: in the arch/alpha directory we should use arch/alpha, not targetarch. sort includes while we're here. src/arch/sparc/vtophys.cc: use new constants, functions and structs to clean up the vtophys code. src/arch/sparc/vtophys.hh: Clean up a little bit and make the protypes match new changes. src/arch/sparc/vtophys.cc: deal with isa addition src/arch/sparc/vtophys.cc: shuffle files around for new directory structure src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Remove RCS Id string src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Update copyright dates and author list src/arch/sparc/vtophys.cc: Added a using directive for AlphaISA src/arch/sparc/vtophys.hh: Added the AlphaISA namespace specifier where needed src/arch/sparc/vtophys.hh: Made Addr a global type src/arch/sparc/vtophys.cc: Change access to the IPR to go through the XC. src/arch/sparc/vtophys.cc: Avoid directly accessing objects within the XC. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: fixed for new memory system put in namespace AlphaISA src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: Remove authors from copyright. src/arch/sparc/vtophys.cc: bk cp alpha/vtophys.cc sparc/vtophys.cc src/arch/sparc/vtophys.hh: bk cp alpha/vtophys.hh sparc/vtophys.hh src/arch/sparc/SConscript: remove fullsystem files that don't exist src/arch/sparc/isa_traits.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs src/arch/sparc/regfile.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 src/arch/sparc/system.cc: src/arch/sparc/system.hh: Add system level tick storage to make stick be syncronized across multiple processors src/arch/sparc/vtophys.hh: start to create a vtophys for Sparc src/base/loader/symtab.hh: Addr is defined in sim/host.hh --HG-- extra : convert_revision : ae4658e6bc2e2b51d7fb1c711d069ffe99e1377d
2006-05-29 22:53:47 +02:00
using namespace std;
namespace SparcISA {
Addr
vtophys(Addr vaddr)
split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 Setup fullsys build options Start to make fullsystem compile src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: RCS to BitKeeper src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add support for doing virtual to physical translation using the in-memory page table src/arch/sparc/vtophys.cc: a tad bit of error checking src/arch/sparc/vtophys.hh: Cleanup of full-system global variables, primarily in simple_cpu.cc, to allow multi-system simulations. (Multiple systems not yet yested though.) Also changes to build sim_smt in full-system mode (though with only SimpleCPU and not the full timing CPU for now). Still to do: minimize changes in SimpleCPU code between full-system and application modes... way too many ifdefs there. Much of the full-system stuff moved into SimpleCPU should be put in a new System object to allow multiprocessor simulations. Converted last remaining modules from C to C++ (mostly in /old). Renamed all .c files to .cc and a few .h files to .hh. Renamed architecture-specific files in arch/$TARGET from $TARGET.{cc,hh,def} to machine.{cc,hh,def} to get rid of pointless intermediate files in object directory. Split exo-specific definitions out of machine.hh into machine_exo.h. Specifics: In machine.def, null resource descriptors must be FUClamd_NA (and not NA) to pass C++ type checking. Enhanced error checking/reporting in bas src/arch/sparc/vtophys.cc: - Get rid of my String class, the Vector class, the bitvector class, and my doubly linked list class. - Convert tokenize, to_number (formerly StringToNumber) and eat_white to function on stl strings. - Change most cases of char * and const char * to string, or const string & - Some formatting and style nits, but not too many. src/arch/sparc/vtophys.cc: simplify src/arch/sparc/vtophys.cc: Renamed SimpleCPU::(read|write)_(byte|half|word|qword) to just read & write, overloaded on the type of the 'data' argument. Merged the full-system and non-full-system implementations of these eight original functions into two common template functions. To support this, also renamed (read|write)[1248] on memory_object and derivatives to just read & write, again overloaded on the type of the 'data' argument. Many of these functions could now be condensed into a few template functions (though with a level of indirection so that the interface can remain virtual). I did not do that though. src/arch/sparc/vtophys.cc: First pass at compiling with gcc 3.x. Lots of "std::" in header files, "using namespace std" in source files. (Note policy of not putting "using" statements in headers or before includes in sources.) Still not able to compile with gcc 3.2. Errors: - Can't create an ifstream from a file descriptor anymore (breaks IniFile). - "`class MSHR::MSHRegister' is private" errors in mshr.cc and prefetch_cache.cc: not clear why since it's in the public part of the class declaration. - cpu.cc:879: can't match a reference and 0 (specifically "no match for `bool ? SimObjectParam<PipeTrace*>& : int' operator") - pipetrace.cc: "invalid conversion from `int' to `std::_Ios_Fmtflags'" Warnings: - strstream now deprecated... needs some rewriting in sat_counter.hh and hybrid_pred.hh (need to get all that code out of the headers anyway) - trace.hh macro problem: cpp now says 'pasting "::" and "Event" does not give a valid preprocessing token' - major "implicit typename" issues in base/sized.hh src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Implement some interval statistics for full system mode. Create a callpal function that is called when a callpal occurs so it's easier to manipulate the statics. Rework the vtophys stuff to make it a bit cleaner. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Get rid of almost all old-style object names. This commit is equivalent to running the following script on the current head: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' \) -exec perl -pi -e '\ s/\bmemory_object\b(?!\.hh)/FunctionalMemory/g;\ s/\bvirtual_memory\b(?!\.hh)/VirtualMemory/g;\ s/\bmain_memory\b(?!\.hh)/MainMemory/g;\ s/\bphysical_memory\b(?!\.hh)/PhysicalMemory/g;\ s/\bspec_memory\b(?!\.hh)/SpeculativeMemory/g;\ s/\bMemObj\b(?!\.hh)/TimingMemObj/g;\ s/\bmemory_translation\b(?!\.hh)/AddressTranslator/g;\ s/\balpha_tlb\b(?!\.hh)/AlphaTlb/g;\ s/\balpha_itb\b(?!\.hh)/AlphaItb/g;\ s/\balpha_dtb\b(?!\.hh)/AlphaDtb/g;\ s/\bmemory_controller\b(?!\.hh)/MemoryController/g;\ s/\bstorebuffer_t\b(?!\.hh)/StoreBuffer/g;\ s/\bstorebuffer_entry_t\b(?!\.hh)/StoreBufferEntry/g;\ s/\bcreate_vector_t\b(?!\.hh)/CreateVector/g;\ s/\bcv_spec_state\b(?!\.hh)/CreateVecSpecState/g;\ s/\bspec_state_list\b(?!\.hh)/SpecStateList/g;\ s/\bdyn_inst_t\b(?!\.hh)/DynInst/g;' {} \; src/arch/sparc/vtophys.cc: since cprintf properly deals with 64-bit types, stop using FMT* as much as possible src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Change byte_t etc. to C99 standard int8_t etc. Other than old/host.h, all other changes were produced by this script: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' -o -name '*.c' -o -name '*.h' -o -name 'machine.def' \) -exec perl -pi -e '\ s/\bbyte_t\b(?!\.hh)/uint8_t/g;\ s/\bsbyte_t\b(?!\.hh)/int8_t/g;\ s/\bhalf_t\b(?!\.hh)/uint16_t/g;\ s/\bshalf_t\b(?!\.hh)/int16_t/g;\ s/\bword_t\b(?!\.hh)/uint32_t/g;\ s/\bsword_t\b(?!\.hh)/int32_t/g;\ s/\bqword_t\b(?!\.hh)/uint64_t/g;\ s/\bsqword_t\b(?!\.hh)/int64_t/g;\ s/\bbool_t\b(?!\.hh)/bool/g;\ s/\bdfloat_t\b(?!\.hh)/double/g;\ s/\bsfloat_t\b(?!\.hh)/float/g;' {} \; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add CVS Id tags src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Massive renaming to (almost) eliminate all md_* and MD_* names in preparation for total exorcism of machine.def. Most of the changes in this commit were performed with the following perl script (perl -pi <script> <files>). A small amount of manual fixup was needed to (mostly getting rid of the Addr typedefs in the various memory objects now that the former md_addr_t has that name). # rename machine-dependent types and constants (will be moving into ISA traits object) s/md_addr_t/Addr/g; s/md_intreg_t/IntReg/g; s/md_gpr_t/IntRegFile/g; s/md_fpreg_t/FloatReg/g; s/md_fpr_t/FloatRegFile/g; s/md_ctrlreg_t/MiscReg/g; s/md_ctrl_t/MiscRegFile/g; s/md_ipr_t/InternalProcReg/g; s/md_anyreg_t/AnyReg/g; s/md_inst_t/MachInst/g; s/regs_t/RegFile/g; # manually fix declaration in old/regs.h and a few forward decls s/struct RegFile/RegFile/g; s/MD_NUM_IREGS/NumIntRegs/g; s/MD_NUM_FREGS/NumFloatRegs/g; s/MD_NUM_CREGS/NumMiscRegs/g; s/MD_IPR_NUM/NumInternalProcRegs/g; s/MD_TOTAL_REGS/TotalNumRegs/g; s/MD_REG_ZERO/ZeroReg/g; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: New ISA description system. No more machine.def! Instructions are now decoded into StaticInst objects, and all static instruction properties (including execution behavior) are associated with those objects. Extended documentation in progress. Currently supports Alpha only; PISA will not compile. Use END_OF_MACHINE_DOT_DEF tag to extract previous version. src/arch/sparc/vtophys.cc: get rid of MD_IPR_foo and call it IPR_foo add some comments to describe what the various PALtemp registers do formatting src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: license src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: a little style src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add attribution to license. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Make include paths explicit. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: CopyData and CopyString moved from kernel.cc to vtophys.cc kernel.cc and kernel.hh moved to kern/tru64 src/arch/sparc/vtophys.hh: Include isa_traits.hh for Addr src/arch/sparc/vtophys.cc: formatting fixes src/arch/sparc/vtophys.cc: fix up vtophys to deal with translations if there is no ptbr, and to deal with PAL addresses add ptomem which is just a wrapper for dma_addr src/arch/sparc/vtophys.hh: add ptomem which is a wrapper for dma_addr with the same usage as vtomem src/arch/sparc/vtophys.cc: Fix to remote debugger while in PAL code src/arch/sparc/vtophys.cc: Remote an old hack that is now unnecessary src/arch/sparc/vtophys.cc: Removed buggy code that tries to fix PAL addresses (may cause problems while trying to debug in PAL code, but that should do this fix outside of vtophys) src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Updated Copyright src/arch/sparc/vtophys.cc: added back some code andrew removed and couldn't remember why. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: rename CopyData to CopyOut and implement CopyIn to copy data from the simulator into the simulatee src/arch/sparc/vtophys.cc: fixed a bad merge from linux<->tru64 src/arch/sparc/vtophys.cc: Check max address pal can be at so we don't do the wrong conversion if gdb asks for an unaligned access. src/arch/sparc/vtophys.cc: PGOFSET -> ALPHA_PGOFSET to avoid include file problems src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: in the arch/alpha directory we should use arch/alpha, not targetarch. sort includes while we're here. src/arch/sparc/vtophys.cc: use new constants, functions and structs to clean up the vtophys code. src/arch/sparc/vtophys.hh: Clean up a little bit and make the protypes match new changes. src/arch/sparc/vtophys.cc: deal with isa addition src/arch/sparc/vtophys.cc: shuffle files around for new directory structure src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Remove RCS Id string src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Update copyright dates and author list src/arch/sparc/vtophys.cc: Added a using directive for AlphaISA src/arch/sparc/vtophys.hh: Added the AlphaISA namespace specifier where needed src/arch/sparc/vtophys.hh: Made Addr a global type src/arch/sparc/vtophys.cc: Change access to the IPR to go through the XC. src/arch/sparc/vtophys.cc: Avoid directly accessing objects within the XC. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: fixed for new memory system put in namespace AlphaISA src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: Remove authors from copyright. src/arch/sparc/vtophys.cc: bk cp alpha/vtophys.cc sparc/vtophys.cc src/arch/sparc/vtophys.hh: bk cp alpha/vtophys.hh sparc/vtophys.hh src/arch/sparc/SConscript: remove fullsystem files that don't exist src/arch/sparc/isa_traits.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs src/arch/sparc/regfile.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 src/arch/sparc/system.cc: src/arch/sparc/system.hh: Add system level tick storage to make stick be syncronized across multiple processors src/arch/sparc/vtophys.hh: start to create a vtophys for Sparc src/base/loader/symtab.hh: Addr is defined in sim/host.hh --HG-- extra : convert_revision : ae4658e6bc2e2b51d7fb1c711d069ffe99e1377d
2006-05-29 22:53:47 +02:00
{
// In SPARC it's almost always impossible to turn a VA->PA w/o a
// context The only times we can kinda do it are if we have a
// SegKPM mapping and can find the real address in the tlb or we
// have a physical adddress already (beacuse we are looking at the
// hypervisor) Either case is rare, so we'll just panic.
panic("vtophys() without context on SPARC largly worthless\n");
M5_DUMMY_RETURN;
}
Addr
vtophys(ThreadContext *tc, Addr addr)
{
// Here we have many options and are really implementing something like
// a fill handler to find the address since there isn't a multilevel
// table for us to walk around.
//
// 1. We are currently hyperpriv, return the address unmodified
// 2. The mmu is off return(ra->pa)
// 3. We are currently priv, use ctx0* tsbs to find the page
// 4. We are not priv, use ctxN0* tsbs to find the page
// For all accesses we check the tlbs first since it's possible that
// long standing pages (e.g. locked kernel mappings) won't be in the tsb
uint64_t tlbdata = tc->readMiscRegNoEffect(MISCREG_TLB_DATA);
bool hpriv = bits(tlbdata,0,0);
// bool priv = bits(tlbdata,2,2);
bool addr_mask = bits(tlbdata,3,3);
bool data_real = !bits(tlbdata,5,5);
bool inst_real = !bits(tlbdata,4,4);
bool ctx_zero = bits(tlbdata,18,16) > 0;
int part_id = bits(tlbdata,15,8);
int pri_context = bits(tlbdata,47,32);
// int sec_context = bits(tlbdata,63,48);
split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 Setup fullsys build options Start to make fullsystem compile src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: RCS to BitKeeper src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add support for doing virtual to physical translation using the in-memory page table src/arch/sparc/vtophys.cc: a tad bit of error checking src/arch/sparc/vtophys.hh: Cleanup of full-system global variables, primarily in simple_cpu.cc, to allow multi-system simulations. (Multiple systems not yet yested though.) Also changes to build sim_smt in full-system mode (though with only SimpleCPU and not the full timing CPU for now). Still to do: minimize changes in SimpleCPU code between full-system and application modes... way too many ifdefs there. Much of the full-system stuff moved into SimpleCPU should be put in a new System object to allow multiprocessor simulations. Converted last remaining modules from C to C++ (mostly in /old). Renamed all .c files to .cc and a few .h files to .hh. Renamed architecture-specific files in arch/$TARGET from $TARGET.{cc,hh,def} to machine.{cc,hh,def} to get rid of pointless intermediate files in object directory. Split exo-specific definitions out of machine.hh into machine_exo.h. Specifics: In machine.def, null resource descriptors must be FUClamd_NA (and not NA) to pass C++ type checking. Enhanced error checking/reporting in bas src/arch/sparc/vtophys.cc: - Get rid of my String class, the Vector class, the bitvector class, and my doubly linked list class. - Convert tokenize, to_number (formerly StringToNumber) and eat_white to function on stl strings. - Change most cases of char * and const char * to string, or const string & - Some formatting and style nits, but not too many. src/arch/sparc/vtophys.cc: simplify src/arch/sparc/vtophys.cc: Renamed SimpleCPU::(read|write)_(byte|half|word|qword) to just read & write, overloaded on the type of the 'data' argument. Merged the full-system and non-full-system implementations of these eight original functions into two common template functions. To support this, also renamed (read|write)[1248] on memory_object and derivatives to just read & write, again overloaded on the type of the 'data' argument. Many of these functions could now be condensed into a few template functions (though with a level of indirection so that the interface can remain virtual). I did not do that though. src/arch/sparc/vtophys.cc: First pass at compiling with gcc 3.x. Lots of "std::" in header files, "using namespace std" in source files. (Note policy of not putting "using" statements in headers or before includes in sources.) Still not able to compile with gcc 3.2. Errors: - Can't create an ifstream from a file descriptor anymore (breaks IniFile). - "`class MSHR::MSHRegister' is private" errors in mshr.cc and prefetch_cache.cc: not clear why since it's in the public part of the class declaration. - cpu.cc:879: can't match a reference and 0 (specifically "no match for `bool ? SimObjectParam<PipeTrace*>& : int' operator") - pipetrace.cc: "invalid conversion from `int' to `std::_Ios_Fmtflags'" Warnings: - strstream now deprecated... needs some rewriting in sat_counter.hh and hybrid_pred.hh (need to get all that code out of the headers anyway) - trace.hh macro problem: cpp now says 'pasting "::" and "Event" does not give a valid preprocessing token' - major "implicit typename" issues in base/sized.hh src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Implement some interval statistics for full system mode. Create a callpal function that is called when a callpal occurs so it's easier to manipulate the statics. Rework the vtophys stuff to make it a bit cleaner. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Get rid of almost all old-style object names. This commit is equivalent to running the following script on the current head: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' \) -exec perl -pi -e '\ s/\bmemory_object\b(?!\.hh)/FunctionalMemory/g;\ s/\bvirtual_memory\b(?!\.hh)/VirtualMemory/g;\ s/\bmain_memory\b(?!\.hh)/MainMemory/g;\ s/\bphysical_memory\b(?!\.hh)/PhysicalMemory/g;\ s/\bspec_memory\b(?!\.hh)/SpeculativeMemory/g;\ s/\bMemObj\b(?!\.hh)/TimingMemObj/g;\ s/\bmemory_translation\b(?!\.hh)/AddressTranslator/g;\ s/\balpha_tlb\b(?!\.hh)/AlphaTlb/g;\ s/\balpha_itb\b(?!\.hh)/AlphaItb/g;\ s/\balpha_dtb\b(?!\.hh)/AlphaDtb/g;\ s/\bmemory_controller\b(?!\.hh)/MemoryController/g;\ s/\bstorebuffer_t\b(?!\.hh)/StoreBuffer/g;\ s/\bstorebuffer_entry_t\b(?!\.hh)/StoreBufferEntry/g;\ s/\bcreate_vector_t\b(?!\.hh)/CreateVector/g;\ s/\bcv_spec_state\b(?!\.hh)/CreateVecSpecState/g;\ s/\bspec_state_list\b(?!\.hh)/SpecStateList/g;\ s/\bdyn_inst_t\b(?!\.hh)/DynInst/g;' {} \; src/arch/sparc/vtophys.cc: since cprintf properly deals with 64-bit types, stop using FMT* as much as possible src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Change byte_t etc. to C99 standard int8_t etc. Other than old/host.h, all other changes were produced by this script: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' -o -name '*.c' -o -name '*.h' -o -name 'machine.def' \) -exec perl -pi -e '\ s/\bbyte_t\b(?!\.hh)/uint8_t/g;\ s/\bsbyte_t\b(?!\.hh)/int8_t/g;\ s/\bhalf_t\b(?!\.hh)/uint16_t/g;\ s/\bshalf_t\b(?!\.hh)/int16_t/g;\ s/\bword_t\b(?!\.hh)/uint32_t/g;\ s/\bsword_t\b(?!\.hh)/int32_t/g;\ s/\bqword_t\b(?!\.hh)/uint64_t/g;\ s/\bsqword_t\b(?!\.hh)/int64_t/g;\ s/\bbool_t\b(?!\.hh)/bool/g;\ s/\bdfloat_t\b(?!\.hh)/double/g;\ s/\bsfloat_t\b(?!\.hh)/float/g;' {} \; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add CVS Id tags src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Massive renaming to (almost) eliminate all md_* and MD_* names in preparation for total exorcism of machine.def. Most of the changes in this commit were performed with the following perl script (perl -pi <script> <files>). A small amount of manual fixup was needed to (mostly getting rid of the Addr typedefs in the various memory objects now that the former md_addr_t has that name). # rename machine-dependent types and constants (will be moving into ISA traits object) s/md_addr_t/Addr/g; s/md_intreg_t/IntReg/g; s/md_gpr_t/IntRegFile/g; s/md_fpreg_t/FloatReg/g; s/md_fpr_t/FloatRegFile/g; s/md_ctrlreg_t/MiscReg/g; s/md_ctrl_t/MiscRegFile/g; s/md_ipr_t/InternalProcReg/g; s/md_anyreg_t/AnyReg/g; s/md_inst_t/MachInst/g; s/regs_t/RegFile/g; # manually fix declaration in old/regs.h and a few forward decls s/struct RegFile/RegFile/g; s/MD_NUM_IREGS/NumIntRegs/g; s/MD_NUM_FREGS/NumFloatRegs/g; s/MD_NUM_CREGS/NumMiscRegs/g; s/MD_IPR_NUM/NumInternalProcRegs/g; s/MD_TOTAL_REGS/TotalNumRegs/g; s/MD_REG_ZERO/ZeroReg/g; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: New ISA description system. No more machine.def! Instructions are now decoded into StaticInst objects, and all static instruction properties (including execution behavior) are associated with those objects. Extended documentation in progress. Currently supports Alpha only; PISA will not compile. Use END_OF_MACHINE_DOT_DEF tag to extract previous version. src/arch/sparc/vtophys.cc: get rid of MD_IPR_foo and call it IPR_foo add some comments to describe what the various PALtemp registers do formatting src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: license src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: a little style src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add attribution to license. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Make include paths explicit. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: CopyData and CopyString moved from kernel.cc to vtophys.cc kernel.cc and kernel.hh moved to kern/tru64 src/arch/sparc/vtophys.hh: Include isa_traits.hh for Addr src/arch/sparc/vtophys.cc: formatting fixes src/arch/sparc/vtophys.cc: fix up vtophys to deal with translations if there is no ptbr, and to deal with PAL addresses add ptomem which is just a wrapper for dma_addr src/arch/sparc/vtophys.hh: add ptomem which is a wrapper for dma_addr with the same usage as vtomem src/arch/sparc/vtophys.cc: Fix to remote debugger while in PAL code src/arch/sparc/vtophys.cc: Remote an old hack that is now unnecessary src/arch/sparc/vtophys.cc: Removed buggy code that tries to fix PAL addresses (may cause problems while trying to debug in PAL code, but that should do this fix outside of vtophys) src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Updated Copyright src/arch/sparc/vtophys.cc: added back some code andrew removed and couldn't remember why. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: rename CopyData to CopyOut and implement CopyIn to copy data from the simulator into the simulatee src/arch/sparc/vtophys.cc: fixed a bad merge from linux<->tru64 src/arch/sparc/vtophys.cc: Check max address pal can be at so we don't do the wrong conversion if gdb asks for an unaligned access. src/arch/sparc/vtophys.cc: PGOFSET -> ALPHA_PGOFSET to avoid include file problems src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: in the arch/alpha directory we should use arch/alpha, not targetarch. sort includes while we're here. src/arch/sparc/vtophys.cc: use new constants, functions and structs to clean up the vtophys code. src/arch/sparc/vtophys.hh: Clean up a little bit and make the protypes match new changes. src/arch/sparc/vtophys.cc: deal with isa addition src/arch/sparc/vtophys.cc: shuffle files around for new directory structure src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Remove RCS Id string src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Update copyright dates and author list src/arch/sparc/vtophys.cc: Added a using directive for AlphaISA src/arch/sparc/vtophys.hh: Added the AlphaISA namespace specifier where needed src/arch/sparc/vtophys.hh: Made Addr a global type src/arch/sparc/vtophys.cc: Change access to the IPR to go through the XC. src/arch/sparc/vtophys.cc: Avoid directly accessing objects within the XC. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: fixed for new memory system put in namespace AlphaISA src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: Remove authors from copyright. src/arch/sparc/vtophys.cc: bk cp alpha/vtophys.cc sparc/vtophys.cc src/arch/sparc/vtophys.hh: bk cp alpha/vtophys.hh sparc/vtophys.hh src/arch/sparc/SConscript: remove fullsystem files that don't exist src/arch/sparc/isa_traits.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs src/arch/sparc/regfile.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 src/arch/sparc/system.cc: src/arch/sparc/system.hh: Add system level tick storage to make stick be syncronized across multiple processors src/arch/sparc/vtophys.hh: start to create a vtophys for Sparc src/base/loader/symtab.hh: Addr is defined in sim/host.hh --HG-- extra : convert_revision : ae4658e6bc2e2b51d7fb1c711d069ffe99e1377d
2006-05-29 22:53:47 +02:00
PortProxy &mem = tc->getPhysProxy();
TLB* itb = tc->getITBPtr();
TLB* dtb = tc->getDTBPtr();
TlbEntry* tbe;
PageTableEntry pte;
Addr tsbs[4];
Addr va_tag;
TteTag ttetag;
if (hpriv)
return addr;
if (addr_mask)
addr = addr & VAddrAMask;
tbe = dtb->lookup(addr, part_id, data_real, ctx_zero ? 0 : pri_context ,
false);
if (tbe)
goto foundtbe;
tbe = itb->lookup(addr, part_id, inst_real, ctx_zero ? 0 : pri_context,
false);
if (tbe)
goto foundtbe;
// We didn't find it in the tlbs, so lets look at the TSBs
dtb->GetTsbPtr(tc, addr, ctx_zero ? 0 : pri_context, tsbs);
va_tag = bits(addr, 63, 22);
for (int x = 0; x < 4; x++) {
ttetag = betoh(mem.read<uint64_t>(tsbs[x]));
if (ttetag.valid() && ttetag.va() == va_tag) {
uint64_t entry = mem.read<uint64_t>(tsbs[x]) + sizeof(uint64_t);
// I think it's sun4v at least!
pte.populate(betoh(entry), PageTableEntry::sun4v);
DPRINTF(VtoPhys, "Virtual(%#x)->Physical(%#x) found in TTE\n",
addr, pte.translate(addr));
goto foundpte;
}
split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 Setup fullsys build options Start to make fullsystem compile src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: RCS to BitKeeper src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add support for doing virtual to physical translation using the in-memory page table src/arch/sparc/vtophys.cc: a tad bit of error checking src/arch/sparc/vtophys.hh: Cleanup of full-system global variables, primarily in simple_cpu.cc, to allow multi-system simulations. (Multiple systems not yet yested though.) Also changes to build sim_smt in full-system mode (though with only SimpleCPU and not the full timing CPU for now). Still to do: minimize changes in SimpleCPU code between full-system and application modes... way too many ifdefs there. Much of the full-system stuff moved into SimpleCPU should be put in a new System object to allow multiprocessor simulations. Converted last remaining modules from C to C++ (mostly in /old). Renamed all .c files to .cc and a few .h files to .hh. Renamed architecture-specific files in arch/$TARGET from $TARGET.{cc,hh,def} to machine.{cc,hh,def} to get rid of pointless intermediate files in object directory. Split exo-specific definitions out of machine.hh into machine_exo.h. Specifics: In machine.def, null resource descriptors must be FUClamd_NA (and not NA) to pass C++ type checking. Enhanced error checking/reporting in bas src/arch/sparc/vtophys.cc: - Get rid of my String class, the Vector class, the bitvector class, and my doubly linked list class. - Convert tokenize, to_number (formerly StringToNumber) and eat_white to function on stl strings. - Change most cases of char * and const char * to string, or const string & - Some formatting and style nits, but not too many. src/arch/sparc/vtophys.cc: simplify src/arch/sparc/vtophys.cc: Renamed SimpleCPU::(read|write)_(byte|half|word|qword) to just read & write, overloaded on the type of the 'data' argument. Merged the full-system and non-full-system implementations of these eight original functions into two common template functions. To support this, also renamed (read|write)[1248] on memory_object and derivatives to just read & write, again overloaded on the type of the 'data' argument. Many of these functions could now be condensed into a few template functions (though with a level of indirection so that the interface can remain virtual). I did not do that though. src/arch/sparc/vtophys.cc: First pass at compiling with gcc 3.x. Lots of "std::" in header files, "using namespace std" in source files. (Note policy of not putting "using" statements in headers or before includes in sources.) Still not able to compile with gcc 3.2. Errors: - Can't create an ifstream from a file descriptor anymore (breaks IniFile). - "`class MSHR::MSHRegister' is private" errors in mshr.cc and prefetch_cache.cc: not clear why since it's in the public part of the class declaration. - cpu.cc:879: can't match a reference and 0 (specifically "no match for `bool ? SimObjectParam<PipeTrace*>& : int' operator") - pipetrace.cc: "invalid conversion from `int' to `std::_Ios_Fmtflags'" Warnings: - strstream now deprecated... needs some rewriting in sat_counter.hh and hybrid_pred.hh (need to get all that code out of the headers anyway) - trace.hh macro problem: cpp now says 'pasting "::" and "Event" does not give a valid preprocessing token' - major "implicit typename" issues in base/sized.hh src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Implement some interval statistics for full system mode. Create a callpal function that is called when a callpal occurs so it's easier to manipulate the statics. Rework the vtophys stuff to make it a bit cleaner. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Get rid of almost all old-style object names. This commit is equivalent to running the following script on the current head: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' \) -exec perl -pi -e '\ s/\bmemory_object\b(?!\.hh)/FunctionalMemory/g;\ s/\bvirtual_memory\b(?!\.hh)/VirtualMemory/g;\ s/\bmain_memory\b(?!\.hh)/MainMemory/g;\ s/\bphysical_memory\b(?!\.hh)/PhysicalMemory/g;\ s/\bspec_memory\b(?!\.hh)/SpeculativeMemory/g;\ s/\bMemObj\b(?!\.hh)/TimingMemObj/g;\ s/\bmemory_translation\b(?!\.hh)/AddressTranslator/g;\ s/\balpha_tlb\b(?!\.hh)/AlphaTlb/g;\ s/\balpha_itb\b(?!\.hh)/AlphaItb/g;\ s/\balpha_dtb\b(?!\.hh)/AlphaDtb/g;\ s/\bmemory_controller\b(?!\.hh)/MemoryController/g;\ s/\bstorebuffer_t\b(?!\.hh)/StoreBuffer/g;\ s/\bstorebuffer_entry_t\b(?!\.hh)/StoreBufferEntry/g;\ s/\bcreate_vector_t\b(?!\.hh)/CreateVector/g;\ s/\bcv_spec_state\b(?!\.hh)/CreateVecSpecState/g;\ s/\bspec_state_list\b(?!\.hh)/SpecStateList/g;\ s/\bdyn_inst_t\b(?!\.hh)/DynInst/g;' {} \; src/arch/sparc/vtophys.cc: since cprintf properly deals with 64-bit types, stop using FMT* as much as possible src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Change byte_t etc. to C99 standard int8_t etc. Other than old/host.h, all other changes were produced by this script: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' -o -name '*.c' -o -name '*.h' -o -name 'machine.def' \) -exec perl -pi -e '\ s/\bbyte_t\b(?!\.hh)/uint8_t/g;\ s/\bsbyte_t\b(?!\.hh)/int8_t/g;\ s/\bhalf_t\b(?!\.hh)/uint16_t/g;\ s/\bshalf_t\b(?!\.hh)/int16_t/g;\ s/\bword_t\b(?!\.hh)/uint32_t/g;\ s/\bsword_t\b(?!\.hh)/int32_t/g;\ s/\bqword_t\b(?!\.hh)/uint64_t/g;\ s/\bsqword_t\b(?!\.hh)/int64_t/g;\ s/\bbool_t\b(?!\.hh)/bool/g;\ s/\bdfloat_t\b(?!\.hh)/double/g;\ s/\bsfloat_t\b(?!\.hh)/float/g;' {} \; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add CVS Id tags src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Massive renaming to (almost) eliminate all md_* and MD_* names in preparation for total exorcism of machine.def. Most of the changes in this commit were performed with the following perl script (perl -pi <script> <files>). A small amount of manual fixup was needed to (mostly getting rid of the Addr typedefs in the various memory objects now that the former md_addr_t has that name). # rename machine-dependent types and constants (will be moving into ISA traits object) s/md_addr_t/Addr/g; s/md_intreg_t/IntReg/g; s/md_gpr_t/IntRegFile/g; s/md_fpreg_t/FloatReg/g; s/md_fpr_t/FloatRegFile/g; s/md_ctrlreg_t/MiscReg/g; s/md_ctrl_t/MiscRegFile/g; s/md_ipr_t/InternalProcReg/g; s/md_anyreg_t/AnyReg/g; s/md_inst_t/MachInst/g; s/regs_t/RegFile/g; # manually fix declaration in old/regs.h and a few forward decls s/struct RegFile/RegFile/g; s/MD_NUM_IREGS/NumIntRegs/g; s/MD_NUM_FREGS/NumFloatRegs/g; s/MD_NUM_CREGS/NumMiscRegs/g; s/MD_IPR_NUM/NumInternalProcRegs/g; s/MD_TOTAL_REGS/TotalNumRegs/g; s/MD_REG_ZERO/ZeroReg/g; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: New ISA description system. No more machine.def! Instructions are now decoded into StaticInst objects, and all static instruction properties (including execution behavior) are associated with those objects. Extended documentation in progress. Currently supports Alpha only; PISA will not compile. Use END_OF_MACHINE_DOT_DEF tag to extract previous version. src/arch/sparc/vtophys.cc: get rid of MD_IPR_foo and call it IPR_foo add some comments to describe what the various PALtemp registers do formatting src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: license src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: a little style src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add attribution to license. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Make include paths explicit. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: CopyData and CopyString moved from kernel.cc to vtophys.cc kernel.cc and kernel.hh moved to kern/tru64 src/arch/sparc/vtophys.hh: Include isa_traits.hh for Addr src/arch/sparc/vtophys.cc: formatting fixes src/arch/sparc/vtophys.cc: fix up vtophys to deal with translations if there is no ptbr, and to deal with PAL addresses add ptomem which is just a wrapper for dma_addr src/arch/sparc/vtophys.hh: add ptomem which is a wrapper for dma_addr with the same usage as vtomem src/arch/sparc/vtophys.cc: Fix to remote debugger while in PAL code src/arch/sparc/vtophys.cc: Remote an old hack that is now unnecessary src/arch/sparc/vtophys.cc: Removed buggy code that tries to fix PAL addresses (may cause problems while trying to debug in PAL code, but that should do this fix outside of vtophys) src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Updated Copyright src/arch/sparc/vtophys.cc: added back some code andrew removed and couldn't remember why. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: rename CopyData to CopyOut and implement CopyIn to copy data from the simulator into the simulatee src/arch/sparc/vtophys.cc: fixed a bad merge from linux<->tru64 src/arch/sparc/vtophys.cc: Check max address pal can be at so we don't do the wrong conversion if gdb asks for an unaligned access. src/arch/sparc/vtophys.cc: PGOFSET -> ALPHA_PGOFSET to avoid include file problems src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: in the arch/alpha directory we should use arch/alpha, not targetarch. sort includes while we're here. src/arch/sparc/vtophys.cc: use new constants, functions and structs to clean up the vtophys code. src/arch/sparc/vtophys.hh: Clean up a little bit and make the protypes match new changes. src/arch/sparc/vtophys.cc: deal with isa addition src/arch/sparc/vtophys.cc: shuffle files around for new directory structure src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Remove RCS Id string src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Update copyright dates and author list src/arch/sparc/vtophys.cc: Added a using directive for AlphaISA src/arch/sparc/vtophys.hh: Added the AlphaISA namespace specifier where needed src/arch/sparc/vtophys.hh: Made Addr a global type src/arch/sparc/vtophys.cc: Change access to the IPR to go through the XC. src/arch/sparc/vtophys.cc: Avoid directly accessing objects within the XC. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: fixed for new memory system put in namespace AlphaISA src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: Remove authors from copyright. src/arch/sparc/vtophys.cc: bk cp alpha/vtophys.cc sparc/vtophys.cc src/arch/sparc/vtophys.hh: bk cp alpha/vtophys.hh sparc/vtophys.hh src/arch/sparc/SConscript: remove fullsystem files that don't exist src/arch/sparc/isa_traits.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs src/arch/sparc/regfile.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 src/arch/sparc/system.cc: src/arch/sparc/system.hh: Add system level tick storage to make stick be syncronized across multiple processors src/arch/sparc/vtophys.hh: start to create a vtophys for Sparc src/base/loader/symtab.hh: Addr is defined in sim/host.hh --HG-- extra : convert_revision : ae4658e6bc2e2b51d7fb1c711d069ffe99e1377d
2006-05-29 22:53:47 +02:00
}
panic("couldn't translate %#x\n", addr);
foundtbe:
pte = tbe->pte;
DPRINTF(VtoPhys, "Virtual(%#x)->Physical(%#x) found in TLB\n", addr,
pte.translate(addr));
foundpte:
return pte.translate(addr);
split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 Setup fullsys build options Start to make fullsystem compile src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: RCS to BitKeeper src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add support for doing virtual to physical translation using the in-memory page table src/arch/sparc/vtophys.cc: a tad bit of error checking src/arch/sparc/vtophys.hh: Cleanup of full-system global variables, primarily in simple_cpu.cc, to allow multi-system simulations. (Multiple systems not yet yested though.) Also changes to build sim_smt in full-system mode (though with only SimpleCPU and not the full timing CPU for now). Still to do: minimize changes in SimpleCPU code between full-system and application modes... way too many ifdefs there. Much of the full-system stuff moved into SimpleCPU should be put in a new System object to allow multiprocessor simulations. Converted last remaining modules from C to C++ (mostly in /old). Renamed all .c files to .cc and a few .h files to .hh. Renamed architecture-specific files in arch/$TARGET from $TARGET.{cc,hh,def} to machine.{cc,hh,def} to get rid of pointless intermediate files in object directory. Split exo-specific definitions out of machine.hh into machine_exo.h. Specifics: In machine.def, null resource descriptors must be FUClamd_NA (and not NA) to pass C++ type checking. Enhanced error checking/reporting in bas src/arch/sparc/vtophys.cc: - Get rid of my String class, the Vector class, the bitvector class, and my doubly linked list class. - Convert tokenize, to_number (formerly StringToNumber) and eat_white to function on stl strings. - Change most cases of char * and const char * to string, or const string & - Some formatting and style nits, but not too many. src/arch/sparc/vtophys.cc: simplify src/arch/sparc/vtophys.cc: Renamed SimpleCPU::(read|write)_(byte|half|word|qword) to just read & write, overloaded on the type of the 'data' argument. Merged the full-system and non-full-system implementations of these eight original functions into two common template functions. To support this, also renamed (read|write)[1248] on memory_object and derivatives to just read & write, again overloaded on the type of the 'data' argument. Many of these functions could now be condensed into a few template functions (though with a level of indirection so that the interface can remain virtual). I did not do that though. src/arch/sparc/vtophys.cc: First pass at compiling with gcc 3.x. Lots of "std::" in header files, "using namespace std" in source files. (Note policy of not putting "using" statements in headers or before includes in sources.) Still not able to compile with gcc 3.2. Errors: - Can't create an ifstream from a file descriptor anymore (breaks IniFile). - "`class MSHR::MSHRegister' is private" errors in mshr.cc and prefetch_cache.cc: not clear why since it's in the public part of the class declaration. - cpu.cc:879: can't match a reference and 0 (specifically "no match for `bool ? SimObjectParam<PipeTrace*>& : int' operator") - pipetrace.cc: "invalid conversion from `int' to `std::_Ios_Fmtflags'" Warnings: - strstream now deprecated... needs some rewriting in sat_counter.hh and hybrid_pred.hh (need to get all that code out of the headers anyway) - trace.hh macro problem: cpp now says 'pasting "::" and "Event" does not give a valid preprocessing token' - major "implicit typename" issues in base/sized.hh src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Implement some interval statistics for full system mode. Create a callpal function that is called when a callpal occurs so it's easier to manipulate the statics. Rework the vtophys stuff to make it a bit cleaner. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Get rid of almost all old-style object names. This commit is equivalent to running the following script on the current head: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' \) -exec perl -pi -e '\ s/\bmemory_object\b(?!\.hh)/FunctionalMemory/g;\ s/\bvirtual_memory\b(?!\.hh)/VirtualMemory/g;\ s/\bmain_memory\b(?!\.hh)/MainMemory/g;\ s/\bphysical_memory\b(?!\.hh)/PhysicalMemory/g;\ s/\bspec_memory\b(?!\.hh)/SpeculativeMemory/g;\ s/\bMemObj\b(?!\.hh)/TimingMemObj/g;\ s/\bmemory_translation\b(?!\.hh)/AddressTranslator/g;\ s/\balpha_tlb\b(?!\.hh)/AlphaTlb/g;\ s/\balpha_itb\b(?!\.hh)/AlphaItb/g;\ s/\balpha_dtb\b(?!\.hh)/AlphaDtb/g;\ s/\bmemory_controller\b(?!\.hh)/MemoryController/g;\ s/\bstorebuffer_t\b(?!\.hh)/StoreBuffer/g;\ s/\bstorebuffer_entry_t\b(?!\.hh)/StoreBufferEntry/g;\ s/\bcreate_vector_t\b(?!\.hh)/CreateVector/g;\ s/\bcv_spec_state\b(?!\.hh)/CreateVecSpecState/g;\ s/\bspec_state_list\b(?!\.hh)/SpecStateList/g;\ s/\bdyn_inst_t\b(?!\.hh)/DynInst/g;' {} \; src/arch/sparc/vtophys.cc: since cprintf properly deals with 64-bit types, stop using FMT* as much as possible src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Change byte_t etc. to C99 standard int8_t etc. Other than old/host.h, all other changes were produced by this script: #! /bin/sh find \( -name '*.cc' -o -name '*.hh' -o -name '*.c' -o -name '*.h' -o -name 'machine.def' \) -exec perl -pi -e '\ s/\bbyte_t\b(?!\.hh)/uint8_t/g;\ s/\bsbyte_t\b(?!\.hh)/int8_t/g;\ s/\bhalf_t\b(?!\.hh)/uint16_t/g;\ s/\bshalf_t\b(?!\.hh)/int16_t/g;\ s/\bword_t\b(?!\.hh)/uint32_t/g;\ s/\bsword_t\b(?!\.hh)/int32_t/g;\ s/\bqword_t\b(?!\.hh)/uint64_t/g;\ s/\bsqword_t\b(?!\.hh)/int64_t/g;\ s/\bbool_t\b(?!\.hh)/bool/g;\ s/\bdfloat_t\b(?!\.hh)/double/g;\ s/\bsfloat_t\b(?!\.hh)/float/g;' {} \; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add CVS Id tags src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Massive renaming to (almost) eliminate all md_* and MD_* names in preparation for total exorcism of machine.def. Most of the changes in this commit were performed with the following perl script (perl -pi <script> <files>). A small amount of manual fixup was needed to (mostly getting rid of the Addr typedefs in the various memory objects now that the former md_addr_t has that name). # rename machine-dependent types and constants (will be moving into ISA traits object) s/md_addr_t/Addr/g; s/md_intreg_t/IntReg/g; s/md_gpr_t/IntRegFile/g; s/md_fpreg_t/FloatReg/g; s/md_fpr_t/FloatRegFile/g; s/md_ctrlreg_t/MiscReg/g; s/md_ctrl_t/MiscRegFile/g; s/md_ipr_t/InternalProcReg/g; s/md_anyreg_t/AnyReg/g; s/md_inst_t/MachInst/g; s/regs_t/RegFile/g; # manually fix declaration in old/regs.h and a few forward decls s/struct RegFile/RegFile/g; s/MD_NUM_IREGS/NumIntRegs/g; s/MD_NUM_FREGS/NumFloatRegs/g; s/MD_NUM_CREGS/NumMiscRegs/g; s/MD_IPR_NUM/NumInternalProcRegs/g; s/MD_TOTAL_REGS/TotalNumRegs/g; s/MD_REG_ZERO/ZeroReg/g; src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: New ISA description system. No more machine.def! Instructions are now decoded into StaticInst objects, and all static instruction properties (including execution behavior) are associated with those objects. Extended documentation in progress. Currently supports Alpha only; PISA will not compile. Use END_OF_MACHINE_DOT_DEF tag to extract previous version. src/arch/sparc/vtophys.cc: get rid of MD_IPR_foo and call it IPR_foo add some comments to describe what the various PALtemp registers do formatting src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: license src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: a little style src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Add attribution to license. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Make include paths explicit. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: CopyData and CopyString moved from kernel.cc to vtophys.cc kernel.cc and kernel.hh moved to kern/tru64 src/arch/sparc/vtophys.hh: Include isa_traits.hh for Addr src/arch/sparc/vtophys.cc: formatting fixes src/arch/sparc/vtophys.cc: fix up vtophys to deal with translations if there is no ptbr, and to deal with PAL addresses add ptomem which is just a wrapper for dma_addr src/arch/sparc/vtophys.hh: add ptomem which is a wrapper for dma_addr with the same usage as vtomem src/arch/sparc/vtophys.cc: Fix to remote debugger while in PAL code src/arch/sparc/vtophys.cc: Remote an old hack that is now unnecessary src/arch/sparc/vtophys.cc: Removed buggy code that tries to fix PAL addresses (may cause problems while trying to debug in PAL code, but that should do this fix outside of vtophys) src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Updated Copyright src/arch/sparc/vtophys.cc: added back some code andrew removed and couldn't remember why. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: rename CopyData to CopyOut and implement CopyIn to copy data from the simulator into the simulatee src/arch/sparc/vtophys.cc: fixed a bad merge from linux<->tru64 src/arch/sparc/vtophys.cc: Check max address pal can be at so we don't do the wrong conversion if gdb asks for an unaligned access. src/arch/sparc/vtophys.cc: PGOFSET -> ALPHA_PGOFSET to avoid include file problems src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: in the arch/alpha directory we should use arch/alpha, not targetarch. sort includes while we're here. src/arch/sparc/vtophys.cc: use new constants, functions and structs to clean up the vtophys code. src/arch/sparc/vtophys.hh: Clean up a little bit and make the protypes match new changes. src/arch/sparc/vtophys.cc: deal with isa addition src/arch/sparc/vtophys.cc: shuffle files around for new directory structure src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Remove RCS Id string src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: Update copyright dates and author list src/arch/sparc/vtophys.cc: Added a using directive for AlphaISA src/arch/sparc/vtophys.hh: Added the AlphaISA namespace specifier where needed src/arch/sparc/vtophys.hh: Made Addr a global type src/arch/sparc/vtophys.cc: Change access to the IPR to go through the XC. src/arch/sparc/vtophys.cc: Avoid directly accessing objects within the XC. src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: fixed for new memory system put in namespace AlphaISA src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: Remove authors from copyright. src/arch/sparc/vtophys.cc: bk cp alpha/vtophys.cc sparc/vtophys.cc src/arch/sparc/vtophys.hh: bk cp alpha/vtophys.hh sparc/vtophys.hh src/arch/sparc/SConscript: remove fullsystem files that don't exist src/arch/sparc/isa_traits.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs src/arch/sparc/regfile.hh: split off fullsystem and se iprs into two functions to remove lots of #ifs setup all initialization stuff for UA2005 src/arch/sparc/system.cc: src/arch/sparc/system.hh: Add system level tick storage to make stick be syncronized across multiple processors src/arch/sparc/vtophys.hh: start to create a vtophys for Sparc src/base/loader/symtab.hh: Addr is defined in sim/host.hh --HG-- extra : convert_revision : ae4658e6bc2e2b51d7fb1c711d069ffe99e1377d
2006-05-29 22:53:47 +02:00
}
} // namespace SparcISA