Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

DE2 board and Qsys

I am looking for Qsys tutorials as they relate to my brand new DE2 board. Can anyone help me? I use winvista (32bit) Quartus 12.1 sp1.

Thanks: David Lee

10 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Terasic normally ship the board with "My First NIOS II Tutorial" and PDFs like that.

    The University Program site has additional tutorials:

    http://www.altera.com/education/univ/software/unv-software.html

    Click on the links on the left of that page, eg., Digital Logic.

    and here's one I wrote and posted on the wiki:

    http://www.alterawiki.com/wiki/using_the_usb-blaster_as_an_sopc/qsys_avalon-mm_master_tutorial

    There are several versions of the DE2 board; DE2, DE2-70, DE2-115. The tutorial just has the original DE2 board in there, but it'll be enough for you to get to grips with the tools.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Feedback for Altera JTAG-to-Avalon-MM Tutorial

    Note: My board is the DE2 (no# ) board from ALTERA

    I am using Quartus II 12.1 sp1with winvista32bit.

    1. Under 3.1 Project Creation > Add files: it does not say specifically which files to add it just has [page 2 of 5]. I tried several variations.

    2. Under 3.1 SOPC Builder Component (page 8) > bottom paragraph:

    These files… were not found in the project directory. Instead they were in

    C:\altera\quartus\bin

    a. bfm_master.v,

    b. jtag_master.v

    c. led_pio.v

    d. button_pio.v

    e. onchip_ram.v

    f. sopc_system.v

    3. Under 3.4 Synthesis first paragraph the file sopc_system.qip was found in C:\altera\quartus\bin. Also in this same paragraph the end statement says “press the play button on the GUI.” Could not find the “play button” so I assumed you meant the Start Compilation button so I pressed that.

    Here are the results: failed to compile

    Error (10161): Verilog HDL error at sopc_system_bfm_master_tb.sv(53): object "verbosity_pkg" is not declared

    Error (10161): Verilog HDL error at sopc_system_bfm_master_tb.sv(54): object "avalon_mm_pkg" is not declared

    Error: Quartus II 32-bit Analysis & Synthesis was unsuccessful. 2 errors, 0 warnings

    a. Error: Peak virtual memory: 323 megabytes

    THANKS: David Lee
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi David,

    Thanks for the feedback on the tutorial.

    Unfortunately Altera change how their Qsys tool works between versions. The tutorial was written and testing using 11.1sp1.

    I'll take a look at updating it for 12.1sp1, but I'm a little busy at the moment. Its possible to have multiple versions of Quartus installed. I recommend installing 11.1sp1 so that you can get things working correctly, and then you will understand how the tool works.

    There is a synthesis script that will automatically compile everything. You could start with that under 11.1sp1 to get a "built" design, and then work your way backwards to see what files etc that project included.

    This will be a good learning experience for you and will help you become comfortable with the tools.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Feedback for Altera JTAG-to-Avalon-MM Tutorial

    I am now using Quartus II 11.1 sp1 with winvista32bit.date: 4/8/13

    I have gone through this tutorial several times now to make sure I get it right. After the program synthesized I received the same error message “Synthesis not successful (4 errors)”. The two errors are below.

    In file: sopc_system_bfm_master_tb.sv

    Error (10161): Verilog HDL error at sopc_system_bfm_master_tb.sv(53): object "verbosity_pkg" is not declared

    Error (10161): Verilog HDL error at sopc_system_bfm_master_tb.sv(54): object "avalon_mm_pkg" is not declared

    Question? Can you tell me how to resolve these errors?

    Perhaps you could send me your completed synthesized project file, it should be around 1MB or so, and could try running that.

    Thanks David Lee
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Perhaps you could send me your completed synthesized project file, it should be around 1MB or so, and could try running that.

    --- Quote End ---

    Sure, I'll download the zip file and go through each step to confirm it works.

    I'll upload the project file shortly.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi David,

    I can confirm that Quartus 11.1sp1 should work Ok, but that 12.1sp1 is broken (due to Altera's changes in their generated scripts).

    Please follow the sequence below for Quartus 11.1sp1 and let me know if you still have trouble.

    Cheers,

    Dave

    
    JTAG-to-Avalon-MM Tutorial on the DE2
    -------------------------------------
    4/8/2013 D. W. Hawkins (dwh@ovro.caltech.edu)
    The tutorial was written using Quartus II 11.1sp1. The following test was performed
    using 11.1sp2.
    -------------------------------------------------------------------------------
    Quartus II 11.1sp2 - Synthesis+Simulation Build Procedure
    ---------------------------------------------------------
    1. Download the zip file from the Altera Wiki
    http://www.alterawiki.com/wiki/Using_the_USB-Blaster_as_an_SOPC/Qsys_Avalon-MM_master_Tutorial
       Save as c:/temp/altera_jtag_to_avalon_mm_tutorial.zip
    2. Unzip it
    3. Start Quartus II 11.1sp2
       I used a VirtualBox VM with Windows-XP and Quartus 11.1sp2
       for this test.
    4. Select the Tcl console
    5. Change directory to the Qsys build
       tcl> cd {C:\temp\altera_jtag_to_avalon_mm_tutorial\hdl\boards\de2\qsys_system}
       
    6. Source the synthesis script
       tcl> source scripts/synth.tcl
       
       The output is
       
       Synthesizing the DE2 'qsys_system' design
       -----------------------------------------
        - Quartus Version 11.1 Build 259 01/25/2012 Service Pack 2 SJ Full Version
        - Creating the Quartus work directory
          * C:/Temp/altera_jtag_to_avalon_mm_tutorial/hdl/boards/de2/qsys_system/qwork
        - Create the project 'de2'
          * create a new de2 project
        - Check the Qsys system
          * Copying the Qsys system file to the build directory
          * Please run Qsys, click on the 'Generation' tab, select 'Verilog'
            for 'Create simulation model', and click the 'Generate' button
            to generate the Qsys system,  and then re-run this script
       Per the instruction, run Qsys, open qsys_system.qsys, and click on the generate tab.
       Change the "Create Simulation Model" pull-down menu to create the Verilog simulation
       directory, i.e., the folder qwork/qsys_system/simulation once things are generated.
       
       Click the "Generate" button to generate the system
       
       Re-run the script by sourcing it again
       
       tcl> source scripts/synth.tcl
       The output is
       
       Synthesizing the DE2 'qsys_system' design
       -----------------------------------------
        - Quartus Version 11.1 Build 259 01/25/2012 Service Pack 2 SJ Full Version
        - Create the project 'de2'
          * close the project
          * open the existing de2 project
        - Check the Qsys system
        - Creating the design files list
        - Applying constraints
        - Processing the design
        - Processing completed
       This confirms that the project synthesizes correctly under Quartus II 11.1sp2.
    7. Start Modelsim
       Modelsim-ASE 10.0c was used for this test (the version used by Quartus 11.1sp2)
       
    8. Change directory per the instructions in the tutorial PDF, which in my case was
       
       Modelsim> cd {C:\temp\altera_jtag_to_avalon_mm_tutorial\hdl\qsys_system}
    10. Edit the simulation script
       Since this project is using the DE2 board, not the BeMicro-SDK, edit the
       script in scripts/sim.tcl to change the board name from bemicro_sdk to de2
       
       i.e., change the line
       
       set board $hdl/boards/bemicro_sdk
       
       to
       
       set board $hdl/boards/de2
    11. Run the simulation script
       Modelsim> source scripts/sim.tcl
       
       The script ends with the message:
       
      #  JTAG-to-Avalon-MM tutorial testbench procedures 
      #  ----------------------------------------------- 
      #   
      #    qsys_system_bfm_master_tb  - run the Avalon-MM BFM testbench 
      #    qsys_system_jtag_master_tb - run the JTAG-to-Avalon-MM testbench 
       
       Type in one of these procedures (copy-and-paste it to the console) to run
       the two testbenches described in the tutorial PDF.
       
       For example
       
       Modelsim> qsys_system_bfm_master_tb
       
       ... lots of messages from Modelsim ... and then messages from the testbench
       
       #  ===============================================================
       #  JTAG-to-Avalon-MM SOPC System Testbench (using the BFM master)
       #  ===============================================================
       #  
       #  0:  verbosity_pkg.set_verbosity: Setting Verbosity level=4 (VERBOSITY_INFO)
       #   * Deassert reset
       #  
       #  -----------------------------------------------
       #  1: Test the LEDs.
       #  -----------------------------------------------
       #   * Write 0xAA to the LEDs
       #     - LED register value = aah
       #     - LED port value = aah
       #   * Walking 1's test
       #     - LED port value = 01h
       #     - LED port value = 02h
       #     - LED port value = 04h
       #     - LED port value = 08h
       #     - LED port value = 10h
       #     - LED port value = 20h
       #     - LED port value = 40h
       #     - LED port value = 80h
       #  
       #  -----------------------------------------------
       #  2: Test the push buttons.
       #  -----------------------------------------------
       #   * Push button value = 55h
       #   * Walking 1's test
       #     - Push button value = 01h
       #     - Push button value = 02h
       #     - Push button value = 04h
       #     - Push button value = 08h
       #     - Push button value = 10h
       #     - Push button value = 20h
       #     - Push button value = 40h
       #     - Push button value = 80h
       #  
       #  -----------------------------------------------
       #  3: Test the on-chip RAM.
       #  -----------------------------------------------
       #   * Fill 1024 locations of RAM with an incrementing count
       #   * Read and check the RAM
       #  
       #  ===============================================
       #  Simulation complete.
       #  ===============================================
       #  
       
       and then try the other testbench
       
       Modelsim> qsys_system_jtag_master_tb
       
       ... lots of messages from Modelsim ... and then messages from the testbench
       (this simulation takes a *lot* longer to run, since the testbench commands
        need to be serialized over JTAG)
       #  ===============================================================
       #  JTAG-to-Avalon-MM Qsys System Testbench (using the JTAG master)
       #  ===============================================================
       #  
       #   * Reset the JTAG controller
       #   * Deassert reset
       #  
       #  -----------------------------------------------
       #  1: Test the JTAG protocol special character codes.
       #  -----------------------------------------------
       #   * Check the JTAG-to-Avalon-ST special codes encode/decode as data: 4a4dh
       #   * Check the bytes-to-packets special codes encode/decode as data: 7a7b7c7dh
       #  
       #  -----------------------------------------------
       #  2: Test the LEDs.
       #  -----------------------------------------------
       #   * Write 0xAA to the LEDs
       #     - LED register value = aah
       #     - LED port value = aah
       #   * Walking 1's test
       #     - LED port value = 01h
       #     - LED port value = 02h
       #     - LED port value = 04h
       #     - LED port value = 08h
       #     - LED port value = 10h
       #     - LED port value = 20h
       #     - LED port value = 40h
       #     - LED port value = 80h
       #  
       #  -----------------------------------------------
       #  3: Test the push buttons.
       #  -----------------------------------------------
       #   * Push button value = 55h
       #   * Walking 1's test
       #     - Push button value = 01h
       #     - Push button value = 02h
       #     - Push button value = 04h
       #     - Push button value = 08h
       #     - Push button value = 10h
       #     - Push button value = 20h
       #     - Push button value = 40h
       #     - Push button value = 80h
       #  
       #  -----------------------------------------------
       #  4: Test the on-chip RAM.
       #  -----------------------------------------------
       #   * Fill 32 locations of RAM with an incrementing count
       #   * Read and check the RAM
       #  
       #  ===============================================
       #  Simulation complete.
       #  ===============================================
       #     
       This confirms that the project simulates correctly under Quartus II 11.1sp2
       with Modelsim-ASE 10.0c.
       
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Question? Have you tried running your programs on a windows VISTA computer? I believe this is my main problem. I use winvista32bit, and I know from researching this problem there are compatibility issues with VISTA. Thanks David Lee

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Question? Have you tried running your programs on a windows VISTA computer? I believe this is my main problem. I use winvista32bit, and I know from researching this problem there are compatibility issues with VISTA. Thanks David Lee

    --- Quote End ---

    You're wasting your time trying to use anything but the supported operating systems:

    http://www.altera.com/download/os-support/oss-index.html

    You can keep Vista installed if you want to, but you should install VirtualBox and then install a supported operating system.

    I have a dozen or so VMs with versions of Quartus/Modelsim under Centos(RedHat)/WinXP/Win7 that I use when confirming scripts and tutorials work.

    Cheers,

    Dave