; --------------------------------------------------------------------------------
; @Title: Example for target setup using the virtual machine (VM)
; @Description: 
; The virtual machine allows to virtually execute code that would
; normally run from the ROM and initialize various parts of the CPU.
; This allows to setup the chip select registers to allow debugging
; of code in the external RAM.
; @Chip: MPC8260
; @Keywords: 
; @Author: -
; @Copyright: (c) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: startvm.cmm 7493 2014-07-29 13:25:08Z hstainl $

// Choose CPU type
 SYStem.CPU MPC8260

// Take base address from target
 SYStem.Option BASE AUTO

// Bring up CPU
 SYStem.Up

// Enable virtual machine
 VM.ON
// Load bootstrap loader into virtual memory
 Data.LOAD.Elf bootrom_uncmp /VM
// Copy loader to execution addres in ROM
 Data.COPY vm:0x00600000++0xffff vm:0xff800000
// Relocate symbols for code that runs from ROM
 sYmbol.RELOCate.shift C:(0xff800000-0x00600000) P:0x00600000--P:(compressedEntry-1)
// Set PC to start of ROM code
 Register.Set PC 0xff800100
// Execute bootstrap code till the SIU and MEMC are initialized
 Go.direct romStart
// Turn virtual machine off
 VM.OFF

// Set base for the peripherals to the final value
 SYStem.Option BASE 0x1F000000

 ENDDO
