[Documentation]. Amy electronics-getting started with Verilog us II designed using OpenGL

Source: Internet
Author: User
ArticleDirectory
    • Typical CAD Process
    • 1. Start
    • 2. Create a project
    • 3. Design the input using the OpenGL code
    • 4. Compile and design the circuit
    • 5-pin allocation
    • 6. circuit designed by Simulation
    • 7 Programming and configuring FPGA Devices
    • 8. Test and Design circuit
Description

Part of this article, from my translation of the terasic DE2-115 in English entry documents.

 

Platform

Hardware: Amy electronic EP2C8-2010 enhanced edition Kit

Software: Quartus II 10.0 + Modelsim-Altera 6.5e (Quartus II 10.0) Starter Edition

 

Content
    • Typical CAD Process
    • Start
    • Create a project
    • Input into the design
    • Compilation Design
    • Pin allocation
    • Simulation Design circuit
    • Programming and configuration to FPGA Devices
    • Test and Design circuit

 

Typical CAD Process

The computer-aided design (CAD) software makes it easy to use programmable logic devices to implement the required logic circuit. For example, field programmable gate array (FPGA ). The typical fpga cad design process 1 is shown.

Figure 1 Typical fpga cad design process

 

The CAD process includes the following steps:

    • Design input-the required circuit can be designed through schematic or hardware description language (such as OpenGL or VHDL.
    • Integration-the input design is integrated into a circuit consisting of logical elements (provided by the LES, FPGA chip.
    • Function simulation-the integrated circuit is tested to verify whether its function is correct. timing factors are not considered in the secondary simulation.
    • Layout and wiring-the CAD fitter tool determines how the Les defined in the net table is arranged into the actual les in the FPGA chip.
    • Timing Analysis: analyzes the propagation latency of different paths in a laid-out wiring circuit to indicate the performance of the circuit.
    • Timing simulation-test the layout of the wiring circuit to verify whether it is functional and timing correct.
    • Programming and configuration-the designed circuit is implemented to a physical FPGA chip through programming and configuration switch. The configuration switch is used to configure LEs and establish the required line connection.

 

This Guide describes the basic features of the Quartus II software. Demonstrate how to design and implement a circuit using the hardware description language of OpenGL. Use the GUI to implement the Quartus II command. With this guide, you will learn:

    • Create a project
    • UseCodeEntry Design
    • Deploy the integrated circuit to Altera FPGA
    • Allocation circuit input and output to the specified pin on FPGA
    • Simulation Design circuit
    • Programming and configuring the FPGA chip on the ep2c8 core board of Amy Electronics

 

1. Start

Each logical circuit or sub-circuit designed in Quartus II is called an engineering. Each time the software runs a project, all information is saved in a single folder. To start a new logical circuit design, the first step is to create a folder to save files. To save the design files of this Guide, create an introtutorial folder on drive D. A Simple Dual-path lighting control circuit is used as an example for the operator.

Open the Quartus II software and you will see a picture similar to Figure 2. The screen contains several windows. You can use the mouse to select and access functions of Quartus II. Most of the commands provided by Quartus II can be accessed through menus. For example, in Figure 2FileClick the left button under the tab to open the menu shown in 3. Left clickExitYou can exit Quartus II.

Figure 2 Quartus II Subject display

 

Figure 3 File menu example

 

For some commands, you need to access two or more menus consecutively.

 

1.1 Quartus II online help

The Quartus II software provides easy-to-understand online documentation to answer many questions when using the software. You can selectHelp> SearchTo quickly access Help topics. In the displayed dialog box, you can enter keywords. Another method is to sense help in content to quickly find documents on a specified topic. In most applications, press and holdF1 keyA help window showing the available commands of the application is displayed.

 

 

2. Create a project

To create a project, follow these steps:

1. SelectFile> New Project WizardTo open the window shown in Figure 4.Don't show me this introduction againSkip this step. ClickNext, The window shown in Figure 5 appears.

Figure 4 task display

 

Figure 5 create a new project

 

2. Select a jobCompositionFolder introtutorial, you can also use your own folder. The project must have a name, which is usually the same as the name of the top-level design entity. 5. Select light as the project name and top-level entity name. ClickNext. Because the introtutorial folder has not been created, Quartus II displays a dialog box asking if you want to create a new folder, as shown in 6. ClickYesThe window shown in Figure 7 is displayed.

Figure 6 create a new project folder or not?

 

Figure 7 Add a user-specified design File

 

3. If no existing design file exists, clickNext. The screen shown in Figure 8 is displayed.

Figure 8 select a device family and a specified device

 

4. The ep2c8 core board of Amy electronic adopts the Cyclone II ep2c8q208c8 device. Select the Cyclone II device family, which is an pqfp package with 208 pins and a speed grade of 8. Click Next. The image shown in Figure 9 is displayed.

Figure 9 specify a third-party EDA tool

 

5. You can specify some third-party EDA tools. For continuous simulation, use Modelsim-Altera in the format of OpenGL. ClickNext, The window shown in Figure 10 appears.

 

6. The configuration list is shown in 10. ClickFinish, Returns the Quartus II Main Window. The title bar displays the light project, as shown in Figure 11.

Figure 10 overview of Project Settings

 

Figure 11 Quartus II shows the created Project

 

3. Design the input using the OpenGL code

As a design example, we will use a dual-path lighting control circuit, as shown in 12. This lamp can be controlled by any of the two buttons, X1 and X2. The corresponding logical value of the button closure is 1. The truth table is also given in the figure. Note that the input X1 and X2 are in an exclusive or relationship, but we still use the door to display them.

Figure 12 Lighting Control Circuit

 

The required circuit, as shown in Figure 13, is described using the OpenGL code. Note that the name of the OpenGL module is light, and the name shown in Figure 5 is the same. You can use any text editor that stores ASCII codes or the editor that comes with Quartus II to edit this code. Of course, the file name can be retrieved at will. The name is the same as that of the top-level OpenGL module, which is a design convention. The file name must contain the. V Extension to indicate that the file is. All, we use the name light. v.

Figure 13. The circuit's OpenGL code shown in Figure 12

 

3.1 Use the Quartus II Text Editor

This section describes how to use the Quartus II text editor. You can skip this section if you prefer to use another text editor to create the source file. SelectFile> NewOpen the window shown in figure 14 and select---And clickOK. This opens the text editor window. The first step is to specify the name of the created file. SelectFile> SaveTo open the dialog box shown in Figure 15. Select the storage type of the file to be stored in the format of OpenGL and enter the name light. v. ClickSaveTo open the window shown in Figure 16. Enter the code shown in Figure 13. Use Ctrl + S to save the file.

Figure 14 select the new file type

 

Figure 15 name file

 

Figure 16 text editor window

 

3.1.1 use the OpenGL Template

For designers, the syntax of Tilde is sometimes hard to remember. To solve the problem, the text editor provides a set of OpenGL templates. These templates provide examples of different types of OpenGL expressions, suchModuleStatement,AlwaysBlock and set statement. You can useEdit> insert template> maidTo get familiar with these resources.

 

3.3 Add the design file to the Project

As discussed in Article 7, we can tell the Quartus II software which files are part of the current project. To view the list of files included in the current light project, selectAssignment> setting> FileThis will open the screen shown in figure 17. Another available method is to select tags.Project> Add/Remove files in Project.

When you create a file using the Quartus II text editorAdd file to current projectThe created file is automatically added to the project file list. If you are not using the text editor provided by Quartus II, no files are created in Figure 17 and the files must be manually added to the project file list. To add a file to the project file list, clickFile Name:. The dialog box shown in Figure 18 is displayed. Select light. V and clickOpen. View the figure 17 again. The added file is already in the file list. In most cases, the Quartus II software can automatically find the correct file based on each entity, even if some files are not carefully added to the project.

However, for complex projects that contain many files, it is a good design practice to add a specified file to the project according to the above method.

Figure 17 setting window

 

Figure 18 select a file

 

4. Compile and design the circuit

In light. V, the OpenGL code is processed by several Quartus II tools: Analysis Code, integrated circuit, and implementation of the target chip. These applicationsProgramIs aggregated and called a compiler.

SelectProcessing> Start CompilationRun the compiler, or click the button to run the program. During compilation, the progress of each stage is displayed on the left of us II. After the compilation succeeds (or fails), a dialog box is displayed.

ClickOKConfirm. Qartus II displays the compilation report on the screen shown in Figure 19. After the compilation is successful, you can also click the button to manually open the compilation report.

Figure 19 compile the report

 

On the left side of this window, a list of many information items is listed. As shown in Figure 19, this project uses one le and three pins.

 

Error 4.1

During compilation, Quartus II displays the generated message in the message window. If the design is correct, one of the messages will show that the compilation is successful and there is no error.

If the compilation is not zero, at least one error is found in the Tilde code. In this case, the message corresponding to the error is displayed in the message window. Double-click an error message, and the information will be displayed in a scroll. When Quartus II comes with a text compiler, a line in the OpenGL code will be highlighted. Similarly, the compiler displays many warning messages. The same method can also be used to view the complete warning message. For an error or warning message, if you want more information, you can select this message and pressF1Function key.

We changed the last line of light. V to endmodules and re-compiled it. In the Quartus II pop-up dialog box, report compilation errors. Click OK to confirm. The compilation report 20 is shown. In the message window, clickErrorTag to display the message shown in Figure 21. Double-click the first error message. The Quartus II Text Editor opens light. V and the last line is highlighted, as shown in 22. Correct the code and re-compile it until it is successful.

Figure 20 compile the report

 

Figure 21 error message

 

Figure 22 shows the location of the error code

 

 

5-pin allocation

In Amy electronic EP2C8-2010 enhanced Kit, we use LED [1] to represent F, SW [1] and SW [2] to represent X1 and X2, respectively, as shown in pin ing 23. Use the text editor to create a new file named pins 'list.txt. Enter the content shown in Figure 24. SelectAssignments> Import assignmentsTo open the window shown in Figure 25. Select the pins 'list.txt path and click OK to import the pin configuration. SelectAssignments> pin Planner(Or click the button) to open the window shown in Figure 26 and check whether the pins are correctly allocated.

Figure 23 pin ing

 

Figure 24 pin allocation file-pins 'list.txt

 

Figure 25 import settings

 

Figure 26 view pin allocation

 

5.1 configure unused pins

Unused pins require certain constraints. Without these constraints, some inexplicable problems may occur. Select assignments> device and pin Options> unused pins to open the window shown in Figure 27. In general, configure as shown in Figure 28.

Figure 27 configuring unused pins

 

Figure 28 configure unused pins as three-state input

 

6. circuit designed by Simulation

Before Amy electronic EP2C8-2010 enhanced edition kit implements the required circuit, it is prudent to first simulate to determine whether the design circuit is correct. The following describes how to use Modelsim-Altera simulation:

 

6.1 create a testbench File

Use the text editor to create a new testbench file. The file type is the same as that in Figure 9. Name it light_tb.v. Do not check the file type.Add file to current projectYou cannot add it to the Quartus project folder list. Enter the code shown in Figure 29.

Figure 29 light_tb.v

 

6.2 set Modelsim-Altera path

To use Modelsim for the first time, you must first set the Modelsim-Altera path. SelectTools> Options> General> EDA tool optionsOpen the EDA tool and select, 30, and set the path. ClickOK, Return to the Quartus II topic interface.

Figure 30 set the Modelsim-Altera path

 

6.3 add test files required for Simulation

SelectAssignments> setting> EDA tool setting> SimulationTo open the window shown in Figure 31. InNativelink settingUnder, selectCompile test example:Label, clickTest benchesButton to open the window shown in Figure 32. ClickNewIn the dialog box that appears, name Test Development name: light_tb (consistent with light_tb.v ).File Name:Click... Click to add the light_tb file path.Add, As shown in 33. Three consecutive clicksOK, Return to the Quartus II topic window.

Figure 31 simulation option settings

 

Figure 32 specify test benches

 

Figure 33 add Test benches

 

Start simulation 6.4

SelectTools> run eda simulation tool> eda rtl simulationTo perform RTL simulation. or selectTools> run eda simulation tool> EDA gate level simulationTo perform door-level simulation. Here we use RTL simulation as an example. SelectTools> run eda simulation tool> eda rtl simulation, The Simulation Screen shown in Figure 34 is displayed. Wait a moment to see the waveform.

Figure 34 Modelsim-Altera Simulation Screen

 

InWaveIn the upper-right corner of the window, click to maximizeWaveWindow to view waveforms, as shown in Figure 35. Place the mouse over the waveform you want to view, and press and holdCTRLAnd scroll the mouse to zoom in and out the waveform.

Figure 35 view Waveforms

 

 

7 Programming and configuring FPGA Devices

7.1 install and download a cable driver

    • USB-blaster user, please refer to http://www.altera.com.cn/literature/ug/ug_usb_blstr.pdf
    • Byteblster II user, please refer to http://www.altera.com.cn/literature/ug/ug_bbii.pdf
    • Ethernetblster user, please refer to http://www.altera.com.cn/literature/ug/ug_ebcc.pdf

 

7.2 JTAG Programming

Connect the USB-blster with the FPGA Development Board, power on the FPGA development board, and return to the Quartus II Theme window. SelectTools> progrmmerOr click the button to open the window shown in Figure 35. SelectModeIs JTAG. By default, USB-blaster is not selected. ClickHardware setupIn the displayed window, select USB-blster, 36, and clickCloseExit.

Figure 36 programmer window

 

Figure 37 hardware settings window

 

As shown in Figure 37, light. Sof is included in the window. If not, clickAdd File, Select the light. Sof file to add. This is a binary file generated by the compilation module of the compiler. It contains the data for configuring FPGA Devices .. The suffix of the sof file, indicating the SRAM object file ). You can also note that the selected device is ep2c8q208, that is, the device used in the Amy ep2c8 package. CheckProgram/configure, ClickStartStart download.

Figure 38 download the target SRAM File

 

8. Test and Design circuit

After the download is complete, you can test the implemented circuit. Use SW [1] and SW [2] to enter all possible values and observe whether the LED [1] is on or off as expected.

 

Advanced Reading

1. Altera. Document: Quartus II Software Development

Reference

1. terasic. de2_115_v.1.0_cdrom \ de2_115_tutorials \ tut_quartus_intro_1_logstores

 

See also

[Study FPGA/FPGA with Amy]. [logical experiment document serialization plan]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.