当前位置:网站首页>Saying "Dharma" Today: the little "secret" of paramter and localparam
Saying "Dharma" Today: the little "secret" of paramter and localparam
2022-06-24 16:36:00 【FPGA technology Jianghu】
Today “ Law ”:paramter 、localparam Small “ Secret ”
Welcome to great Xia FPGA The new column of technology world said today “ Law ”, Of course , Here we are definitely not going to study and discuss the knowledge of laws and regulations , So what are we talking about , Here we are talking about some small details and methods in product development and technology learning , Welcome to study and exchange together , Good inspiration and essay , Welcome to contribute , Please indicate your pseudonym and related articles , Submission receiving email :[email protected] Today brings with it paramter 、localparam Small “ Secret ”, Don't talk much , Loading .
Today's talk “ Law ” Very brief , Because there's already a problem ahead Verilog HDL The basic grammar of learning content , Today, let's briefly review , I won't go into details , If you want to know more about it, you can have a look at it 《 One week to master FPGA Verilog HDL grammar 》.
stay Verilog HDL of use parameter To define constants , The box parameter To define an identifier to represent a constant , It's called a signed constant , A constant in the form of an identifier , Using an identifier to represent a constant can improve the readability and maintainability of the program .parameter Type data is a kind of constant data , The format of the description is as follows :
parameter Parameter name 1= expression , Parameter name 2= expression , …, Parameter name n= expression ;
That's right in most textbooks parameter Definition and use of , Parametric constants are often used to define delay times and variable widths .
parameter It can be used as an interface for passing parameters when instantiating the bottom module in the top module ,localparam The scope of is limited to the current module, Interfaces that cannot be passed as parameters .
But in Verilog in , This is a controversial issue , namely Parameter That is, as a constant , It is also a question of whether the use of parameters is reasonable and legal .
stay IEEE 2005 Before standard ,Verilog That's what it does . But constants don't just need secure encapsulation , It's also about intellectual property (IP), There are many questions about the indistinguishability of constant parameters .
With EDA Scale development ,IP Awareness enhancement , Constants need more security , therefore IEEE stay 2005 after , Join in localparam Reserved words , Used to define constants . Constants are used to define variables that are fixed in the current project and file . And parameters can be used as LPM The values exchanged , Be similar to C Formal parameters in languages .Verilog When the code model in is repeatedly referenced , Use LPM According to the needs of the site , Modify these parameters to customize . Obviously, constants don't need to be passed out , It doesn't need or allow to be customized on site .
stay 2005 edition Verilog Before , In the case that the constant parameters are not divided , Users of reusable code and designers of reusable code may not be the same person ( Or the team ), such , It's easy to create users with unknown internal details , Inadvertently modifying constants , Make the stable system go wrong , And feedback to the designer of the reused code . Another situation , Or worse ,IP Nuclear complexity and costs are increasing . Protect IP I'm getting more and more aware of it , And attack cracking IP People and teams are starting to emerge . This makes IP Authors have to protect their code , If a constant is passed as a parameter , It's a very important vulnerability , Of course, we have to add .
therefore , from now on , We're going to encapsulate the constants , Protect your code . adopt paramter 、localparam And other little “ Secret ”, We need to learn more .
Today “ Law ”, Take you to understand FPGA More secrets , Tips .
That's the end of the day , I wish you all the best , I'll see you again .
End
It will be updated continuously in the future , bring Vivado、 ISE、Quartus II 、candence Installation related design tutorial , Learning resources 、 Project resources 、 Good article recommendation and so on , I hope great Xia will continue to pay attention to .
The world is so big , Keep going , I wish you all the best , I'll see you again !
边栏推荐
- How to open a futures account safely? Which futures companies are more reliable?
- [tke] modify the cluster corendns service address
- [play with Tencent cloud] my operation strategy from domain name application to website filing in Tencent cloud
- Pageadmin CMS solution for redundant attachments in website construction
- 06. Tencent cloud IOT device side learning - Introduction to basic functions
- Mathematics in machine learning -- point estimation (IV): maximum posteriori probability (map)
- Applet - use of template
- Development trend of CAE simulation analysis software
- A survey on model compression for natural language processing (NLP model compression overview)
- Page scrolling effect library, a little skinny
猜你喜欢

Problems encountered in the work of product manager

A survey of training on graphs: taxonomy, methods, and Applications

C. Three displays codeforces round 485 (Div. 2)

A survey on dynamic neural networks for natural language processing, University of California
Advanced programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization

Applet wxss
MySQL Advanced Series: Locks - Locks in InnoDB

Cognition and difference of service number, subscription number, applet and enterprise number (enterprise wechat)

B. Terry sequence (thinking + greed) codeforces round 665 (Div. 2)

Some adventurer hybrid versions with potential safety hazards will be recalled
随机推荐
Mathematics in machine learning -- point estimation (IV): maximum posteriori probability (map)
How to open a futures account safely? Which futures companies are more reliable?
Global and Chinese market of insect proof clothing 2022-2028: Research Report on technology, participants, trends, market size and share
Percona Toolkit series - Pt deadlock logger
找出隐形资产--利用Hosts碰撞突破边界
Snowflake algorithm implemented in go language
A survey of training on graphs: taxonomy, methods, and Applications
Week7 weekly report
Virtual machine virtual disk recovery case tutorial
Applet wxss
What does the router pin mean?
Goby+awvs realize attack surface detection
Tencent blue whale container management platform was officially released!
What is the difference between a network card and a port
【prometheus】1. Monitoring overview
Annual contribution! Tencent cloud middleware product upgrade conference is in hot registration!
D. Solve the maze (thinking +bfs) codeforces round 648 (Div. 2)
Istio FAQ: failed to resolve after enabling smart DNS
Cause analysis of the failure of web page live broadcast on demand RTMP streaming platform easydss streaming live broadcast
Handling of communication failure between kuberbetes pod