FPGA、CPLD、ASIC ソリューションを提供するアルテラ
  • ダウンロード
  • 資料
  • 製品情報
    • デバイス
    • 開発ソフトウェア
    • Intellectual Property
    • デザイン・サービス
    • 開発キット/ケーブル
    • 資料
  • エンド・マーケット
    • 自動車
    • 放送機器
    • コンピューター&ストレージ
    • 民生機器
    • 産業機器
    • 医療機器
    • 軍用機器
    • テスト&計測機器
    • ワイヤーライン
    • ワイヤレス
  • テクノロジ
    • DSP
    • 外部メモリ
    • エンベデッド・プロセッサ
    • トランシーバ
    • パラレルI/O
    • シグナル・インテグリティ
    • システム・インテグレーション
  • 教育&イベント
    • トレーニング
    • ユニバーシティ・プログラム
    • オンライン・セミナー & ビデオ
    • デモンストレーション
    • イベント
  • サポート
    • ナレッジ・データベース
    • デバイス
    • 開発ソフトウェア
    • Intellectual Property
    • リファレンス・デザイン
    • デザイン例
    • マイサポート
  • 会社概要
    • アルテラについて
    • パートナー
    • ニュース・ルーム
    • インベスターリレーション
    • 求人情報
    • お問い合わせ
  • オンラインショップ
    • デバイス
    • 開発ソフトウェア
    • 開発 & エデュケーション・キット
    • ケーブル & プログラミング・ハードウェア
    • IP
  • サイト全体
  • パートナンバー
  • ナレッジ・データベース
  • サポート&技術資料
  • フォーラム & Wiki

Memory Test

ホーム > サポート > デザイン例 > Memory Test

Start Designing Today - Nios II Development Kits

Attend Nios II Training

Memory Test tests the connection of a Nios® II system to RAM and flash. In addition, it demonstrates the use of the direct memory access (DMA) controller peripheral and Nios II flash programming application program interface (API).

The RAM portion of the test prompts you for the start and end address of the RAM that is to be tested. Once valid start and end address entries are made, the RAM test routine performs the following operations:

  • Tests the address and data lines for shorts and opens
  • Tests byte and half-word access
  • Tests every bit in the memory to store both '1' and '0'
  • Checks if there is a DMA component available in the system
  • If a DMA component exists, the routine tests its access to the memory

IMPORTANT: The RAM test is destructive to the contents of the RAM. For this reason, you must make absolutely sure that none of the software sections are located in the RAM being tested. This means all code, data, and exception locations must be in a memory separate from the one being tested. You can adjust these locations in the Nios II integrated development environment (IDE) and SOPC Builder.

The flash tests demonstrate the use of the flash programming API. After the flash device specified is opened, the test routine searches for a block in the device that is already erased. This prevents any overwriting of important data that may be programmed in flash. When an erased block is found, the routine performs a test of the flash API calls on that block.

The following API functions are then run to test the flash interface:

  • alt_get_flash_info: This function queries the flash device and collects various information about it. In the example, the results of this query are compared to what is expected, and an error is reported in the event of a mismatch.
  • alt_write_flash: This function writes a specified number of bytes to the flash device. In the example, this function is called repeatedly in a loop to write a lengthy amount of data.
  • alt_read_flash: This function reads a specified number of bytes of data from the flash device. In the example, alt_read_flash reads back and tests all of the writing routines.
  • alt_erase_flash_block: This function performs a block erase on the flash device.
  • alt_write_flash_block: This function writes an erased block of data to the flash device.

During the test, status and error information is passed to the user via printfs.

Using This Design Example

To obtain this design example, download a free evaluation version of the Nios II Embedded Design Suite (EDS) . This embedded software example is installed with the Nios II EDS in the  <Nios II EDS installation path>/examples/software directory and is available as a Nios II integrated development environment (IDE) project template. The template includes the project settings required to run this design on the supported target hardware configurations. To use this software example, simply create a new C/C++ application project in the IDE and choose the desired project template.

The use of this design is governed by, and subject to, the terms and conditions of the Altera Hardware Reference Design License Agreement.

Hardware Requirements

This example requires the following devices to be present in the target hardware design:

  • STDOUT component such as a UART or JTAG UART
  • Common flash interface (CFI) compliant flash component
  • DMA component (optional)

You can run this software design example on the following Nios II hardware design examples:

Nios II Development Board, Stratix® II Edition:

  • Standard (DMA RAM test will not run)
  • Full Featured

Nios II Development Board, Stratix Professional Edition:

  • Standard (DMA RAM test will not run)
  • Full Featured

Nios II Development Board, Stratix Edition:

  • Standard (DMA RAM test will not run)
  • Full Featured

Nios II Development Board, Cyclone® Edition:

  • Standard (DMA RAM test will not run)
  • Full Featured

DSP Development Board, Stratix II Edition:

  • Standard (DMA RAM test will not run)
  • Full Featured

Design Examples Disclaimer

These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; therefore, all warranties, representations, or guarantees of any kind (whether express, implied, or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.

このページを評価


  • 製品
    • MAX/MAX II
    • Stratix/Stratix GX
    • Nios II
  • 機能
    • 演算
    • メモリ
    • バス & I/O
    • ロジック
    • インタフェース & ペリフェラル
    • DSP
    • コミュニケーション
    • PLL & クロック
  • デザイン入力
    • Quartus II プロジェクト
    • Tcl
    • VHDL
    • Verilog HDL
    • C コード例
    • DSP Builder
    • TimeQuest
  • シミュレーション・ツール
    • Mentor Graphics ModelSim
    • Cadence NCsim
    • Synopsys VCS
  • レガシー例
    • グラフィック・エディタ
    • AHDL
    日本アルテラへのご連絡
    製品情報 | エンド・マーケット | テクノロジ | 教育&イベント | サポート | 会社概要 | オンラインショップ
    FPGA 入門 | お問い合わせ | サイト・マップ | 求人情報 | プライバシー | Legal Notice
    Copyright © 1995-2010 日本アルテラ株式会社. All Rights Reserved.
    Altera Forum
    アルテラ
    フォーラム
    Twitter
    Twitter
    RSS
    RSS
    Facebook
    Facebook
    Flickr
    Flickr
    YouTube
    YouTube
    ニュースメール
    ニュース
    メール