FC2ブログ

[NEEK][動画再生]Flashメモリが動いた

Flashへプログラム配置してLEDチカチカが動いたっぽい。
元々Flashが動かなかったので、NiosII IDEに内蔵されたmemtestプログラムで
チェックしようと思っていたが、どうにも内蔵SRAMだけでは容量オーバー。
外付けのSDRAMとか使うにも、これを動かす過程でつまずくとハマるので
どうしたもんかと思っていた。

情報探してる時にFlashを使ったサンプルデザイン発見。
http://www.altera.co.jp/literature/ds/ds_nios2_3c25_lcd.pdf
これのFlashのピン配置を習って以下の通りqsf作成。

set_global_assignment -name FAMILY "Cyclone III"
set_global_assignment -name DEVICE EP3C25F324C8
set_global_assignment -name TOP_LEVEL_ENTITY boot_copier_test
set_global_assignment -name ORIGINAL_QUARTUS_VERSION "9.1 SP2"
set_global_assignment -name PROJECT_CREATION_TIME_DATE "21:42:58 JUNE 14, 2010"
set_global_assignment -name LAST_QUARTUS_VERSION 10.0
set_global_assignment -name EDA_SIMULATION_TOOL "ModelSim-Altera (Verilog)"
set_global_assignment -name EDA_TIME_SCALE "1 ps" -section_id eda_simulation
set_global_assignment -name EDA_OUTPUT_DATA_FORMAT "VERILOG HDL" -section_id eda_simulation
set_global_assignment -name USE_GENERATED_PHYSICAL_CONSTRAINTS OFF -section_id eda_blast_fpga
set_global_assignment -name CYCLONEII_OPTIMIZATION_TECHNIQUE SPEED
set_global_assignment -name DEVICE_FILTER_PACKAGE FBGA
set_global_assignment -name DEVICE_FILTER_PIN_COUNT 324
set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 8
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
set_global_assignment -name NOMINAL_CORE_SUPPLY_VOLTAGE 1.2V
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
set_global_assignment -name LL_ROOT_REGION ON -section_id "Root Region"
set_global_assignment -name LL_MEMBER_STATE LOCKED -section_id "Root Region"
set_location_assignment PIN_P13 -to out_port_from_the_pio[0]
#set_location_assignment PIN_P12 -to out_port_from_the_pio[1]
set_location_assignment PIN_N12 -to out_port_from_the_pio[2]
#set_location_assignment PIN_N9 -to out_port_from_the_pio[3]
set_location_assignment PIN_N2 -to reset_n
set_location_assignment PIN_H17 -to txd_from_the_uart
set_location_assignment PIN_E18 -to rxd_to_the_uart
set_location_assignment PIN_B9 -to clk_0

set_global_assignment -name FORCE_CONFIGURATION_VCCIO ON
set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION "USE AS REGULAR IO"

set_location_assignment PIN_E12 -to tri_state_bridge_address[1]
set_location_assignment PIN_A16 -to tri_state_bridge_address[2]
set_location_assignment PIN_B16 -to tri_state_bridge_address[3]
set_location_assignment PIN_A15 -to tri_state_bridge_address[4]
set_location_assignment PIN_B15 -to tri_state_bridge_address[5]
set_location_assignment PIN_A14 -to tri_state_bridge_address[6]
set_location_assignment PIN_B14 -to tri_state_bridge_address[7]
set_location_assignment PIN_A13 -to tri_state_bridge_address[8]
set_location_assignment PIN_B13 -to tri_state_bridge_address[9]
set_location_assignment PIN_A12 -to tri_state_bridge_address[10]
set_location_assignment PIN_B12 -to tri_state_bridge_address[11]
set_location_assignment PIN_A11 -to tri_state_bridge_address[12]
set_location_assignment PIN_B11 -to tri_state_bridge_address[13]
set_location_assignment PIN_C10 -to tri_state_bridge_address[14]
set_location_assignment PIN_D10 -to tri_state_bridge_address[15]
set_location_assignment PIN_E10 -to tri_state_bridge_address[16]
set_location_assignment PIN_C9 -to tri_state_bridge_address[17]
set_location_assignment PIN_D9 -to tri_state_bridge_address[18]
set_location_assignment PIN_A7 -to tri_state_bridge_address[19]
set_location_assignment PIN_A6 -to tri_state_bridge_address[20]
set_location_assignment PIN_B18 -to tri_state_bridge_address[21]
set_location_assignment PIN_C17 -to tri_state_bridge_address[22]
set_location_assignment PIN_C18 -to tri_state_bridge_address[23]

set_location_assignment PIN_H3 -to tri_state_bridge_data[0]
set_location_assignment PIN_D1 -to tri_state_bridge_data[1]
set_location_assignment PIN_A8 -to tri_state_bridge_data[2]
set_location_assignment PIN_B8 -to tri_state_bridge_data[3]
set_location_assignment PIN_B7 -to tri_state_bridge_data[4]
set_location_assignment PIN_C5 -to tri_state_bridge_data[5]
set_location_assignment PIN_E8 -to tri_state_bridge_data[6]
set_location_assignment PIN_A4 -to tri_state_bridge_data[7]
set_location_assignment PIN_B4 -to tri_state_bridge_data[8]
set_location_assignment PIN_E7 -to tri_state_bridge_data[9]
set_location_assignment PIN_A3 -to tri_state_bridge_data[10]
set_location_assignment PIN_B3 -to tri_state_bridge_data[11]
set_location_assignment PIN_D5 -to tri_state_bridge_data[12]
set_location_assignment PIN_B5 -to tri_state_bridge_data[13]
set_location_assignment PIN_A5 -to tri_state_bridge_data[14]
set_location_assignment PIN_B6 -to tri_state_bridge_data[15]
set_location_assignment PIN_C16 -to tri_state_bridge_data[16]
set_location_assignment PIN_D12 -to tri_state_bridge_data[17]
set_location_assignment PIN_E11 -to tri_state_bridge_data[18]
set_location_assignment PIN_D2 -to tri_state_bridge_data[19]
set_location_assignment PIN_E13 -to tri_state_bridge_data[20]
set_location_assignment PIN_E14 -to tri_state_bridge_data[21]
set_location_assignment PIN_A17 -to tri_state_bridge_data[22]
set_location_assignment PIN_D16 -to tri_state_bridge_data[23]
set_location_assignment PIN_C12 -to tri_state_bridge_data[24]
set_location_assignment PIN_A18 -to tri_state_bridge_data[25]
set_location_assignment PIN_F8 -to tri_state_bridge_data[26]
set_location_assignment PIN_D7 -to tri_state_bridge_data[27]
set_location_assignment PIN_F6 -to tri_state_bridge_data[28]
set_location_assignment PIN_E6 -to tri_state_bridge_data[29]
set_location_assignment PIN_G6 -to tri_state_bridge_data[30]
set_location_assignment PIN_C7 -to tri_state_bridge_data[31]

set_instance_assignment -name VIRTUAL_PIN ON -to tri_state_bridge_address[0]
set_instance_assignment -name TCO_REQUIREMENT "3.3 ns" -from * -to tri_state_bridge_address
set_instance_assignment -name TSU_REQUIREMENT "6 ns" -from * -to tri_state_bridge_data
set_location_assignment PIN_D18 -to write_n_to_the_cfi_flash
set_location_assignment PIN_E2 -to select_n_to_the_cfi_flash
set_location_assignment PIN_D17 -to read_n_to_the_cfi_flash
set_location_assignment PIN_C3 -to flash_reset_n

set_global_assignment -name RESERVE_FLASH_NCE_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_DATA1_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_DATA0_AFTER_CONFIGURATION "USE AS REGULAR IO"

set_global_assignment -name SDC_FILE boot_copier_test.sdc
set_global_assignment -name QIP_FILE boot_copier_test.qip

set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top



追加した事として、どっかの情報で、flash_reset_nなるものが必要と知った。
これは、SOPC Builderで生成されたVerilogトップ回路に対して、端子追加して、
Systemリセットをそのまま接続しただけ。
これで、以下設定。
  SOPC BuilerのNiosII設定: reset vector = CFI, offset=0x00
   exception vector = CFI, offset=0x20
  NiosII IDEのプロパティ : stderr=stdin=stdout=jtag_uartに設定。
                以下にチェック。
                  Program Never Exit
                  Reduced Device Driver
                  Small C library
                配置場所は以下。
                  text    = CFI
                  rodata   = CFI
                  rdata    = 内蔵SRAM
                  Heap Memory = 内蔵SRAM
                  Stack Memory= 内蔵SRAM
  Flash Programmer: 画面一番上の「Program software project into flash memory」のみチェック。
            また、SystemID回路入りなので、一番下の以下にチェック。
              「Validate Nios II system ID before software download」
            この設定で、「Program Flash」で焼きこみ開始すると以下メッセージ。

#!/bin/sh
#
# This file was automatically generated by the Nios II IDE Flash Programmer.
#
# It will be overwritten when the flash programmer options change.
#

cd C:/user/work/neek/boot_copier_test_software/boot_copier_test_software/Debug

# Creating .flash file for the project
"$SOPC_KIT_NIOS2/bin/elf2flash" --base=0x01000000 --end=0x1ffffff --reset=0x1000
000 --input="boot_copier_test_software.elf" --output="cfi_flash.flash" --boot="C
:/altera/10.0/ip/altera/nios2_ip/altera_nios2/boot_loader_cfi.srec"

# Programming flash with the project
"$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --base=0x01000000 --sidp=0x02019038
--id=95375189 --timestamp=1280234009 --instance=0 "cfi_flash.flash"
Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Resetting and pausing target processor: OK
Reading System ID at address 0x02019038: verified

: Checksumming existing contents

00000000 : Reading existing contents

Checksummed/read 24kB in 0.6s

00000000 ( 0%): Erasing

Erased 32kB in 0.4s (80.0kB/s)

00000000 ( 0%): Programming

Programmed 9KB +23KB in 1.2s (26.6KB/s)
Device contents checksummed OK
Leaving target processor paused



CPUリセットしたら、Flashへプログラム配置する前と同じ動作が出来た。
LEDチカチカとUART出力。これで、Flashへプログラム配置する事に成功したようだ。
結局、問題があったのは、Flashのピン配置ミスって事かな。
スポンサーサイト



カレンダー
06 | 2010/07 | 08
- - - - 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
累積訪問者
現在の訪問者
現在の閲覧者数:
最新記事
最新トラックバック
最新コメント
月別アーカイブ
カテゴリ
プロフィール

bobgosso

Author:bobgosso
FPGAのブログへようこそ!

検索フォーム
RSSリンクの表示
リンク
ブロとも申請フォーム

この人とブロともになる

QRコード
QRコード