; -------------------------------------------------------------------------------- ; @Title: GNU C Example for SRAM ; @Description: ; Simple C application for PowerPC targets ; compiled with GNU GCC compiler ; running from SRAM ; ; Supported Targets: ; LA-3854 "Bolero3M Adapter" with MPC5646C ; Freescale/ST XPC564A_176QFPMINI-MODULE (xPC564AEVBKIT) ; with SPC564A80-V2 / MPC5644-V2 ("Andorra") ; TRACE32 Instruction Set Simulator ; Other MPC56xx targets (except e200z0 cores, which need VLE code) ; ; @Author: HLG ; @Board: LA-3854; xPC564AEVBKIT; Simulator ; @Chip: MPC5644A, MPC5646C, SPC564A80 ; @Keywords: 3M, Andorra, GCC ; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only ; -------------------------------------------------------------------------------- ; $Id: demo_sram.cmm 14488 2019-06-07 08:46:24Z hlohn $ WinCLEAR FDX.RESet AREA.CLEAR SYStem.RESet Break.RESet SNOOPer.RESet FramePOS ,,,,Maximized SETUP.TabSize 4. SYStem.CPU MPC55XX SYStem.BdmClock 1.MHz SYStem.Option IMASKASM ON SYStem.Option IMASKHLL ON SYStem.Option WATCHDOG OFF SYStem.Option DisMode AUTO IF SIMULATOR() ( SYStem.CPU MPC5646C SYStem.MemAccess CPU ) ELSE ( SYStem.MemAccess NEXUS ) IF SYStem.INSTANCE()<2 ; primary PowerView instance ? ( SYStem.Mode Up IF CPUIS(MPC560??)||CPUIS(SPC560???) ; e200z0 core ? ( IF OS.FILE("~~~~/../gnu-vle/demo_sram.cmm") DO "~~~~/../gnu-vle/demo_sram.cmm" ELSE PRINT %ERROR "Sorry, this example is not suitable for e200z0 cores." ENDDO ) Register.Init MMU.Set TLB1 1 0xC0000200 0x40000000 0x4000003F ; Map 16 KB of SRAM to logical address space MMU.Set TLB1 2 0xC0000500 0xFFF0000A 0xFFF0003F ; Map 1 MB of peripheral reg. to logical address space Data.Set EA:0x40000000++0x3FFF %Quad 0x55AA55AA55AA55AA ; Initialize 16 KB of internal SRAM Data.LOAD.Elf "~~~~/sieve.elf" /RelPATH Data.Set SPR:0x03f3 3 ; Enable (and invalidate) instruction cache (if available) ; Go main WAIT !RUN() IF (CPUIS(MPC564?C)||CPUIS(SPC56EC*))&&(SYStem.INSTANCE()==1) ; Bolero-3M in AMP configuration ? ( Data.Set EA:0x40003000--0x4001FFFF %Quad 0x55AA55AA55AA55AA ; Initialize further 116 KB of internal SRAM Data.Set _sp_background %Long 0x40020000 ; start secondary core LOCAL &SSCM &DPMBOOT &DPMKEY &SSCM=A:0xC3FD8000 &DPMBOOT=&SSCM+0x18 &DPMKEY=&SSCM+0x1C Data.Set &DPMBOOT %Long (ADDRESS.OFFSET(_start_background)|0x02) Data.Set &DPMKEY %Long 0x5AF0 Data.Set &DPMKEY %Long 0xA50F ) IF Analyzer() ( Analyzer.Init Analyzer.CLOCK 8.MHz Analyzer.Mode FIFO Analyzer.AutoArm ON ) ) ELSE ; secondary PowerView instance (for 2nd core) ? ( SYStem.CONFIG.CORE 2 1 SYStem.Mode Attach IF RUN() Break.direct Data.LOAD.Elf "~~~~/sieve.elf" /RelPATH /NoCODE ) SYnch.OFF IF INTERCOM.PORT()!=0 ; PowerView GUI was started with activated Intercom support ? ( LOCAL &port &port="localhost:"+FORMAT.Decimal(1,INTERCOM.PODPORT(SYStem.INSTANCE()%2)) ; Get UDP/IP socket of the other PowerView instance IF INTERCOM.PING(&port) ; other PowerView instance rechabel via Intercom ? SYnch.Connect &port ; activating synchronization via Intercom (requires Intercom setting in config.t32) SYnch.MasterGo ON SYnch.MasterBreak ON SYnch.MasterStep ON SYnch.SlaveGo ON SYnch.SlaveBreak ON SYnch.SlaveStep ON ) WinPOS 0% 0% 100% 50% List.auto WinPOS 0% 50% 36% 50% Var.Ref %Hex %Decimal WinPOS 36% 50% 28% 50% ,, 5. Frame.view /Args /Locals WinPOS 64% 50% 36% 50% Var.Watch Var.AddWatch flags; ast; IF SYStem.INSTANCE()==2 Var.AddWatch %E bcnt1; bcnt2; Mode.Hll ENDDO