© 2003 Xilinx, Inc. All Rights Reserved Address Management.

Slides:



Advertisements
Similar presentations
Programs in Memory Bryce Boe 2012/08/29 CS32, Summer 2012 B.
Advertisements

Code Composer Department of Electrical and Computer Engineering
UEE072HM Linking HLL and ALP An example on ARM. Embedded and Real-Time Systems We will mainly look at embedded systems –Systems which have the computer.
CSE 340 Computer Architecture Spring 2014 MIPS ISA Review
Program Development Tools The GNU (GNU’s Not Unix) Toolchain The GNU toolchain has played a vital role in the development of the Linux kernel, BSD, and.
© 2003 Xilinx, Inc. All Rights Reserved Debugging.
Embedded Systems Programming Introduction to cross development techniques.
Configurable System-on-Chip: Xilinx EDK
The Xilinx EDK Toolset: Xilinx Platform Studio (XPS) Building a base system platform.
Embedded Software Development. Page 2 Hardware and software architectures Hardware and software are intimately related: software doesn’t run without hardware;
Lecture 9: SHELL PROGRAMMING (continued) Creating shell scripts!
Lab4 Writing Basic Software Applications Lab: MicroBlaze.
Lab5 Advanced Software Writing Lab : MicroBlaze. for EDK 6.3i1 Objectives Utilize the OPB timer. Assign an interrupt handler to the OBP timer. Develop.
Lecture 7 Lecture 7: Hardware/Software Systems on the XUP Board ECE 412: Microcomputer Laboratory.
Software Development and Software Loading in Embedded Systems.
Renesas Technology America Inc. 1 M16C/Tiny SKP Tutorial 2 Creating A New Project Using HEW4.
© 2005 Xilinx, Inc. All Rights Reserved This material exempt per Department of Commerce license exception TSU Software Development and Debugging Using.
OBJECT MODULE FORMATS. The object module format we have employed as an educational device is called OMF (relocatable object format). It’s one of the earliest.
The GreenHills Tool Chain
System Calls 1.
Operating System Chapter 7. Memory Management Lynn Choi School of Electrical Engineering.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Enabling the ARM Learning in INDIA ARM DEVELOPMENT TOOL SETUP.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
CSNB334 Advanced Operating Systems 5. Memory Management
© 2004 Xilinx, Inc. All Rights Reserved EDK Overview.
再谈 EDK 赵峰 上海交通大学微电子学院. Knowledge Check What is the MHS file? What does the PlatGen tool do? What tool is used to place executable code in an FPGA block.
Virtual & Dynamic Memory Management Summer 2014 COMP 2130 Intro Computer Systems Computing Science Thompson Rivers University.
Introduction: Exploiting Linux. Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend,
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
ECS642U Embedded Systems Digital I/O William Marsh.
Objective At the conclusion of this chapter you will be able to:
Topic 2d High-Level languages and Systems Software
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
LAB1 Summary Zhaofeng SJTU.SOME. Embedded Software Tools CPU Logic Design Tools I/O FPGA Memory Logic Design Tools FPGA + Memory + IP + High Speed IO.
1 EDK 7.1 Tutorial -- SystemACE and EthernetMAC on Avnet Virtex II pro Development Boards Chia-Tien Dan Lo Department of Computer Science University of.
Part A Presentation Implementation of DSP Algorithm on SoC Student : Einat Tevel Supervisor : Isaschar Walter Accompanying engineer : Emilia Burlak The.
© 2003 Xilinx, Inc. All Rights Reserved System Simulation.
© 2004 Xilinx, Inc. All Rights Reserved Embedded Processor Design.
© 2004 Xilinx, Inc. All Rights Reserved EDK Overview.
This material exempt per Department of Commerce license exception TSU Address Management.
© 2004 Xilinx, Inc. All Rights Reserved Adding a Processor System to an FPGA Design.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course explains how to use section setting and memory.
AT91 C-startup. 2 For reasons of modularity and portability most application code for an embedded application is written in C The application entry point.
Introduction to Assembly Programming Computer Architecture.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This course explains how to use Mapview, a utility program for the.
1 Virtual Memory (I). 2 Outline Physical and Virtual Addressing Address Spaces VM as a Tool for Caching VM as a Tool for Memory Management VM as a Tool.
* ========.cmd file======== * */ MEMORY { SDRAM : origin = 0x , len = 0x } SECTIONS {.vectors > SDRAM.text > SDRAM.bss > SDRAM.cinit.
LECTURE 3 Translation. PROCESS MEMORY There are four general areas of memory in a process. The text area contains the instructions for the application.
Operating Systems A Biswas, Dept. of Information Technology.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
Lecture 3 Translation.
Muen Policy & Toolchain
CSNB334 Advanced Operating Systems 5. Memory Management
MCF5249 Software Examples Bootable example code for the MCF5249
Software Development with uMPS
Simple Hardware Design
Von Neumann model - Memory
Topic 2e High-Level languages and Systems Software
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Computer Organization & Compilation Process
Von Neumann model - Memory
Operating System Chapter 7. Memory Management
Embedded System Development Lecture 13 4/11/2007
Lab4 Writing Basic Software Applications Lab: MicroBlaze
Computer System Laboratory
Computer Organization & Compilation Process
8051 Development System Details
Presentation transcript:

© 2003 Xilinx, Inc. All Rights Reserved Address Management

Address Management © 2003 Xilinx, Inc. All Rights Reserved Objectives After completing this module, you will be able to: Describe address management for the IBM PowerPC  and MicroBlaze  processors Define a system address space Define an advanced user address space Understand the object file sections Understand what a linker script does

Address Management © 2003 Xilinx, Inc. All Rights Reserved Outline Address Management System Address Space Advanced User Address Space Object File Sections Linker Scripts

Address Management © 2003 Xilinx, Inc. All Rights Reserved Address Management Embedded processor design requires you to manage the following: – Address map for the peripherals – Location of the application code in the memory space BRAM External memory Memory requirements for your programs are based on the following: – The amount of memory required for storing the instructions – The amount of memory required for storing the data associated with the program

Address Management © 2003 Xilinx, Inc. All Rights Reserved MicroBlaze Processor Memory and peripherals – MicroBlaze  processor uses 32-bit addresses Special addresses – MicroBlaze systems must have user- writable memory from 0x through 0x BRAM size limits – The amount of BRAM memory that can be used is limited to the device limitations – The largest supported BRAM memory size for Virtex  and VirtexE devices is 16 kilobytes; for Virtex  -II, it is 64 kilobytes 0x0000_0000 0x0000_0008 0x0000_0010 0xFFFF_FFFF 0x0000_0018 Reset Address Exception Address Interrupt Address LMB Memory OPB Memory Peripherals

Address Management © 2003 Xilinx, Inc. All Rights Reserved PowerPC Processor Memory and peripherals – PPC405 uses 32-bit addresses Special addresses – Every PowerPC  system should have the boot section starting at 0xFFFFFFFC Default linker options – Program space occupies a contiguous address space from 0xFFFF0000 to 0xFFFFFFFF – Stack size: 4 KB – Heap size: 4 KB 0x0000_0000 0xFFFF_0000 0xFFFF_FFFC Peripherals PLB/OPB Memory Reset Address

Address Management © 2003 Xilinx, Inc. All Rights Reserved Outline Address Management System Address Space Advanced User Address Space Object File Sections Linker Scripts

Address Management © 2003 Xilinx, Inc. All Rights Reserved System Address Space System with an executable only(no debug) – The C-run-time file crt0.o is linked with the user program – The system file crt0.o starts at address location 0x0, immediately followed by the user’s program crt0.o main program 0x

Address Management © 2003 Xilinx, Inc. All Rights Reserved System Address Space System with debugging support (xmdstub) – With systems that require debug support, xmdstub must be downloaded at address location 0x – The C-run-time file crt1.o is bundled with the user program and is placed at address 0x , the default location main program 0x xmdstub crt1.0

Address Management © 2003 Xilinx, Inc. All Rights Reserved Outline Address Management System Address Space Advanced User Address Space Object File Sections Linker Scripts

Address Management © 2003 Xilinx, Inc. All Rights Reserved Advanced User Address Space Different base address, contiguous user address space – The user program can run from any memory PLB, OCM, OPB, or LMB – To execute a program from any address location other than default, you must provide the compiler gcc with the following option: -Wl,--defsym,_TEXT_START_ADDR=start_addr – You can easily enter this option in the S/W Settings dialog

Address Management © 2003 Xilinx, Inc. All Rights Reserved Advanced User Address Space Different base address, non-contiguous user address space – You can place different components of your program in different memories For example, on PowerPC  systems, you can keep your code on instruction cache memory and the data on ZBT memory – Non-contiguous executables that represent the application must be created – To do this, a linker script must be used

Address Management © 2003 Xilinx, Inc. All Rights Reserved Outline Address Management System Address Space Advanced User Address Space Object File Sections Linker Scripts

Address Management © 2003 Xilinx, Inc. All Rights Reserved Object File Sections What is an object file? – An object file is an assembled piece of code Machine language: li r31,0 = 0x3BE – Constant data – There may be references to external objects that are defined elsewhere – This file may contain debugging information

Address Management © 2003 Xilinx, Inc. All Rights Reserved Object File Sections.text.rodata.sdata2.data.sdata.sbss.bss Text section Read-only data section Small read-only data section (less than eight bytes) Read-write data section Small read-write data section Small uninitialized data section Uninitialized data section

Address Management © 2003 Xilinx, Inc. All Rights Reserved Sections Example int ram_data[10] = {0,1,2,3,4,5,6,7,8,9}; /* DATA */ const int rom_data[10] = {9,8,7,6,5,4,3,2,1}; /* RODATA */ int I; /* BSS */ main(){... I = I + 10; /* TEXT */... }

Address Management © 2003 Xilinx, Inc. All Rights Reserved Outline Address Management System Address Space Advanced User Address Space Object File Sections Linker Scripts

Address Management © 2003 Xilinx, Inc. All Rights Reserved Linker Script Linker script – Controls the linking process – Maps the code and data to a specified memory space – Sets the entry point to the executable – Reserves space for the stack Required if the design contains a discontinuous memory space GNU GCC linker scripts will not work for the WindRiver Diab  compiler

Address Management © 2003 Xilinx, Inc. All Rights Reserved Linker and Locator Flows.text1.data1.bss1.bss2.data2.text2 foo1.o foo2.o Link.text.data.bss 0xFFFF 0xF000 0xEFFF 0xEF00 0x0000 0x1FFF 0x2000 0xEEFF Locate Merged Output Sections Unused Executable Image Code Uninitialized data Initialized data

Address Management © 2003 Xilinx, Inc. All Rights Reserved Linker Script for the MicroBlaze processor Required to control how the program and data are targeted to LMB, OPB, or extended memory Provide a linker script to the mb-gcc compiler Linker script defines the layout and the start address of each of the sections

Address Management © 2003 Xilinx, Inc. All Rights Reserved Linker Script Limitations Allocate space in the.bss section for stack and heap – Set _heap variable to the beginning of this section – Set _stack variable to the end of this section The.sdata and.sbss sections must be contiguous – Set _SDA_BASE variable points to the center of this section – Set _SDA_BASE must be aligned on a word boundary If you are not using xmdstub, ensure that crt0 is loaded in memory at 0 The __sbss_start, _sbss_end, __bss_start, and __bss_end variables are defined to the start and end of the.sbss and.bss sections Ensure that the.bss and.common sections are contiguous – The crt0.s assumes a single.bss section. If not, then you must define your own crt function

Address Management © 2003 Xilinx, Inc. All Rights Reserved MicroBlaze Processor Script Example STACKSIZE = 4k; MEMORY { LMB : ORIGIN = 0x0, LENGTH = 0x1000 OPB : ORIGIN = 0x8000, LENGTH = 0x5000 } SECTIONS {.text : { *(.text) } > lmb. = ALIGN(4); _heap =.;.bss : { _STACK_SIZE = 0x400;. += _STACK_SIZE;. = ALIGN(4); } > lmb _stack =.;. = ALIGN(4);.rodata : { *(.rodata) } > lmb.data : { *(.data) } > lmb }

Address Management © 2003 Xilinx, Inc. All Rights Reserved Linker Script for the PowerPC Processor Required to control how the program and data are targeted to PLB, OPB, OCM, or extended memory Provide a linker script to the powerpc-eabi-gcc compiler The linker script defines the layout and the start address of each of the sections

Address Management © 2003 Xilinx, Inc. All Rights Reserved Linker Script Limitations Allocate space in the.bss section for the stack and the heap – The stack and the heap must be placed together at the end of the.bss section Ensure that: – The following variables are set to define each section:.sdata: __SDATA_START__, __SDATA_END__.sdata2: __SDATA2_START__, __SDATA2_END__.sbss2: __SBSS2_START__, __SBSS2_END__ – The.sdata and.sbss sections are contiguous – The.boot section starts at 0xFFFFFFFC – The.boot0 section is within a ±24-bit address space of the _boot label – The.vector section is aligned on a 64K boundary

Address Management © 2003 Xilinx, Inc. All Rights Reserved Linker Script Example STACKSIZE = 4k; MEMORY { ddr : ORIGIN = 0x , LENGTH = 32m sram : ORIGIN = 0x , LENGTH = 2m flash : ORIGIN = 0x , LENGTH = 32m bram : ORIGIN = 0xffff8000, LENGTH = 32k - 4 boot : ORIGIN = 0xfffffffc, LENGTH = 4 } SECTIONS {.text : { *(.text) } > bram.boot : { *(.boot) } > boot.data : { *(.data) *(.got2) *(.rodata) *(.fixup)} > bram.bss : { *(.bss) } > bram __bss_start = ADDR(.bss); __bss_end = ADDR(.bss) + SIZEOF(.bss); }

Address Management © 2003 Xilinx, Inc. All Rights Reserved Sections Command This is where most of the work takes place Output sections are named, and the input sections are grouped and linked together into the output sections Example: Explanation: –. text is thhe name of the output section – { *(.text) *.(init)} includes all input sections named text and init from the object files being linked – > bram locates the.text output section in the next available memory in the BRAM area.text : { *(.text) *(.init) } > bram

Address Management © 2003 Xilinx, Inc. All Rights Reserved Skills Check

Address Management © 2003 Xilinx, Inc. All Rights Reserved Review Questions When do you need to use a linker script? What does a linker script do? List some of the MicroBlaze  processor address space restrictions

Address Management © 2003 Xilinx, Inc. All Rights Reserved Answers When do you need to use a linker script? – When you have software developed in multiple source files and the compiled object code needs to be placed in different memory structures or in non-standard configurations What does a linker script do? – The linker script controls the placement of the object code, data, stack, and heap in specific memory locations List some of the MicroBlaze  processor address space restrictions – Allocate space in the.bss section for stack and heap – Set the _heap variable to the beginning of this section – Set the _stack variable to the end of this section –.sdata and.sbss sections must be contiguous – If you are not using xmdstub, ensure that crt0 is loaded in memory at 0 – Must have writable memory from 0x to 0x

Address Management © 2003 Xilinx, Inc. All Rights Reserved Where Can I Learn More? Tool documentation – Embedded System Tools Guide  Address Management – Embedded Systems Tools Guide  Stand-Alone Board Support Package – Embedded Systems Tools Guide  GNU Compiler Tools Support website – EDK Home Page: support.xilinx.com/edk