AN423: Configuring the MicroBlaster Passive Serial Software Driver

Similar documents
White Paper Configuring the MicroBlaster Passive Serial Software Driver

ByteBlaster II Parallel Port Download Cable

Using the Serial FlashLoader With the Quartus II Software

ByteBlaster II Download Cable User Guide

USB BitJetLite Download Cable

Table 1 shows the issues that affect the FIR Compiler v7.1.

Using MAX 3000A Devices as a Microcontroller I/O Expander

Using the Nios Development Board Configuration Controller Reference Designs

Active Serial Memory Interface

Using MAX II & MAX 3000A Devices as a Microcontroller I/O Expander

December 2002, ver. 1.3 Application Note 191. Six individual interrupts Six-bit priority scheme Five-bit priority scheme plus one individual interrupt

DSP Builder. DSP Builder v6.1 Issues. Error When Directory Pathname is a Network UNC Path

Enhanced Configuration Devices

DSP Development Kit, Stratix II Edition

AN 370: Using the Serial FlashLoader with the Quartus II Software

AN 547: Putting the MAX II CPLD in Hibernation Mode to Achieve Zero Standby Current

Table 1 shows the issues that affect the FIR Compiler, v6.1. Table 1. FIR Compiler, v6.1 Issues.

Enhanced Configuration Devices

Excalibur Solutions DPRAM Reference Design

Simple Excalibur System

MasterBlaster Serial/USB Communications Cable User Guide

UTOPIA Level 2 Slave MegaCore Function

DDR & DDR2 SDRAM Controller

Configuration via Protocol (CvP) Implementation in Altera FPGAs User Guide

Simulating the ASMI Block in Your Design

Cyclone II FPGA Family

Introduction. Design Hierarchy. FPGA Compiler II BLIS & the Quartus II LogicLock Design Flow

Nios Soft Core Embedded Processor

DDR & DDR2 SDRAM Controller

Disassemble the machine code present in any memory region. Single step through each assembly language instruction in the Nios II application.

10. Configuration, Design Security, and Remote System Upgrades in Stratix IV Devices

Error Correction Code (ALTECC_ENCODER and ALTECC_DECODER) Megafunctions User Guide

FPGA Design Security Solution Using MAX II Devices

Nios II Embedded Design Suite 6.1 Release Notes

Stratix FPGA Family. Table 1 shows these issues and which Stratix devices each issue affects. Table 1. Stratix Family Issues (Part 1 of 2)

9. Configuration, Design Security, and Remote System Upgrades in Arria II Devices

POS-PHY Level 4 MegaCore Function

FPGAs Provide Reconfigurable DSP Solutions

Video and Image Processing Suite

Remote Drive. Quick Start Guide. System Level Solutions, Inc. (USA) Murphy Avenue San Martin, CA (408) Version : 0.1.

Converting.srec Files to.flash Files for Nios Embedded Processor Applications

Section II. Software Settings

DDR & DDR2 SDRAM Controller Compiler

Stratix II FPGA Family

Implementing LED Drivers in MAX and MAX II Devices. Introduction. Commercial LED Driver Chips

DDR & DDR2 SDRAM Controller Compiler

White Paper. Floating-Point FFT Processor (IEEE 754 Single Precision) Radix 2 Core. Introduction. Parameters & Ports

RLDRAM II Controller MegaCore Function

ZBT SRAM Controller Reference Design

Design Verification Using the SignalTap II Embedded

White Paper The Need for a High-Bandwidth Memory Architecture in Programmable Logic Devices

AN 549: Managing Designs with Multiple FPGAs

DDR & DDR2 SDRAM Controller Compiler

For Quartus II Software. This Quick Start Guide will show you how to set up a Quartus

RapidIO Physical Layer MegaCore Function

Using the Serial FlashLoader with the Quartus II Software

Legacy SDRAM Controller with Avalon Interface

Using ModelSim to Simulate Logic Circuits in VHDL Designs. 1 Introduction. For Quartus II 13.0

Estimating Nios Resource Usage & Performance

White Paper Using the MAX II altufm Megafunction I 2 C Interface

PCI Express Multi-Channel DMA Interface

Nios II Embedded Design Suite 7.1 Release Notes

Simulating the PCI MegaCore Function Behavioral Models

Configuration via Protocol (CvP) Implementation in Altera FPGAs User Guide

Intel FPGA USB Download Cable User Guide

Configuration via Protocol (CvP) Implementation in Altera FPGAs User Guide

SignalTap II with Verilog Designs. 1 Introduction. For Quartus II 13.1

Simulating the PCI MegaCore Function Behavioral Models

Laboratory Exercise 6

PCI Express Compiler. System Requirements. New Features & Enhancements

3. Serial Configuration Devices (EPCS1, EPCS4, EPCS16, EPCS64, and EPCS128) Data Sheet

Implementing LED Drivers in MAX Devices

Matrices in MAX II & MAX 3000A Devices

AN 825: Partially Reconfiguring a Design on Intel Stratix 10 GX FPGA Development Board

DSP Builder Release Notes

Arria II GX FPGA Development Board

Simulating the Reed-Solomon Model

Exercise 1 In this exercise you will review the DSSS modem design using the Quartus II software.

Board Update Portal based on Nios II Processor with EPCQ (Arria 10 GX FPGA Development Kit)

Intel FPGA USB Download Cable User Guide

Using HAL Device Drivers with the Altera Monitor Program. 1 Introduction. For Quartus II 13.1

Stratix vs. Virtex-II Pro FPGA Performance Analysis

Introduction to the Altera SOPC Builder Using Verilog Design

13. HardCopy Design Migration Guidelines

5. Configuring Cyclone FPGAs

Introduction to Simulation of VHDL Designs Using ModelSim Graphical Waveform Editor. 1 Introduction. For Quartus Prime 16.1

Practical Hardware Debugging: Quick Notes On How to Simulate Altera s Nios II Multiprocessor Systems Using Mentor Graphics ModelSim

Stratix II vs. Virtex-4 Performance Comparison

Configuring Cyclone FPGAs

Debugging Nios II Systems with the SignalTap II Logic Analyzer

Figure 1. Device Package Ordering Information for Stratix, Stratix GX, Cyclone, APEX 20KC, APEX II, Mercury & Excalibur Devices EP1S 25 F 780 C 5 N

Introduction. Synchronous vs. Asynchronous Memory. Converting Memory from Asynchronous to Synchronous for Stratix & Stratix GX Designs

White Paper AHB to Avalon & Avalon to AHB Bridges

Nios Embedded Processor Development Board

FFT MegaCore Function

RapidIO MegaCore Function

Remote Update Intel FPGA IP User Guide

Nios II Performance Benchmarks

DDR and DDR2 SDRAM Controller Compiler User Guide

Configuration via Protocol (CvP) Implementation in V-series FPGA Devices User Guide

Transcription:

AN423: Configuring the MicroBlaster Passive Serial Software Driver June 2008, version 1.1 Introduction The MicroBlaster TM software driver configures Altera programmable logic devices (PLDs) in passive serial (PS) mode for embedded configurations through the ByteBlaster TM II and ByteBlasterMVTM download cables. You can customize the modular source code s I/O control routines (provided as separate files) for your system. The MicroBlaster software driver is an embedded configuration driver that supports the Raw Binary File (.rbf) format generated by the Quartus II software. This application note describes how the MicroBlaster software driver works, the important parameters and functions of its source code, and how to port its source code to an embedded platform. 1 The MicroBlaster software driver is developed and tested on the Windows NT platform. This Windows NT driver s binary file size is about 40 Kbytes. Interface Block Diagram The MicroBlaster software driver s source code has two modules: Data processing I/O control The data processing module reads the programming data from the Raw Binary File, rearranges it, and sends it to the I/O control module. The I/O control module sends that data to the target PLD. Periodically, the I/O control module senses certain configuration pins to determine if errors occurred during the configuration process. When an error occurs, the MicroBlaster source code re-initiates the configuration process. Figure 1 shows the MicroBlaster software block diagram and its interfaces to the programming input file and target PLD. Figure 1. MicroBlaster Block Diagram & Interfaces MicroBlaster Programming Input File Target Device Raw Binary File Data Processor I/O PLD June 2008 Altera Corporation AN423: Configuring the MicroBlaster Passive Serial Software Driver

Page 2 Interface Source Files Table 1 describes the MicroBlaster source files. Table 1. Source Files File mblaster.c mb_io.c mb_io.h Description Contains the main ( ) function. It manages the processing of the programming input file, instantiates the configuration process, and handles any configuration errors. This file is platform independent. These files handle the I/O control functions and are platform dependent. They support the ByteBlaster II or ByteBlasterMV download cable for PCs running Windows NT only. You should modify these files to support other platforms. Table 2. Directory Structure 1 The source files are available for download from the Altera website at www.altera.com. How To Use MicroBlaster Table 2 describes the directory structure of the source files. Folders in MicroBlaster Driver Files Available Description bin MBlaster.exe, MBlaster.txt Executable file for MicroBlaster driver doc an423.pdf, readme.txt MicroBlaster documentation source mblaster.c, mb_io.c, mb_io.h Source files The MicroBlaster software drive supports the Raw Binary File programming source file (.rbf).you can generate the (.rbf) file from the Quartus II compilation or use the Quartus II Software Convert Programming File utility. After generating the.rbf, type the following command line at the Windows command prompt to configure the device: mblaster <filename>.rbf AN423: Configuring the MicroBlaster Passive Serial Software Driver June 2008 Altera Corporation

Parameters and Functions Page 3 Figure 2 shows the screenshot of the execution of MicroBlaster software using mblaster <filename>.rbf command-line. Figure 2. Configuring the Device with mblaster <filename>.rbf command Parameters and Functions Because the writing and reading of the data to and from the I/O ports on other platform maps to the parallel port architecture, this application note uses the pin assignments of the (PS) configuration signals to a parallel port. These pin assignments reduce the required source code modifications. Table 3 shows the assignment of the passive serial configuration signals to the parallel port. Table 3. Pin Assignments of the Passive Serial Configuration Signals to the Parallel Port Bit 7 6 5 4 3 2 1 0 Port 0 (1) DATA0 nconfig DCLK Port 1 (1) CONF_DONE nstatus Port 2 (1) te to Table 3: (1) This port refers to the index from the base address of the parallel port; for example, 0x378. Program and User-Defined Constants The source code has program and user-defined constants. You should not change the program constants. You should set the values for user-defined constants. Table 4 summarizes the constants. Table 4. Program and User-Defined Constants (Part 1 of 2) Constant Type Description WINDOWS_NT Program Designates Windows NT operating system. EMBEDDED Program Designates embedded microprocessor system or other operating system. PORT Program Determines the platform. SIG_DCLK Program DCLK signal (port 0, bit 0) June 2008 Altera Corporation AN423: Configuring the MicroBlaster Passive Serial Software Driver

Page 4 Parameters and Functions Table 4. Program and User-Defined Constants (Part 2 of 2) Constant Type Description SIG_NCONFIG Program nconfig signal (port 0, bit 1) SIG_DATA0 Program DATA0 signal (port 0, bit 6) SIG_NSTATUS Program nstatus signal (port 1, bit 4) SIG_CONFDONE Program CONF_DONE signal (port 1, bit 7) INIT_CYCLE User-defined The number of clock cycles to toggle after configuration is done to initialize the device. Each device family requires a specific number of clock cycles. RECONF_COUNT_MAX User-defined The maximum number of auto-reconfiguration attempts allowed when the program detects an error. CHECK_EVERY_X_BYTE User-defined Check nstatus pin for error every X number of bytes programmed. Do not use 0. CLOCK_X_CYCLE (optional) User-defined The number of additional clock cycles to toggle after INIT_CYCLE. Use 0 if no additional clock cycles are required. The recommended value is 150 if this constant is used. Global Variables Table 5. Global Variables Table 5 summarizes the global variables used when reading or writing to the I/O ports. You should map the I/O ports of your system to these global variables. Variable Type Description sig_port_maskbit[w][x] Two dimensional integer array Variable that tells the port number of a signal and the bit position of the signal in the port register. (1) (2) W = 0 refers to SIG_DCLK W = 1 refers to SIG_NCONFIG W = 2 refers to SIG_DATA0 W = 3 refers to SIG_NSTATUS W = 4 refers to SIG_CONF_DONE X = 0 refers to the port number the signal falls into. For example, the signal SIG_DCLK falls into port number 0, and the signal SIG_NSTATUS falls into port number 1 (refer to Table 3). X = 1 refers to the bit position of thesignal. port_mode_data[y][z] Two dimensional integer array The initial values of the registers in each port in different modes. The ports are in reset mode before and during configuration. The ports are in user mode after configuration. (1) Y = 0 refers to reset mode Y = 1 refers to user mode Z = port number AN423: Configuring the MicroBlaster Passive Serial Software Driver June 2008 Altera Corporation

Parameters and Functions Page 5 Table 5. Global Variables port_data[z] Integer array Holds the current value of each port. The value is updated each time a write is performed to the ports. (1) Z = port number. tes to Table 5: Variable Type Description (1) The port refers to the index from the base address of the parallel port; for example, 0 378. (2) The signal refers to any of these signals: SIG_DCLK, SIG_NCONFIG, SIG_DATA0, SIG_NSTATUS, and SIG_CONF_DONE. Functions Table 6. Functions Table 6 describes the parameters and the return value of some of the functions in the source code. Only functions declared in the mb_io.c file are discussed because you need to customize these functions in order to work on platforms other than Windows NT. These functions contain the I/O control routines. Function Parameters Return Value Description readbyteblaster int port Integer This function reads the value of the port and returns it. Only the least significant byte contains valid data. (1) writebyteblaster int port ne This function writes the data to the port. Data int data of the integer type is passed to the function. Only the least significant byte contains valid int test data. Each bit of the least significant byte represents the signal in the port, as discussed in Table 3. (1) The functions in mblaster.c that call the writebyteblaster function have organized the bits. Only the value of specific bits are changed as needed before passing it to the writebyteblaster function as data. te to Table 6: (1) The port refers to the index from the base address of the parallel port; for example, 0 378. To reduce the number of dumps to the port, each time a signal other than DCLK is dumped to the port (typically the DATA0 signal), the DCLK clock signal is toggled at the same time. The integer test determines if the DCLK signal needs to be toggled. (1) June 2008 Altera Corporation AN423: Configuring the MicroBlaster Passive Serial Software Driver

Page 6 Program Flow Program Flow Figure 3 illustrates the program flow of the MicroBlaster software driver. The CHECK_EVERY_X_BYTE, RECONF_COUNT_MAX, INIT_CYCLE, and CLOCK_X_CYCLE constants determine the flow of the configuration process. Refer to Table 4 for program and user-defined contants. Figure 3. MicroBlaster Program Flow Start Get file size Start configuration Get one byte and send it to I/O port. Increase byte counter and configuration counter Byte counter % CHECK_EVERY_X_BYTE = 0? Read nstatus Byte counter = File Size? nstatus = 0? Read nstatus and CONF_DONE nstatus = 0? or CONF_DONE = 0? Configuration count = RECONF_COUNT_MAX Toggle DCLK for INIT_CYCLE cycles CLOCK_X_CYCLE = 0? Toggle DLCK for CLOCK_X_CYCLE cycles End AN423: Configuring the MicroBlaster Passive Serial Software Driver June 2008 Altera Corporation

Porting Page 7 Porting Reading Writing Example Two separate platform-dependent routines handle the read and write operations in the I/O control module. The read operation reads the value of the required pin. The write operation writes data to the required pin. To port the source code to other platforms or embedded systems, you must implement your I/O control routines in the existing I/O control functions, readbyteblaster and writebyteblaster (refer to Table 6). You can implement your I/O control routines between the following compiler directives: #if PORT == WINDOWS_NT /* original source code */ #else if PORT == EMBEDDED /* put your I/O control routines source code here */ #endif The readbyteblaster function accepts port as an integer parameter and returns an integer value. Your code should map or translate the port value defined in the parallel port architecture (refer to Table 3) to the I/O port definition of your system. For example, when reading from port 1, your source code should read the CONF_DONE and nstatus signals from your system (defined in Table 3). Then the code should rearrange these signals within an integer variable so the values of CONF_DONE and nstatus are represented in bit positions 7 and 4 of the integer, respectively. This behaviorally maps your system s I/O ports to the pins in the pin assignments of the parallel port architecture. By adding these lines of translation code to the mb_io.c file, you can avoid modifying code in the mblaster.c file. The writebyteblaster function accepts three integer parameters: port, data, and test. Modify the writebyteblaster function the same way as the readbyteblaster function. Your code maps or translates the port value that is defined in the parallel port architecture (refer to Table 3) to the I/O port definition of your system. For example, when writing to port 0, your source code should identify the DATA0, nconfig, and DCLK signals represented in each bit of the data parameter. The source code should mask the data variable with the sig_port_maskbit variable (refer to Table 5) to extract the value of the signal to write. To extract DATA0 from data for example, mask data with sig_port_maskbit[sig_data0][1]. After extracting the values of the relevant signals, each signal is mapped to the I/O ports as defined in your system. By adding these translation code lines to the mb_io.c file, you can avoid modifying code in the mblaster.c file. Figure 4 shows an embedded system holding five configuration signals in the data registers D0, D1, D3, D6, and D7 of an embedded microprocessor. When reading from the I/O ports, the I/O control routine reads the values of the data registers and maps them to the particular bits in the parallel port registers (P0 to P2). These bits are later accessed and processed by the data processing module. June 2008 Altera Corporation AN423: Configuring the MicroBlaster Passive Serial Software Driver

Page 8 Conclusion When writing, the values of the signals are stored in the parallel port registers (P0 to P2) by the data processing module. The I/O control routine then reads the data from the parallel port registers and sends it to the corresponding data registers (D0, D1, D3, D6, and D7). Figure 4. Example of I/O Reading & Writing Mapping Process Mapping Parallel Port Architecture Designer I/O Port P1 B7 CONF_DONE D0 P0 B6 DATA0 D1 D2 Data RBF Data Processing Unit P1 B4 nstatus D3 D4 PLD P0 B1 P0 B0 nconfig DCLK D5 D6 D7 Programming Input File Data Processing Module I/O Control Module Target Device Conclusion The MicroBlaster passive serial embedded configuration source code is modular so you can easily port it to other platforms. It offers a simple and inexpensive embedded system to accomplish a PS configuration for Altera PLDs. AN423: Configuring the MicroBlaster Passive Serial Software Driver June 2008 Altera Corporation

Document Revision History Table 7. Document Revision History Table 7 shows the revision history for this document. Date and Chapter Version Changes Made Summary of Changes June 2008 v1.1 Added new How To Use MicroBlaster and Document Revision History sections. Added Figure 2. Executable file for MicroBlaster driver June 2006 v1.0 Initial Release. Source Files Copyright 2008 Altera Corporation. All rights reserved. Altera, The Programmable Solutions Company, the stylized Altera logo, specific device designations, and all other words and logos that are identified as trademarks and/or service marks are, unless noted otherwise, the trademarks and service marks of Altera Corporation in the U.S. and other countries. All other product or service names are the property of their respective holders. Altera products are protected under numerous U.S. and foreign patents and pending applications, maskwork rights, and copyrights. Altera warrants performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera Corporation. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services.