⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 altera的fpga设计
💻 TXT
字号:
===============================================================================
                 Nios II Multiprocessor Design Example
===============================================================================

Requirements:
  Quartus II version 6.0
  Nios II version 6.0
  Nios Development Board
    Cyclone II Edition 
    - or -
    Stratix II ROHS Edition


Instructions for running software on the the multiprocessor example.
-------------------------------------------------------------------------------

Configure the Board

  1.)  Connect power and a USB Blaster to your development board

  2.)  Start Quartus II and open the project "multi_cpu.qpf", included with this
       example

  3.)  Open the Quartus II Programmer by selecting Programmer from the Tools
       menu.

  4.)  Configure the FPGA by selecting multi-cpu.sof, checking the
       Program/Configure check box and clicking Start.


Erase the flash (This step is important)

  Since each processor will attempt to boot from flash as soon as the FPGA is
  configured, we should erase the flash first to make sure it does not contain 
  any code that will interfere with our multiprocessor system.
 
  1.)  Open a Nios II Command Shell
       - Start->All Programs->Altera->Nios II EDS 6.0->Nios II Command Shell

  2.)  Type the following command:
       - nios2-flash-programmer --base=0x0 --instance=1 --erase-all
       
       
Run software on the hardware example

  1.)  From Quartus II, select 'SOPC Builder' from the 'Tools' menu

  2.)  In SOPC Builder, click the 'System Generation' tab

  3.)  Start Nios II IDE by clicking 'Run Nios II IDE'


Set up Nios II IDE for Multiprocessor Debug

  By default Nios II IDE is set to not allow multiple active debug sessions. To
  enable multiple debug sessions, perform the following steps:

  1.)  Select 'Preferences' from the 'Window' menu

  2.)  Select Nios II and turn on 'Allow multiple active run/debug sessions'

  3.)  Click OK.


Create a software project for cpu1

  1.)  Create a new software project
        - Click File -> New
        - Select 'C/C++ Application'
        - Type "hello_multi_cpu1" in the 'Name' field
        - Select 'cpu1' under 'Select Target Hardware'
        - Select 'Blank Project' from 'Select Project Template'
        - Click Finish

  2.)  Using a file system browser, locate the source file hello_world_multi.c
       included with this example the 'software' directory.  Copy this file to 
       the clipboard using CTRL-C or by right-clicking it and selecting Copy.

  3.)	 In Nios II IDE, paste the source files into the new project by
       highlighting the project, then pressing CTRL-V or right-clicking the 
       project and selecting Paste
 
  4.)  Setup the System Library Project for cpu1
        - Right-click the system library project hello_multi_cpu1_syslib
        - Select Properties
        - In the left-hand pane, select System Library
        - Verify 'jtag_uart' is selected for stdin, stderr, and stdout.
        - Verify that 'sdram' is selected for
            - Program Memory
            - Read-only data memory
            - Read/write data memory
            - Heap memory
            - Stack memory
        - Click OK


Create a software project for cpu2

  1.)  Create a new software project
        - Click File -> New
        - Select 'C/C++ Application'
        - Type "hello_multi_cpu2" in the 'Name' field
        - Select 'cpu2' under 'Select Target Hardware'
        - Select 'Blank Project' from 'Select Project Template'
        - Click Finish

  2.)  Using a file system browser, locate the source file hello_world_multi.c
       included with this example the 'software' directory.  Copy this file to 
       the clipboard using CTRL-C or by right-clicking it and selecting Copy.

  3.)	 In Nios II IDE, paste the source files into the new project by
       highlighting the project, then pressing CTRL-V or right-clicking the 
       project and selecting Paste
 
  4.)  Setup the System Library Project for cpu2
        - Right-click the system library project hello_multi_cpu2_syslib
        - Select Properties
        - In the left-hand pane, select System Library
        - Verify 'null' is selected for stdin, stderr, and stdout.
        - Verify that 'sdram' is selected for
            - Program Memory
            - Read-only data memory
            - Read/write data memory
            - Heap memory
            - Stack memory
        - Click OK


Create a software project for cpu3

  1.)  Create a new software project
        - Click File -> New
        - Select 'C/C++ Application'
        - Type "hello_multi_cpu3" in the 'Name' field
        - Select 'cpu3' under 'Select Target Hardware'
        - Select 'Blank Project' from 'Select Project Template'
        - Click Finish

  2.)  Using a file system browser, locate the source file hello_world_multi.c
       included with this example the 'software' directory.  Copy this file to 
       the clipboard using CTRL-C or by right-clicking it and selecting Copy.

  3.)	 In Nios II IDE, paste the source files into the new project by
       highlighting the project, then pressing CTRL-V or right-clicking the 
       project and selecting Paste
 
  4.)  Setup the System Library Project for cpu3
        - Right-click the system library project hello_multi_cpu3_syslib
        - Select Properties
        - In the left-hand pane, select System Library
        - Verify 'null' is selected for stdin, stderr, and stdout.
        - Verify that 'sdram' is selected for
            - Program Memory
            - Read-only data memory
            - Read/write data memory
            - Heap memory
            - Stack memory
        - Click OK


Build the Software Projects

  1.)  Right-click the project hello_multi_cpu1 and select Build Project

  2.)  Right-click the project hello_multi_cpu2 and select Build Project

  3.)  Right-click the project hello_multi_cpu3 and select Build Project
 
  
Create a Run Configuration for Each Processor

	Perform the following for each of the projects:
	  - hello_multi_cpu1
	  - hello_multi_cpu2
	  - hello_multi_cpu3
	  
  1.)  Highlight the project in Nios II IDE by clicking it

  2.)  From the Run menu, select 'Run...'

  3.)  Select Nios II Hardware in the 'Configurations' list

  4.)  Click New in the lower-left corner of the Run dialog box.

  5.)  Click the Target Connection tab

  6.)  Ensure the download cable you are using is selected in the JTAG cable
       field.  If the field reads Automatic<currently (your correct download 
       cable)>,this is fine. You do not need to change it.


Create a Multiprocessor Collection
 
  1.)  From the Run menu, select 'Run...'

  2.)  In the Configurations list, select Nios II Multiprocessor Collection

  3.)  Click New in the lower-left corner of the Run dialog box.

  4.)  In the Name field, type hello_cpu_collection as the name for this new
       multiprocessor collection

  5.)  Check the following hardware configurations to run concurrently:
         - hello_multi_cpu1 Nios II HW configuration
         - hello_multi_cpu2 Nios II HW configuration
         - hello_multi_cpu3 Nios II HW configuration
  6.)  Click Apply
 

Run the Multiprocessor Collection

  1.)  Select the hello_cpu_collection configuration, and click Run

  2.)  After the launch finishes, you should see messages from all three
       processors being displayed in the Console view

  3.)  When you are done observing the Console output, click Terminate (the
       square red button on the Console view toolbar) to close the terminal 
       connection.
 
 
  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -