当前位置:网站首页>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 pop up an alarm through the national standard gb28181 protocol video platform easygbs for mobile detection / perimeter intrusion detection video recording
- Understanding of deep separable convolution, block convolution, extended convolution, transposed convolution (deconvolution)
- Pytorch 转置卷积
- Find out the invisible assets -- use hosts collision to break through the boundary
- Handling of communication failure between kuberbetes pod
- Pytorch transpose convolution
- Experience and suggestions on cloud development database
- National standard gb28181 protocol video platform easygbs alarm reporting function adds video alarm reporting and video recording
- Inter thread communication of embedded development foundation
- Development trend of CAE simulation analysis software
猜你喜欢

ZOJ - 4104 sequence in the pocket

A survey on model compression for natural language processing (NLP model compression overview)

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

Ps\ai and other design software pondering notes
Advanced programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization

A survey of training on graphs: taxonomy, methods, and Applications
![[go] concurrent programming channel](/img/6a/d62678467bbc6dfb6a50ae42bacc96.jpg)
[go] concurrent programming channel

Ui- first lesson

B. Ternary Sequence(思维+贪心)Codeforces Round #665 (Div. 2)

C. K-th not divisible by n (Mathematics + thinking) codeforces round 640 (Div. 4)
随机推荐
What is the difference between get and post? After reading it, you won't be confused and forced, and you won't have to fight with your friends anymore
Find out the invisible assets -- use hosts collision to break through the boundary
企业安全攻击面分析工具
[idea] dynamic planning (DP)
An error is reported during SVN uploading -svn sqlite[s13]
PyTorch中的转置卷积详解
Applet wxss
找出隐形资产--利用Hosts碰撞突破边界
Dismantle the industrial chain of synthetic rubber industry, and the supply chain may become a sharp weapon for breakthrough
ZOJ - 4104 sequence in the pocket
sql 多表更新数据非常慢
A survey on model compression for natural language processing (NLP model compression overview)
Kubernetes popular series: getting started with container Foundation
期货怎么开户安全些?哪些期货公司靠谱些?
Popular explanation [redirection] and its practice
How do HPE servers make RAID5 arrays? Teach you step by step today!
How to open a futures account safely? Which futures companies are more reliable?
Join in ABAP CDs
Goby+AWVS 实现攻击面检测
Transpose convolution explanation