[Serialization] [FPGA black gold Development Board] Those things of OpenGL-basic of low-level modeling (2)

Source: Internet
Author: User
ArticleDirectory
    • Chapter 2: Foundation of Low-Level Modeling
    • Experiment 1 Configuration
Disclaimer: This article is an original work and copyright belongs to akuei2 and heijin power Community All together, if you need to reprint, please indicate the source http://www.cnblogs.com/kingst/

Chapter 2: Basic 2.1 Sequence operations and parallel operations for low-level modeling

Sequential and parallel operations are a key issue for beginners. However, this must be well understood to bring low-level modeling to its limit. Although it is different from other advanced languages in good structure, the biggest advantage of the hardware description language is parallel operations.

Ordered operations are like steps. If the previous action is not completed, the next action is meaningless. Parallel operations are the most different in that both actions are executed independently and do not affect each other. Then, we will understand their differences from a typical experiment "Water lamp experiment.

It is a "streaming lamp experiment" created in different ways ".

1) light the first led and delay for a period of time.

2) light the second led and delay for a period of time.

3) light the third led and delay for a period of time.

4) light the fourth led and delay for a period of time.

5) Repeat the first step.

From the above point of view, we understand that "the generation of the effect of the water lamp" mainly follows five steps in order. This may be a natural way of thinking. Humans are really strange animals. Although human brains operate in parallel, human thinking tends to be "sequential ". Why?

If the actual examples are referenced, if the four LEDs lose the "conductor", they will go on strike! Because they lose the second party of the "execute sending code", this is the case if the above content does not have "1", "2", "3", "4 ", how do you understand the words "5", how do you generate a flow lamp?"

In other words, "sequential operations" often refer to the existence of a "conductor" or "controller" and execute "work order (Steps )".

I believe many of my friends who have studied FPGA have learned MCU. When learning single-chip microcomputer, it may be the relationship between C language or assembly language, so many friends are used to the concept of "sequential operation" without knowing it. New users often ignore the concept of sequential operation and parallel operation in FPGA. If you ignore them from the very beginning, it will be difficult to avoid bottlenecks in the future.

So what is the "Parallel Operation" flow lamp? The results are as follows...

Lab 1: Permanent flow lights.

In this experiment, we need to build a parallel operation of the flow lamp module. The scan frequency is set to 100Hz, and each function module increases the output within a specific period of time.

As follows:

We can see that function module 1 pulls high output from the first 1/4 in time, function module 2 pulls high output from the second 1/4 in time, and the other two functional modules also follow the same rule. Therefore, in a fixed period of time (10 ms), each function module takes 2.5 ms.

Source code of Experiment 1:

Tutorial 1:

Note: The lab file is under./experiment01. For the modeling process, see "Experiment 1 configuration ".

The source code of led0_module.v, led1_module.v, led2_module.v, and led3_module.v is similar. Row 12th is a constant Declaration of the 10 ms counter. 16th ~ The 24 rows are a counter with a counter range of 10 ms. From 28 ~ Lines 36 determine the differences between the four functional modules.

The led0_module.v function module is the first 1/4 high output in time.

The led1_module.v function module is the second 1/4 high output in time.

The led2_module.v function module is the third 1/4 high output in time.

The led3_module.v function module is used to pull high output at the fourth 1/4 of the time.

Top. V is a top-level module used to organize these four functional modules.

Experiment 1 Summary:

From the results of the experiment, the "Parallel Operation" is similar to "sequential operation" in reality. However, there is a big difference in understanding.

The led0_module.v function module is the first 1/4 high output in time.

The led1_module.v function module is the second 1/4 high output in time.

The led2_module.v function module is the third 1/4 high output in time.

The led3_module.v function module is used to pull high output at the fourth 1/4 of the time.

The above content indicates that the four functional modules are operated independently. Because the output is different in time, the effect of the flow lamp is visible to the naked eye. From a realistic perspective, there are just four inner people who have no relationship. Each of them completes their work at their own pace. In the eyes of outsiders, they have a tacit understanding and can complete tasks without the need of "commanders.

Let's talk a little outside of the box here. Although the degree of modeling for "parallel operations" is cumbersome. However, it is very suitable for "FPGA + OpenGL. We usually DesignProgramWhen the "sequential operation" thinking is used unconsciously, if the "Parallel Operation" can also be used unconsciously, there will be many "Possibilities" in program design ".

Experiment 1 Configuration

Black gold FPGA model: Cyclone II ep2c8q208c8

1. You have added five. V files to the experiment. After the compilation is successful, the hierarchy will be shown in another figure. Top_module file organization

Four other functional modules.

2. About the circuit pins of the black gold edition "clock (CLK)" and "RESET (rstn.

3. The hardware resources used in Experiment 1 include four LEDs"

Open: Assignments => pin planner <Ctrl + Shift + n>

4. pin configuration as above

5. Completed Block Diagram

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.