📄 install
字号:
Set the size of the cache used to hold decoded instructions.Psim executes instructions in two separate steps: o instruction fetch/decode o instruction executionFor a given instruction, the first stage need only be executed once(the first time the instruction is encountered) while the second stagemust be executed every time the program `executes' that instruction.Exploiting this, PSIM can maintain a cache of decoded instructions.It will then use the decoded instruction from the cache in preferenceto fetching/decoding the real instruction from memory.Ex: defaultBecause this feature is normally such a big win, it is enabled bydefault (with the cache size set to 1024 entries).The 1024 entries equals 4096 bytes (or one page) of instructions.Larger caches can be used but with caution - PSIM does not check foraddress aliasing within its instruction cache.Ex: disable the cacheThere may be cases (for instance where the cache has a low hit rate)where the psim performs better with no instruction cache. For suchsituations, the cache can be disabled vis: --disable-sim-icache.--enable-sim-inline[=module]Specify the inlining of one or more modules.Many architectures (in particular the x86) suffer from a largefunction call overhead. By eliminating function calls (throughinlining of functions) a large performance gain can be achieved.In PSIM, modules are inlined in one of two possible ways. Somemodules (such as the byte swapping code) can be inlined into anymodule that calls them. Other modules, due to complexinterdependencies, are only inlined as a group when compiling theexternal interface module psim.c.Ex: defaultBy default the modules endian (handle be/le), bits (manipulatebit-fields within words), cpu (the processor object) and events(timers) are inlined in any module that calls them. This gives areasonable performance gain with little additional compilationoverhead.Ex: recommended --enable-sim-inlineAssuming you machine is reasonably well configured, this option ishighly recommended. On the x86 several orders of magnitudeimprovement in performance is possible.Ex: fine tuningThe file std-config.h contains a detailed description of how theinlining works. Individual modules can be inlined by specifying them.For if you have a very large cache the model module could be inlinedwith: --enable-sim-inline=MODEL--enable-sim-bswap(x86 specific) Use the i486/P5/P6 byte swap instruction.PSIM contains generic byte swapping code. For the x86 (P[4-6]) PSIMcan be built so that it uses the bswap instruction instead of relyingon the compiler to generate byte swap code.Ex: defaultBy default, when compiling with GCC-2 on an i486/P5/P6 the bswapinstruction is used.--enable-sim-endian=endianSpecify the byte order of the target.By default, PSIM is able to execute both big and little endianexecutables. As a consequence, every byte swap routine includes atest to see if the byte swap is really needed. By specifying the byteorder of the target (and the host below) the need for this test can beeliminated.Clearly setting the byte order of the target is only useful when knownbefore hand.--enable-sim-hostendain=endAs above but for the host.Normally this option should not be needed. configure (autoconf) shoulddetermine the byte order of the host automatically. However if forsome reason there is a problem, this option can be used to overrideautoconf.--enable-sim-smp=nSet the maximum number of processors that PSIM can model.Psim can model (with small limitation discussed else where) amulti-processor PowerPC environment. While the overhead ofco-ordinating the execution of a number of processors is relativelysmall it is still significant when compared to handling only oneprocessor.This option only sets the maximum number of processors that can besimulated. The number active during a given simulation run usdetermined at run time.Ex: defaultBy default 5 processors are configured but only one is enabled.Additional processors can be enabled with the runtime option: -o '/openprom/options/smp 5'Ex: recommendedUnless you intend studying multi-processor systems there is little reason forhaving PSIM configured with SMP support. Specifying: --disable-sim-smpor --enable-sim-smp=0will eliminate any SMP such as: for (cpu = 0; cpu < nr_cpus; cpu++) ...--enable-sim-xor-endian=nSet the byte-size of the bus involved in the PowerPC's xor endian byteswapping.The PowerPC's implementation of BE/LE mode is different to what aprogrammer may first expect. The details of this implementation arediscussed at length in PowerPC documentation.Ex: defaultBy default this is configured with a value of 8 (the bus size of most60x processors).Ex: recommendedUnless you are expecting to test/debug PowerPC be/le switching codethis option is of little use and should be disabled: --disable-sim-xor-endian--enable-sim-bitsize=nSpecify the bit size (32/64) of the PowerPC to be modelled.Note: By default 32 is specified. The implementation of the 64bitarchitecture is still under development.--enable-sim-hostbitsize=32|64As above but for the host.NOTE: Psim has yet to be built on a 64bit host.--enable-sim-env=envHardwire the PowerPC environment being modelled (user, virtual oroperating).The PowerPC architecture defines three different levels of compliance to itsarchitectural specification. These environments are discussed in detail inPowerPC publications. user - normal user programs virtual - an extension of the user environment (includes timers) operating - kernel codeEx: defaultBy default all three environments are supported.Ex: recommendedIf you only intend running psim with user (or operating) code thenPSIM should be configured accordingly. For user code, it eliminates:support for timers and events and redundant VM calls.--enable-sim-timebaseEnable/disable the time base register.The PowerPC architecture (virtual environment) includes a time baseregister. Maintaining that register incurs an overhead inperformance that can be eliminated by eliminating time-base registersupport.Ex: defaultNormally this option is not used. Instead --enable-sim-env (above) usused to disable/enable features such as the timebase register.--enable-sim-alignment=alignControl the PowerPC's memory access alignment restrictions.The PowerPC in LE mode only allows memory transfers of a correctlyaligned size/address. The above option controls how misalignedaccesses are handled. strict All accesses must be correctly aligned nonstrict Unaligned access allowed (the are split into a number of aligned accesses).Ex: defaultUnless otherwise specified PSIM will auto configure a BE program toallow miss-aligned accesses while a LE program will not.Ex: 604eThe recently announced 604e processor allows miss-aligned accesses in bothBE and LE modes. If modeling the 604e then you should specify: --enable-sim-alignment=nonstrict--enable-sim-traceInclude code to trace PSIM's internal progress (also controlled by the-t option).Checking to see if a trace message should be output slows down asimulation. Disabling this option (--disable-sim-trace) eliminatescompletely that code.--enable-sim-assertInclude the code that checks the correctness of parts of PSIM.Eliminating such code (--disable-sim-assert) eliminates internalconsistency tests and their overhead.--enable-sim-reserved-bitsInclude code to check that the reserved fields of the instruction arezero.The PowerPC architecture defines certain fields of some instructionsas reserved (`/'). By default, for each instruction, PSIM will checkthe reserved fields causing an invalid instruction exception if afield is invalid. Disabling this option eliminates this test. Thisis at the slight risk of PSIM treating an invalid instruction asvalid.--enable-sim-floatInclude support for hardware floating point.--enable-sim-monitor=monInclude support for basic instruction counting.If you are not interested in the performance of either you program orthe simulator then you can disable this option.--enable-sim-model=whichHardwire the processor that will be used as a reference when modelingexecution units.--enable-sim-default-model=whichSpecify the processor of choice for the execution unit model.--enable-sim-model-issueInclude support for the modeling of processor execution units. ----------------------------------------------------------------------TYPICAL CONFIGURATION OPTIONS: VEA CODE ONLY: Here of note are: o ramp up the compiler options (some of the below are P5 specific). o disable anything not used CC=gcc ./configure \ --prefix=/applications/psim \ --target=powerpc-unknown-eabi \ --enable-sim-powerpc \ --enable-sim-warnings \ --enable-sim-inline \ --disable-sim-smp \ --enable-sim-duplicate \ --enable-sim-endian=big \ --disable-sim-xor-endian \ --enable-sim-env=user \ --disable-sim-reserved-bits \ --disable-sim-assert \ --disable-sim-trace \ --enable-sim-cflags='-g0,-O2,-fno-strength-reduce,-fomit-frame-pointer' OEA CODE ONLY: The key configuration changes are: o turn off the instruction cache. The overhead of flushing and reloading it is greater than not having a cache. o use a switch statement (ppc-opcode-flat) for the instruction decode and then (-O3) fully inline all functions. o --enable-sim-warnings is not present. GCC (2.7.2) gets confused by the instruction decode table generated by igen (contains a perfect switch) and, as a consequence, generates a bogus warning. CC=gcc ./configure \ --prefix=/applications/psim \ --target=powerpc-unknown-eabi \ --enable-sim-powerpc \ --enable-sim-inline \ --disable-sim-smp \ --enable-sim-duplicate \ --enable-sim-endian=big \ --disable-sim-xor-endian \ --enable-sim-env=operating \ --disable-sim-reserved-bits \ --disable-sim-assert \ --disable-sim-trace \ --enable-sim-opcode=ppc-opcode-flat \ --disable-sim-icache \ --enable-sim-cflags='-g0,-O3,-fno-strength-reduce,-fomit-frame-pointer'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -