15 FPGA design experience introduction and synchronization timing design considerations

1, the basic principles of hardware design

(1) Speed ​​and area balance and interchange principle: If a design has a large timing margin, the frequency that can be run is much higher than the design requirements, and the module can be reused to reduce the chip area consumed by the entire design. Speed ​​advantage for area saving; conversely, if the timing requirements of a design are very high and the common method does not reach the design frequency, then multiple operation modules can be copied in parallel through data stream and conversion, and "ping-pong operation" is adopted for the entire design. And the idea of ​​"serial-to-parallel conversion" is processed, and the data is "parallel-serial conversion" at the chip output module. Thereby, the improvement of the area copying exchange speed is realized.

(2) Hardware principles: understanding the nature of HDL;

(3) System principle: overall grasp;

(4) Synchronous design principle: The basic principle of designing time series stability.

2. Verilog, as an HDL language , models the behavior of the system in a hierarchical manner. The more important levels are system, algorithm, register transfer level (RTL), logic level (Logic), gate level (Gate), circuit switching level (Switch).

3. In actual work , except for the use of for loop statements when describing the test test stimulus (Testbench), the for loop is rarely used in RTL-level coding. This is because the for loop is expanded by the synthesizer into execution statements for all variables. Each variable independently occupies register resources and cannot effectively multiplex hardware logic resources, causing huge waste. Commonly used case statements instead.

4, if...else... and case are very different in nested description , if...else... is prioritized, in general, the first if has the highest priority, and the last one has the lowest priority. . The case statement is a parallel statement, it has no priority, and the establishment of the priority structure requires a lot of logic resources, so you can not use the if...else... statement in the case.

Supplement: 1. You can also use if...; if...; if...; to describe a "parallel" statement without precedence.

5, FPGA general trigger resources are rich, and CPLD combination logic resources are more abundant.

6, the composition of FPGA and CPLD:

FPGA basically consists of programmable I/O unit, basic programmable logic unit, embedded block RAM, rich routing resources, underlying embedded functional unit and embedded dedicated hard core.

The structure of the CPLD is relatively simple, and is mainly composed of a programmable I/O unit, a basic logic unit, a wiring pool, and other auxiliary function modules.

15 FPGA design experience introduction and synchronization timing design considerations


7, Block RAM:

3 block RAM structures, M512 RAM (512bit), M4K RAM (4Kbit), M-RAM (64Kbit).

M512 RAM: suitable for some small Buffer, FIFO, DPRAM, SPRAM, ROM, etc.;

M4K RAM: for general needs

M-RAM: A buffer suitable for making large blocks of data.

The LUTs of Xlinx and LatTI ce FPGAs can be flexibly configured into small RAM, ROM, FIFO and other storage structures. This technology is called distributed RAM.

Supplement: However, in the general design, it is not recommended to use FPGA/CPLD's on-chip resources to configure a large amount of memory, which is a cost consideration. So try to use external storage.

8. Make good use of the internal PLL or DLL resources to complete the clock frequency division, double frequency, and shift equal operation, which not only simplifies the design, but also effectively improves the accuracy and stability of the system.

9, the difference between asynchronous circuit and synchronous sequential circuit

Asynchronous circuit:
The circuit core logic is implemented by a combination circuit;
The biggest disadvantage of asynchronous sequential circuits is that they are prone to burrs;
Not conducive to device migration;
Not conducive to static timing analysis (STA), verify design timing performance.

Synchronous timing circuit:
The circuit core logic is implemented with various triggers;
The main signal, output signal, etc. of the circuit are generated by driving the trigger on a certain clock edge;
Synchronous timing circuit can avoid burrs very well;
Conducive to device transplantation;
Conducive to static timing analysis (STA), verify design timing performance.

10. In synchronous design, stable and reliable data sampling must follow the following two basic principles:

(1) Before the effective clock edge arrives, the data input has at least stabilized the setup time of the sampling register. This principle is referred to as the Setup time principle for short;

(2) After the valid clock edge arrives, the data input will at least keep the Hold clock of the sample register stable for a long time. This principle is referred to as the Hold time principle.

11, synchronization timing design considerations:

Data conversion for asynchronous clock domains.
The design method of the combinational logic circuit.
The clock design of the synchronous timing circuit.
The delay of the synchronous timing circuit. The most common design method for delays in synchronous sequential circuits is to use a divided or multiplied clock or a synchronous counter to achieve the required delay. In contrast to the larger and special timing required delays, a high-speed clock is typically used to generate a counter, based on the count. A delay is generated; for a relatively small delay, a D flip-flop can be used, which not only delays the signal by one clock cycle, but also completes the initial synchronization of the signal with the clock. Used in input signal sampling and adding timing constraint margins. In addition, there is a behavior-level method to describe the delay, such as "#5 a<=4'0101;" This is often used to simulate test excitation, but it is ignored in circuit synthesis and does not play a role in delay.

The reg types defined by Verilog are not necessarily integrated into registers. The two most commonly used data types in Verilog code are wire and reg. In general, the data and network lines specified by the wire type are implemented by combinatorial logic, and the data specified by the reg type is not necessarily implemented by registers.

12, common design ideas and skills

(1) ping-pong operation;
(2) serial-to-parallel conversion;
(3) Pipeline operation;
(4) Asynchronous clock domain data synchronization. It refers to the problem of how to reliably exchange data between data fields where two clocks are not synchronized. There are two main situations in which the data clock domain is out of sync:
The clock frequencies of the two domains are the same, but the phase difference is not fixed, or the phase difference is fixed but unmeasurable, which is simply referred to as the same-frequency out-of-phase problem.

The two clock frequencies are fundamentally different, referred to as the inter-frequency problem.

Two methods of asynchronous clock domain operation that are not recommended: one is to adjust the sampling by increasing the Buffer or other gate delay; the other is to blindly use the positive and negative edges of the clock to adjust the data sampling.

13, the basic principles of module division:

(1) Use the register for the output of the submodule designed for each synchronous timing (using the register to divide the synchronous timing module principle).
(2) Divide the relevant logic and the logic that can be reused into the same module (corresponding to the system principle).
(3) Separate the logic of different optimization goals.
(4) The logic that sends the constraint is assigned to the same module.
(5) The storage logic is divided into modules independently.
(6) Appropriate module size.
(7) The top-level module is preferably not logically designed.

14, the considerations of combinatorial logic

(1) Avoid combinatorial logic feedback loops (easy to glitch, oscillate, timing violations, etc.).
solve:
A. Keep in mind that any feedback loop must contain registers;
B. Check the comprehensive and realize the warning information of the report, and find the feedback loop (combinaTIonal loops) and modify it accordingly.
(2) Replace the delay chain.
Solution: Complete with multiplier, crossover or sync counter.
(3) Replace the asynchronous pulse generating unit (burr generator).
Solution: Design the pulse circuit with synchronous timing.
(4) Use the latch with caution.
solve:
A, use a complete if...else statement;
B. Check whether the combination logic feedback loop is included in the design;
C. Design an output operation for each input condition and set the default operation for the case statement. Especially in state machine design, it is best to have a default state transition, and each state preferably has a default operation.
D. If you use a case statement, especially when designing a state machine, try to add a comprehensive constraint attribute as a full conditional case statement.

Tip: Check the comprehensive report of the synthesizer carefully. At present, most of the synthesizers will report “warning” to the integrated latch. It is more convenient to find out the inadvertently generated latch through the comprehensive report.

15, the clock design considerations

Recommended clock design method for synchronous timing circuits:

The clock is input through the global clock input pin, and is divided/multiplied, shifted, equalized and operated by a dedicated PLL or DLL inside the FPGA, and then driven by the internal global clock routing resource of the FPGA to reach the clock input of all registers and other modules in the chip. end.

The five basic functions of the FPGA designer: simulation, synthesis, timing analysis, debugging, and verification.

For FPGA designers, practicing these five basic skills is the same process as using the corresponding EDA tools. The corresponding relationship is as follows:

1. Simulation: Modelsim, Quartus II (Simulator Tool)
2. Synthesis: Quartus II (Compiler Tool, RTL Viewer, Technology Map Viewer, Chip Planner)
3. Timing: Quartus II (TImeQuest TIming Analyzer, Technology Map Viewer, Chip Planner)
4. Debug: Quartus II (SignalTap II Logic Analyzer, Virtual JTAG, Assignment Editor)
5. Verification: Modelsim, Quartus II (Test Bench Template Writer)

Mastering the HDL language is not all of the FPGA design, but the impact of the HDL language on the FPGA design runs through the entire FPGA design flow, which is complementary to the five basic functions of the FPGA design.

For FPGA designers, using the "integratable subset of HDL language" can accomplish 50% of the FPGA design work - design coding.

The three basic skills of simulation, synthesis, and time series analysis are helpful for learning the "integratable subset of HDL language":

1. Through simulation, you can observe the logical behavior of HDL language in FPGA.
2. Through synthesis, you can observe the physical implementation of HDL language in FPGA.
3. Through the timing analysis, you can analyze the physical implementation characteristics of the HDL language in the FPGA.

For FPGA designers, using the "HDL language verification subset", you can complete another 50% of the FPGA design - debugging verification.

1. Set up the verification environment, and verify the correctness of the FPGA design through simulation.
2. Comprehensive simulation verification can reduce the workload of FPGA hardware debugging.
3. Combine the hardware debugging and simulation verification methods, use the debugging to solve the unverified problems of the simulation, and use the simulation to ensure that the solved problems are not reproduced in the debugging. A regression verification process can be established to help maintain the FPGA design project.

The five basic functions of the FPGA designer are not isolated and must be combined to complete a complete FPGA design flow. Conversely, by completing a complete design process, you can practice these five basic skills most effectively. With a preliminary understanding of these five basic skills, you can learn some of them in depth and then reuse the knowledge you have learned in the complete design process. Repeatedly, you can gradually improve the design level. With such a step-by-step, spiral-up approach, as long as you enter the door through training, you can self-study and self-improve.

Books on FPGA design sold in the market are designed to ensure the integrity of the structure. Each aspect of the FPGA design is introduced separately. Although each aspect is in-depth, due to the lack of support from other related parties, it is difficult for readers to put into practice. A complete book can gain a holistic view of FPGA design. Such a book, as an engineering training guide, can not be used as an advanced reference book for a certain aspect.

For new employees, they often have a preliminary understanding of the overall design process of the FPGA, and some aspects of the five basic skills may be solid. However, the lack of ability in one or a few aspects limits their ability to complete the entire design process on their own.

The purpose of on-the-job training is to help them master the overall design process, cultivate their ability to acquire information, and train back and forth through several design processes to form a virtuous cycle of self-promotion and self-development. In this process, as the understanding of the breadth and depth of the knowledge involved in the work is gradually clear, the self-confidence of new employees will gradually increase, and the direction of personal development will be gradually clear, so that they can actively participate in the project. Come in.

Smart Livestock Farming

Use modern information technology to accurately grasp the growth process and growth dynamics of poultry, conduct dynamic monitoring and trend analysis of poultry at various growth stages, and provide fast and efficient remote guidance for poultry breeding, house management and epidemic prevention and slaughter, and improve the ability of fine breeding and house management, timely detection of problems in breeding, formulate technical countermeasures for poultry breeding and house management, put forward poultry breeding and house management opinions or suggestions, and better carry out technical guidance to promote poultry production.
Collect valuable like animal body temperature, shed temperature, humidity, ammonia concentration, individual animal diet data, estrus indicators of female animals, abnormal changes in weight, and even individual animal mood indicators, etc.
These are not just data. They can be analyzed and excavated in depth through system and software integration, which can provide a basis for the farm to make better decisions, realize intelligent management, and increase operating income.

Livestock Health Monitoring device,Animal Health Monitoring System,Livestock Diet Monitoring Device

eSky wireless Inc , https://www.eskygpsiot.com

Posted on