Lab5 Advanced Software Writing Lab : MicroBlaze. for EDK 6.3i1 Objectives Utilize the OPB timer. Assign an interrupt handler to the OBP timer. Develop.

Slides:



Advertisements
Similar presentations
Professional Toolkit V2.0 C:\Presentations - SmartCafe_Prof_V2.0 - bsc page 1 Professional Toolkit 2.0.
Advertisements

Copyright © 2005 Rockwell Automation, Inc. All rights reserved. 1 Micro Logix 1100 RSLogix 500 LAB#2 Timing, Counting & Comparing.
Getting Started: Ansoft HFSS 8.0
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
The Xilinx EDK Toolset: Xilinx Platform Studio (XPS) Building a base system platform.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Students:Gilad Goldman Lior Kamran Supervisor:Mony Orbach Mid-Semester Presentation Spring 2005 Network Sniffer.
Hardware/software Interfacing. Page 2 Interrupt handling and using internal timer Two way for processor to accept external input: Waiting for input: Processor.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Using PDG with e2studio: Example
ECE Department: University of Massachusetts, Amherst Lab 1: Introduction to NIOS II Hardware Development.
Lab4 Writing Basic Software Applications Lab: MicroBlaze.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2006 Microsoft Corporation.
Check Disk. Disk Defragmenter Using Disk Defragmenter Effectively Run Disk Defragmenter when the computer will receive the least usage. Educate users.
Using Microsoft Outlook: Basics. Objectives Guided Tour of Outlook –Identification –Views Basics –Contacts –Folders –Web Access Q&A.
1. 2 LXU800 User’s Manual 1.Installation – Windows XP UI Features Introduction Data Connection & Disconnection.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Silicon Labs ToolStick Development Platform
Renesas Technology America Inc. 1 M16C/Tiny SKP Tutorial 2 Creating A New Project Using HEW4.
© 2003 Xilinx, Inc. All Rights Reserved Address Management.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
Installing the SAFARIODBC.EXE For use with Excel May 3, 2002.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
Welcome to State of Michigan Time & Expense Processing Employee Expense Modification With Advance Tutorial Brought to you by the Office of Financial Management.
NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware.
© 2004 Xilinx, Inc. All Rights Reserved EDK Overview.
This material exempt per Department of Commerce license exception TSU Writing Basic Software Applications Lab 4 Introduction.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 3: Customizing Document Elements.
HTML Concepts and Techniques Fourth Edition Project 12 Creating and Using XML Documents.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
Debugging an Application Lab. Build/Debug Process A start Load Closest Sample “debug” into MULTI editor Cut and Paste Changes into Sample Build Modified.
Training Guide for Inzalo SOP Users. This guide has been prepared to demonstrate the use of the Inzalo Intranet based SOP applications. The scope of this.
1 NORMA Lab. 7 Generating Reports More Display Options File: NORMA_Lab6.ppt. Author: T. Halpin. Last updated: 2009 June 9.
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.
Programmable Logic Training Course HDL Editor
© 2004 Xilinx, Inc. All Rights Reserved Embedded Processor Design.
© 2004 Xilinx, Inc. All Rights Reserved EDK Overview.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
This material exempt per Department of Commerce license exception TSU Address Management.
Renesas Technology America Inc. 1 M16C Seminars Lab 3 Creating Projects Using HEW4 14 March 2005 M16C Seminars Lab 3 Creating Projects Using HEW4 Last.
®® Microsoft Windows 7 for Power Users Tutorial 3 Managing Folders and Files.
© 2004 Xilinx, Inc. All Rights Reserved Adding a Processor System to an FPGA Design.
Indicator 13 Secondary Transition. Main Menu SPP13 has a navigation toolbar located at the top of each screen. If you use the toolbar to navigate to another.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
11 EENG 1920 Introduction to VHDL. 22 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Creating and Editing a Web Page
Teaching Digital Logic courses with Altera Technology
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the Project Generator function.
Virtual Machines Module 2. Objectives Define virtual machine Define common terminology Identify advantages and disadvantages Determine what software is.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
Design with Vivado IP Integrator
1 © 2004 Cisco Systems, Inc. All rights reserved. Session Number Presentation_ID Cisco Technical Support Seminar Using the Cisco Technical Support Website.
Copyright © 2007 by Pearson Education 1 UNIT 6A COMBINATIONAL CIRCUIT DESIGN WITH VHDL by Gregory L. Moss Click hyperlink below to select: Tutorial for.
WORKING OF SCHEDULER IN OS
Excel Tutorial 8 Developing an Excel Application
Lab 1: Using NIOS II processor for code execution on FPGA
About SharePoint Server 2007 My Sites
MicroEconomix 1500 RSLogix 500 LAB#2
Variables and Arithmetic Operations
Lab2 Adding IP to a Hardware Design Lab: MicroBlaze
Lab6 HW/SW System Debug Lab : MicroBlaze
Lab3 Adding Custom IP Lab: MicroBlaze
Lab4 Writing Basic Software Applications Lab: MicroBlaze
Software Setup & Validation
Planning a Group Policy Management and Implementation Strategy
Presentation transcript:

Lab5 Advanced Software Writing Lab : MicroBlaze

for EDK 6.3i1 Objectives Utilize the OPB timer. Assign an interrupt handler to the OBP timer. Develop an interrupt handler function. View how the appropriate functions can affect code size.

for EDK 6.3i2 Procedure This lab comprises several steps, including the writing of an interrupt handler used by the software application to access the OPB timer and interrupt controller. Below each general instruction for a given procedure, you will find accompanying step-by-step directions and illustrated figures providing more detail for performing the general instruction. If you feel confident about a specific instruction, feel free to skip the step-by-step directions and move on to the next general instruction in the procedure. Interrupt MicroBlaze LMB BRAM Cntlr BRAM LMB BRAM Cntlr MDMUART INTC Timer GPIO OPB Bus My IP PSB LEDs SWs 7Seg LED

for EDK 6.3i3 Opening the Project Create a lab5 folder in the X:\EDKLab\ directory. If you wish to continue with your completed design from lab4 then copy the contents of the lab4 folder into the lab5 folder

for EDK 6.3i4 Opening the Project Open XPS, click File → Open Project and browse to the project which is in the directory: X:\EDKLab\lab5, then click system.xmp to open the project

for EDK 6.3i5 Modify the MHS File and add an Interrupt Controller Double-click the system.mhs file to open it in the XPS editor.

for EDK 6.3i6 Modify the MHS File and add an Interrupt Controller Add the following line at the end of the Delay instance parameters (before the END keyword). PORT Interrupt = timer1 Save and Close the MHS file.

for EDK 6.3i7 Modify the MHS File and add an Interrupt Controller Click Project  Add Cores (dialog).

for EDK 6.3i8 Modify the MHS File and add an Interrupt Controller In the Peripherals tab, add the opb_intc peripheral

for EDK 6.3i9 Modify the MHS File and add an Interrupt Controller In the Bus Connections tab, connect the interrupt controler as an s (slave) device to the OPB bus. Change the base address of the interrupt controller to 0x80001c00 and the high address to 0x80001dff

for EDK 6.3i10 Modify the MHS File and add an Interrupt Controller Using the Ports tab, add the OPB_Clk, Intr, and Irq ports of the opb_intc_0 as internal

for EDK 6.3i11 Modify the MHS File and add an Interrupt Controller Change the net names of the OPB_Clk and Irq ports of the opb_intc_0 instance to sys_clk_s and interrupt, respectively.

for EDK 6.3i12 Modify the MHS File and add an Interrupt Controller Select the browse button under Net Name next for Intr to open the Connect and Prioritize Interrupts dialogue box. Select timer1 from the High Priority list (right-side) and click the Add button to add the interrupt output of the delay instance to the input of the interrupt controller opb_intc. Click

for EDK 6.3i13 Modify the MHS File and add an Interrupt Controller Add the INTERRUPT (external interrupt request) port on the microblaze_0 to the design as an internal interrupt, and change its net name to interrupt. Click the 確定 button to accept the changes and close the editor dialog

for EDK 6.3i14 Configure the BSP Using Project  Software Platform Settings … open the Software Platform Settings GUI.

for EDK 6.3i15 Configure the BSP Click on the Processor, Driver Parameters and Interrupt Handlers tab. Enter timer_int_handler in the Current Value field as a interrupt_handler function, as shown in following figure. Click 確定 to accept the settings. Click Tools  Generate Libraries to update the generated libraries and xparameters.h file.

for EDK 6.3i16 Write the Interrupt Handler and Compile the Code Copy the system_timer.c and 7segled.c files to the current project X:\EDKlab\Lab5\code.

for EDK 6.3i17 Write the Interrupt Handler and Compile the Code Make the TestApp project inactive. Under the Applications Tab, right click on the TestApp project title and select Make Project Inactive. This is necessary because there is no interrupt handler in this project

for EDK 6.3i18 Write the Interrupt Handler and Compile the Code Remove system.c from the Project: MyProj project by right clicking on it under Sources and deleting it. Add the two new files system_timer.c and 7segled.c to the MyProj project by right clicking on Sources and selecting Add File … then navigate to the sources and add them

for EDK 6.3i19 Write the Interrupt Handler and Compile the Code Double-click system_timer.c to open the C file in the XPS editor. Examine the contents of the C file. Notice that the interrupt handler has not been completed. You will complete it.

for EDK 6.3i20 Write the Interrupt Handler and Compile the Code Create a new global variable to be used in the interrupt handler code: Xuint32 timer_count = 0; Note: The Xuint32 type is declared in #include "xbasic_types.h" xutil.h. Save the file.

for EDK 6.3i21 Write the Interrupt Handler and Compile the Code Notice that the interrupt handler function is called timer_int_handler. This name must match the name specified in the OPB Timer Peripheral Options, as shown in Page 15. If the name does not match exactly, the interrupt handler will not be connected to the interrupt. Create several new local variables for the timer_int_handler: Xuint32 baseaddr = (int)baseaddr_p; Xuint32 csr; The first step in creating an OPB timer interrupt handler is to verify that the OPB timer caused the interrupt. This information can be found in the OPB Timer Control Status Register. Open the documentation to determine how the Control Status Register works.

for EDK 6.3i22 Write the Interrupt Handler and Compile the Code In Windows, Click Start  Programs  Xilinx Platform Studio 6.3i  Documentation  EDK 6.3i Reference & User Guides.

for EDK 6.3i23 Write the Interrupt Handler and Compile the Code Scroll down to the bottom of the page and click Processor IP Reference Guide.

for EDK 6.3i24 Write the Interrupt Handler and Compile the Code In the Processor IP Reference Guide, click OPB Timer/Counter under the peripheral cores section. Click View this data sheet to view the complete data sheet

for EDK 6.3i25 Write the Interrupt Handler and Compile the Code Go to the Register Description section in the data sheet and study TCSR0 Register. Notice that bit 23, T0INT, has the following description:

for EDK 6.3i26 Write the Interrupt Handler and Compile the Code The level 0 driver for the OPB timer provides functions (macros) that read and write to the Control Status Register, which we will use to read and write TCSR0. We can use the following function to determine whether the interrupt has occured: XTmrCtr_mGetControlStatusReg( ) The following is the documentation associated with the OPB timer: XTmrCtr_mGetControlStatusReg ( BaseAddress, TmrCtrNumber ) Get the Control Status Register of a timer counter. Parameters: BaseAddress is the base address of the device. TmrCtrNumber is the specific timer counter within the device, a zero- based number, 0 -> (XTC_DEVICE_TIMER_COUNT - 1). Returns: The value read from the register, a 32-bit value.

for EDK 6.3i27 Write the Interrupt Handler and Compile the Code Add this function call to the code with the associated parameters. The resulting 32-bit value should be stored in the variable csr. csr = XTmrCtr_mGetControlStatusReg(baseaddr, 0); Using the value returned to csr, test to see if bit 23 is set by using the XTC_CSR_INT_OCCURED_MASK parameter. if (csr & XTC_CSR_INT_OCCURED_MASK) { timer_count++; }

for EDK 6.3i28 Write the Interrupt Handler and Compile the Code If the interrupt was taken, increment a counter. The count value should then be displayed by using the 7SegLED peripheral. A subroutine to do the display is included in the 7SegLED.c file. The following call will display the value in timer_count on the display and light the decimal point in position 1. dispLED(timer_count, 1); Clear the interrupt by using the following function call: XTmrCtr_mSetControlStatusReg(baseaddr, 0, csr);

for EDK 6.3i29 Write the Interrupt Handler and Compile the Code The interrupt handler has now been completed, and it should look like following figure, with the exception of the counter. You can create any type of counter you like.

for EDK 6.3i30 Write the Interrupt Handler and Compile the Code In the Applications tab, double-click on Compiler Options. Click on the Directories tab and delete the linker script file entry and click 確定

for EDK 6.3i31 Write the Interrupt Handler and Compile the Code Generate the hardware system, click Tools  Generate Netlist. PlatGen will regenerate the hardware system because you added the interrupt controller to the MHS file. Compile the source file.

for EDK 6.3i32 Write the Interrupt Handler and Compile the Code Why do you think the program is so big? The printf function uses significant amount of code space. Change the printf to xil_printf. This contains the same functionality as printf with the exception of the floating-point handling. Recompile the code.

for EDK 6.3i33 Write the Interrupt Handler and Compile the Code In the Applications tab, double-click on Compiler Options. Click on the Directories tab

for EDK 6.3i34 Write the Interrupt Handler and Compile the Code Click on the browse button of the linker script file entry, browse to the X:\EDKlab\Lab5\TestApp\src\ directory, and select TestAppLinkScr to add it to the project. Click 確定 to accept the setting

for EDK 6.3i35 Write the Interrupt Handler and Compile the Code Close the project so that the peripheral can be seen by XPS, File  Close Project. Open the project by clicking File  Recent Projects  … \lab5\system.xmp from XPS. alter the xil_printf function call to printf in main. In the TestAppLinkScr file, change the stack and heap size to 0x200 each.

for EDK 6.3i36 Write the Interrupt Handler and Compile the Code Try to compile the code. A compilation error will occur due to memory being full. This occurred as now the linker script is in effect and the total memory requirement is which is much more than what we have (16K in lmb). Change the printf function to xil_printf in main. Save the changes.

for EDK 6.3i37 Write the Interrupt Handler and Compile the Code Compile the code and you will see that it compiles successfully. Note: The amount of memory usage is different then the one being used without linker script as the linker script controls the heap and stack sizes and placement.

for EDK 6.3i38 Verifying in Hardware Download the generated bit file by clicking Tools  Download. After the board is programmed, you will see a counter on the 7 Segment LEDs and a message on the terminal window. Note: It is possible that the design will not meet timing. If this is the case, it is still likely to function correctly. If not, then you can change the effort level in PAR from std to high in the fast_runtime.opt file in the lab5\etc directory.

for EDK 6.3i39 Conclusion This lab led you through assigning an interrupt handler function to an interrupting device such as an OPB timer. An interrupt controller was added to the system. The LibGen tool allowed you to update the parameters on the added and modified system. You also developed an interrupt handler function and viewed how the appropriate function can reduce the code size, which can have a major impact on resource requirements.