Principles of phase-locked loop technology and FPGA implementation (Chapter 1.4)

(2) Menu bar. The menu bar mainly consists of File, Edit, View, Project,
Assignments, Processing, Tools, Window and Help 9 It consists of a drop-down menu, among which Project, Resource Assignments, Processing, and Tools focus on all the core operation commands of the Quartus II software, which are introduced separately below.
The Project menu is mainly for some operations on the project.
         Add/Remove Files in Project: Add or create a new resource file of some kind.
         Revisions: Create or delete a project, click the "Create" button in the pop-up window to create a new project; or select one of several created projects and click the "Set Current" button to save the selected project. The project is set to the current project.
         Archive Project: Archive or back up the project.
         Generate Tcl File for Project: Generate the Tcl script file of the project. Select the file name and path to be generated and click the "OK" button. If "Open generated file" is selected, the Tcl file will be opened in the project workspace.
         Generate Power Estimation File: Generate a power estimation file.
         HardCopy Utilities: Functions related to HardCopy devices.  Locate: Locate
        the nodes in the Assignment Editor or the signals in the source code in the compiled layout and wiring diagram, Chip Editor or source file.          Set as Top-level Entity: Set the file opened in the project workspace as the top-level file.          Hierarchy: Open the source file at the upper or lower level of the source file displayed in the project workspace, as well as the top-level file.          Device: Set the target device model.          Assign Pins: Open the Assign Pins dialog box and assign IO pins to the designed signals.          Timing Settings: Set up EDA tools, such as Synplify, etc.          Settings: Open the parameter setting page, and you can switch to the parameter setting page required for each step of the Quartus II software development process.          Wizard: Start timing constraint setting, compilation parameter setting, simulation parameter setting, Software Build parameter setting.          Assignment Editor: Assignment editor, used to assign pins, set pin level standards, set timing constraints, etc.          Remove Assignments: Users can use it to delete set type assignments, such as pin assignments, timing assignments, etc.          Demote Assignment: Allows users to downgrade the current less stringent constraints, allowing the compiler to compile assignments and constraints more efficiently.          Back-Annotate Assigments: Allows users to back-annotate pins, logic units, nodes, wiring assignments, etc. in the project .          Import Assigments; import assignment files to the current project.          Timing Closure Foorplan: Start the timing closure floor planer.          LogicLock Region: Allows users to view, create and edit LogicLock region constraints and import and export LogicLock region constraint files. The Processing menu includes executing various design processes for the current project, such as starting synthesis, starting placement and routing, starting timing analysis, etc. The Tools menu is used to call some tools integrated in the Quartus II software, such as MegaWizard Plug-In manager (used to generate IP cores and mega function modules), Chip Editor, RTL Viewer, Programmer, etc.         (3) Toolbar. The toolbar contains shortcut icons for commonly used commands. Move the mouse to the corresponding icon, the corresponding meaning of the icon will appear under the mouse, and the corresponding command menu can be found in the menu bar for each icon. Users can customize their commonly used functions as icons on the toolbar according to their needs, so as to facilitate various operations in the Quartus II software flexibly and quickly.         (4) Resource management window. The resource management window is used to display all related resource files in the current project. There are three tabs in the lower left corner of the resource management window , namely Hierarchy, Files and Design Units. The structure hierarchy window only displays the top-level module name before the project is compiled. After the project is compiled once, this window lists all modules in the project hierarchically, and lists the specific resources used by each source file. The top level can be a user-generated text file or a graphic editing file. The file window lists all files after the project is compiled. The file types include design device files (Deisgn Deivce Files), software files (Software Files) and other files (Others Files). The design unit window lists all units compiled by the project, such as Verilog HDL units, VHDL units, etc. One design device file corresponds to one design unit being generated.         (5) Engineering work area. Device design, timing constraint design, underlying editor and compilation report are all displayed in the project workspace. When the Quartus II software implements different functions, the corresponding operation window will be opened in this area to display different contents and perform different operations.






































        (6) Compilation status display window. The compilation status display window mainly displays the module synthesis, placement and routing process and time.
Module lists the engineering modules, Process displays the progress bar of synthesis and placement and routing, and Time
represents the time spent on synthesis and placement and routing.

        (7) Information display window. The information display window displays information during the Quartus II software synthesis and placement and routing process, such as
calling source files and library files when starting synthesis, timing, alarms, errors, etc. during the synthesis placement and routing process. If there are alarms
and errors, it will be given. The specific causes of alarms and errors are provided to facilitate designers to find and correct errors.
1.5 ModelSim simulation software
        Mentor's ModelSim is the industry's best HDL language simulation software. It provides a friendly simulation environment
and is the only simulator in the industry that supports VHDL and Verilog HDL mixed simulation in a single core. It adopts directly optimized
compilation technology and single-core simulation technology. The compilation and simulation speed is fast. The compiled code has nothing to do with the platform, making it easy to protect the IP
core. The software's personalized graphical interface and user interface provide users with a powerful means to speed up the debugging process. It is the
preferred simulation software for FPGA. Its main features are:
         It adopts RTL and gate-level optimization technology, and has fast compilation and simulation speed, and has cross-platform capabilities. Platform cross-version simulation function;
         Single-core VHDL and Verilog HDL mixed simulation;
         Integrated performance analysis, waveform comparison, code coverage, data flow ChaseX, signal detection (Signal Spy),
virtual object (Virtual Object), Memory window, Assertion The window and source code window display signal values,
signal condition breakpoints and many other debugging functions;
         Has a C language interface and supports C language debugging;
         The most comprehensive support for system-level description languages, supporting SystemVerilog, SystemC, PSL and other languages.
        ModelSim is divided into several different versions: SE, PE, LE and OEM, of which SE is the most advanced version, and those integrated
in the design tools of FPGA manufacturers such as Actel, Atmel, Altera, Xilinx and Lattice are all OEM versions.
There is a big difference between the SE version and the OEM version in terms of functions and performance. For example, regarding the simulation speed issue that everyone is concerned about, take the
OEM version ModelSim XE provided by Xilinx as an example. For designs with less than 40,000 lines of code, ModelSim
SE is better than ModelSim XE is 10 times faster; for designs with more than 40,000 lines of code, ModelSim SE is
nearly 40 times faster than ModelSim XE. ModelSim SE supports PC, UNIX and Linux mixed platforms, provides comprehensive and high-performance
verification functions, and fully supports a wide range of industry standards. Although the tools integrated in the design tools of FPGA manufacturers such as Altera
are OEM versions, users can independently install the SE version of ModelSim and
integrate the SE version of ModelSim software into development environments such as Quartus II with simple settings.
        First run the Quartus II software directly, click the "Tools→Options" menu in sequence, and
click the "General→EDA Tool Options" entry in the pop-up software settings dialog box to display the integrated tool option setting dialog box,
as shown in Figure 1- 9 shown. As can be seen from the dialog box options, Quartus II can integrate
tools such as ModelSim, Synplify, Synplify Pro, and Precision. Enter the execution path of the tool in the path edit box corresponding to the corresponding tool to easily integrate
third-party tools such as ModelSim into the Quartus II environment. In Figure 1-9, set the path corresponding to ModelSim-Altera
to "C:\altera\modelsim\modelsim_ase\win32aloem" (readers need to
set it according to the installation path of ModelSim) to integrate the ModelSim software into the Quartus II software environment.

        ModelSim is an independent simulation software that can independently complete program code editing and simulation functions. The ModelSim running
interface is shown in Figure 1-10. The default working interface mainly consists of title bar, menu bar, toolbar, library information window, object
window, waveform display window and script information window.

        ModelSim has many windows, more than 10 in total. During the simulation process, in addition to the main window, multiple copies of other windows can be opened, and objects in each window can be added by dragging each other, which is very convenient to use. When closing the main window, all open windows are automatically closed. ModelSim's rich display and debugging windows can greatly facilitate designers' simulation and debugging of programs, but also make it difficult for beginners to master it. This book does not introduce the ModelSim software in detail. Readers can refer to the software manual and other reference materials to learn to use the ModelSim software. Simulation technology plays a very important role in FPGA design. Proficiency in simulation tools and simulation techniques is an essential skill for an excellent engineer. Of course, to be proficient in simulation software, in addition to consulting reference materials, you also need to conduct a lot of computer practice, and gradually understand, master and skillfully apply various windows in engineering practice to improve simulation debugging skills.

1.6 MATLAB software

1.6.1 Introduction to MATLAB software

        In the 1970s, Cleve Moler, chairman of the Department of Computer Science at the University of New Mexico in the United States
, wrote the earliest MATLAB in FORTRAN in order to reduce the programming burden on students. MathWorks, a company co-founded by Little, Moler, and Steve Bangert in 1984,
officially introduced MATLAB to the market. By the 1990s, MATLAB had become
the standard computing software in the international control community. All MATLAB programs in this book are edited and
debugged using the MATLAB R2014a version.
        MATLAB is a high-tech computing environment released by the American Mathworks company mainly for scientific computing, visualization and interactive programming
. It integrates numerical analysis, matrix calculations, scientific data visualization, and
modeling and simulation of nonlinear dynamic systems, etc. Many powerful functions are integrated in an easy-to-use window environment,
providing a comprehensive solution for scientific research, engineering design, and many scientific fields that must perform effective numerical calculations, and to a large extent
get rid of traditional non-interactive The editing mode of formal programming languages ​​(such as C, FORTRAN) represents
the advanced level of today's international scientific computing software. It is second to none in numerical calculations among mathematical technology application software. MATLAB can
perform matrix operations, draw functions and data, implement algorithms, create user interfaces, connect programs in other programming languages,
etc. It is mainly used in engineering calculations, control design, Signal processing and communications, image processing, signal detection, financial modeling,
design and analysis and other fields.
        The basic data unit of MATLAB is a matrix, and its instruction expressions are
very similar to mathematical formulas and forms commonly used in engineering applications. Therefore, using MATLAB to solve problems is much
simpler , and MATLAB also absorbs the advantages of software such as Maple, making MATLAB a powerful mathematical
software.
MATLAB has also added support for C language, FORTRAN language, C++ language, and Java language in the new version . Users can call them directly, or they can import their own utility programs into the MATLAB function library
for later calls. In addition, many MATLAB enthusiasts have written some classic programs that users can
use directly after downloading them.

1.6.2 MATLAB work interface

        The working interface of MATLAB is simple, clear and easy to operate. After correctly installing the software, click "Start →
All Programs → MATLAB → R2014a → MATLAB R2014a" to open the MATLAB software. The working interface is
shown in Figure 1-11.

        The command window is the main window of MATLAB. You can directly enter commands in the command window, and the system will automatically display the information after the command is executed. If a command statement is too long and requires two or more lines to complete, use "..." as a connection symbol and press the "Enter" key to continue typing on the next line. In addition, when entering commands in the command window, you can use shortcut keys to easily call or modify previously entered commands. For example, you can use the up key "↑" to repeatedly call the previous command line. After modifying it, press the "Enter" key to execute it directly. There is no need to move the cursor to the end of the line when executing the command. The command window can only execute a single command. Users can edit multiple command statements by creating M files (files with the suffix ".m"). Enter the name of the M file in the command window to execute all command statements in the M file in sequence.
        The command history window is used to display the commands executed by the user in the command window. The user can also directly double-click the command in the history window to execute the command, or after selecting one or more commands, perform operations such as copying and cutting. ; The workspace window is used to display all created variable information in the current working environment; click the "CurrentDirectory" label under the workspace window to open the current working path window, which is used to display the current working path, including M files The opening path, etc.

1.6.3 Features and advantages of MATLAB

        The main features and advantages of MATLAB are reflected in the following aspects.
        (1) Friendly working platform and programming environment. MATLAB consists of a series of tools that facilitate users to use MATLAB functions and files. Many of these tools use a graphical user interface, including the MATLAB desktop and command window, history command window, editor and debugger, path search and A browser for users to browse help, workspace, and files. With the commercialization of MATLAB and the continuous upgrading of the software itself, the user interface of MATLAB has become more and more refined, closer to the standard interface of Windows, with stronger human-computer interaction and simpler operation. The new version of MATLAB provides a complete online query and help system, which greatly facilitates user use. The concise programming environment provides a relatively complete debugging system. The program can be run directly without compilation, and errors can be reported in a timely manner to facilitate users to analyze the cause of the error.
        (2) Simple and easy-to-use programming language. MATLAB uses a high-level matrix/array language with object-oriented programming features. Users can synchronize input statements and execution commands in the command window, or they can write more complex applications (M files) first and then run them. The underlying language of MATLAB is the C++ language, so the grammatical features are very similar to the C++ language, and it is simpler and more in line with the writing habits of scientific and technical personnel for mathematical expressions, so it is more conducive to the use of non-computer science and technical personnel. This language is highly portable and scalable, which is an important reason why MATLAB can penetrate into various fields of scientific research and engineering calculations.
        (3) Powerful data processing capabilities. MATLAB is a collection that contains a large number of calculation algorithms. It has more than 600 mathematical operation functions used in projects, and can easily realize various calculation functions required by users. The algorithms used in the functions are the latest research results in scientific research and engineering calculations, and have undergone various optimization and fault-tolerant processing. In general, it can be used in place of low-level programming languages ​​such as C and C++. Under the same calculation requirements, using MATLAB will greatly reduce the programming workload. These MATLAB function sets include the simplest, most basic functions, as well as complex functions such as matrices, eigenvectors, and fast Fourier transforms. The problems that functions can solve generally include matrix operations and the solution of linear equations, differential equations and partial differential equations, symbolic operations, Fourier transform and statistical analysis of data, optimization problems in engineering, sparse matrix operations, Various operations on complex numbers, trigonometric functions and other elementary mathematical operations, multi-dimensional array operations, and modeling and dynamic simulation.
        (4) Excellent graphics processing capabilities. MATLAB has had convenient data visualization functions since its inception. It can represent vectors and matrices graphically, and the graphics can be annotated and printed. High-level graphing includes two- and three-dimensional visualization, image processing, animation, and expression graphing. MATLAB can be used for scientific computing and engineering drawing. The entire graphics processing function of MATLAB is very powerful. It not only has the functions that general data visualization software has (such as the drawing and processing of two-dimensional curves and three-dimensional surfaces, etc.), but also has functions that other software does not have (such as lighting processing of graphics, It also shows excellent processing capabilities in terms of colorimetric processing and four-dimensional data performance. At the same time, MATLAB also has corresponding functions for some special visualization requirements, such as graphic dialogue, to ensure the requirements of users at different levels.
        (5) A widely used module collection toolbox. MATLAB has developed powerful module sets and toolboxes (Toolbox) for many specialized fields. Generally, they are developed by experts in specific fields, and users can directly use the toolbox to learn, apply and evaluate different methods without writing code themselves. At present, MATLAB has extended the toolbox to many fields of scientific research and engineering applications. Such as data collection, database interface, probabilistic and statistical optimization algorithm, partial differential equation solution, neural network, wavelet analysis, signal processing, image processing, system identification, control system design, robust control, model prediction, fuzzy logic, financial analysis, map Tools, nonlinear control design, real-time rapid prototyping and semi-physical simulation, embedded system development, fixed-point simulation, power system simulation, etc., all have their own place in the toolbox family.
        (6) Practical program interface and publishing platform. MATLAB can use the MATLAB compiler and the C/C++ math library
and graphics library to automatically convert your own MATLAB programs into C and C++ code that runs independently of MATLAB. Allows users to write C or C++ language programs that can interact with MATLAB. In addition, MATLAB web services allow you to use your own MATLAB math and graphics programs in web applications. An important feature of MATLAB is a program extension system and a set of special application subroutines called toolboxes. The toolbox is a subroutine library of MATLAB functions. Each toolbox is customized for a certain discipline and application, mainly including signal processing, control system, neural network, fuzzy logic, wavelet analysis and system simulation. application.
        (7) Application software development including user interface. In the development environment, users can easily control multiple files and graphics windows. In terms of programming, it supports function nesting, conditional interruption, etc.; in terms of graphics, it has powerful graphics annotation and processing functions; in terms of input and output, it can be directly connected to file formats such as Excel.

Guess you like

Origin blog.csdn.net/qq_43416206/article/details/135278085