URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [gdb-5.0/] [sim/] [ppc/] [README] - Rev 1765
Compare with Previous | Blame | View Log
PSIM 1.0.1 - Model of the PowerPC EnvironmentsCopyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.----------------------------------------------------------------------PSIM is a program written in extended ANSI-C that implements aninstruction level simulation of the PowerPC environment. It is freelyavailable in source code form under the terms of the GNU GeneralPublic License (version 2 or later).The PowerPC Architecture is described as having three levels ofcompliance:UEA - User Environment ArchitectureVEA - Virtual Environment ArchitectureOEA - Operating Environment ArchitecturePSIM both implements all three levels of the PowerPC and includes (foreach level) a corresponding simulated run-time environment.In addition, PSIM, to the execution unit level, models the performanceof most of the current PowerPC implementations (contributed by MichaelMeissner). This detailed performance monitoring (unlike many othersimulators) resulting in only a relatively marginal reduction in thesimulators performance.A description of how to build PSIM is contained in the file:ftp://ftp.ci.com.au/pub/psim/INSTALLor ftp://cambridge.cygnus.com/pub/psim/INSTALLwhile an overview of how to use PSIM is in:ftp://ftp.ci.com.au/pub/psim/RUNor ftp://cambridge.cygnus.com/pub/psim/RUNThis file is found in:ftp://ftp.ci.com.au/pub/psim/READMEor ftp://cambridge.cygnus.com/pub/psim/READMEThanks goes firstly to:Corinthian Engineering Pty LtdCygnus SupportHighland Logic Pty Ltdwho provided the resources needed for making this software availableon the Internet.More importantly I'd like to thank the following individuals who eachcontributed in their own unique way:Allen Briggs, Bett Koch, David Edelsohn, Gordon Irlam,Michael Meissner, Bob Mercier, Richard Perini, Dale Rahn,Richard Stallman, Mitchele WalkerAndrew CagneyFeb, 1995----------------------------------------------------------------------What features does PSIM include?Monitoring and modelingPSIM includes (thanks to Michael Meissner)a detailed model of most of the PowerPCimplementations to the functional unit level.SMPThe PowerPC ISA defines SMP synchronizing instructions.This simulator implements a limited, but functional,subset of the PowerPC synchronization instructionsbehaviour. Programs that restrict their synchronizationprimitives to those that work with this functionalsub-set (eg P() and V()) are able to run on the SMPversion of PSIM.People intending to use this system should studythe code implementing the lwarx instruction.ENDIAN SUPPORTPSIM implements the PowerPC's big and little (xorendian) modes and correctly simulates code thatswitches between these two modes.In addition, psim can model a true little-endianmachine.ISA (Instruction Set Architecture) modelsPSIM includes a model of the UEA, VEA and OEA. Thisincludes the time base registers (VEA) and HTABand BATS (OEA).In addition, a preliminary model of the 64 bitPowerPC architecture is implemented.IO HardwarePSIM's internals are based around the conceptof a Device Tree. This tree intentionallyresembles that of the Device Tree found inOpenBoot firmware. PSIM is flexible enoughto allow the user to fully configure this devicetree (and consequently the hardware model) atrun time.Run-time environments:PSIM's UEA model includes emulation for BSDbased UNIX system calls.PSIM's OEA model includes emulation of either:o OpenBoot client interfaceo MOTO's BUG interface.Floating pointPreliminary support for floating point is included.Who would be interested in PSIM?o the curiousUsing psim, gdb, gcc and binutils the curioususer can construct an environment that allowsthem to play with PowerPC Environment withoutthe need for real hardware.o the analystPSIM includes many (contributed) monitoringfeatures which (unlike many other simulators)do not come with a great penalty in performance.Thus the performance analyst is able to usethis simulator to analyse the performance ofthe system under test.If PSIM doesn't monitor a components of interest,the source code is freely available, and hencethere is no hinderance to changing thingsto meet a specific analysts needs.o the serious SW developerPSIM models all three levels of the PowerPCArchitecture: UEA, VEA and OEA. Further,the internal design is such that PSIM canbe extended to support additional requirements.What performance analysis measurements can PSIM perform?Below is the output from a recent analysis run(contributed by Michael Meissner):For the following program:longsimple_rand (){static unsigned long seed = 47114711;unsigned long this = seed * 1103515245 + 12345;seed = this;/* cut-cut-cut - see the file RUN.psim */}Here is the current output generated with the -I switch on a P90(the compiler used is the development version of GCC with a newscheduler replacing the old one):CPU #1 executed 41,994 AND instructions.CPU #1 executed 519,785 AND Immediate instructions....CPU #1 executed 1 System Call instruction.CPU #1 executed 207,746 XOR instructions.CPU #1 executed 23,740,856 cycles.CPU #1 executed 10,242,780 stalls waiting for data.CPU #1 executed 1 stall waiting for a function unit....CPU #1 executed 3,136,229 branch functional unit instructions.CPU #1 executed 16,949,396 instructions that were accounted for in timing info.CPU #1 executed 871,920 data reads.CPU #1 executed 971,926 data writes.CPU #1 executed 221 icache misses.CPU #1 executed 16,949,396 instructions in total.Simulator speed was 250,731 instructions/secondWhat motivated PSIM?As an idea, psim was first discussed seriously during mid1994. At that time its main objectives were:o good performanceMany simulators loose out by only providinga binary interface to the internals. Thisinterface eventually becomes a bottle neckin the simulators performance.It was intended that PSIM would avoid thisproblem by giving the user access to thefull source code.Further, by exploiting the power of moderncompilers it was hoped that PSIM would achievegood performance with out having to compromiseits internal design.o practical portabilityRather than try to be portable to everyC compiler on every platform, it was decidedthat PSIM would restrict its self to supportingANSI compilers that included the extensionof a long long type.GCC is one such compiler, consequently PSIMshould be portable to any machine running GCC.o flexibility in its designPSIM should allow the user to select thefeatures required and customise the buildaccordingly. By having the source code,the compiler is able to eliminate any unused features of the simulator.After all, let the compiler do the work.o SMPA model that allowed the simulation ofSMP platforms with out the large overheadoften encountered with such models.PSIM achieves each of these objectives.Is PSIM PowerPC Platform (PPCP) (nee CHRP) Compliant?No.Among other things it does not have an Apple ROM socket.Could PSIM be extended so that it models a CHRP machine?Yes.PSIM has been designed with the CHRP spec in mind. To modela CHRP desktop the following would need to be added:o An apple ROM socket :-)o Model of each of the desktop IO deviceso An OpenPIC device.o RTAS (Run Time Abstraction Services).o A fully populated device tree.Is the source code available?Yes.The source code to PSIM is available under the terms ofthe GNU Public Licence. This allows you to distributethe source code for free but with certain conditions.See the file:ftp://archie.au/gnu/COPYINGFor details of the terms and conditions.Where do I send bugs or report problems?There is a mailing list (subscribe through majordomo@ci.com.au) at:powerpc-psim@ci.com.auIf I get the ftp archive updated I post a note to that mailing list.In addition your welcome to send bugs or problems either to me or tothat e-mail list.This list currently averages zero articles a day.Does PSIM have any limitations or problems?PSIM can't run rs6000/AIX binaries - At present PSIM can onlysimulate static executables. Since an AIX executable isnever static, PSIM is unable to simulate its execution.PSIM is still under development - consequently there are goingto be bugs.See the file BUGS (included in the distribution) for anyother outstanding issues.
