当前位置:网站首页>Chapter 7 behavior level modeling
Chapter 7 behavior level modeling
2022-07-08 01:37:00 【Jiangnan small workshop】
Chapter vii. Behavior level modeling
Preface
- Verilog Support designers from the perspective of Algorithm , That is, describe it from the perspective of the external behavior of the circuit . Behavior level modeling is to represent circuits from a high abstract point of view . At this level, it is similar C Language ,Verilog The grammatical structure of behavior level modeling and C The language is quite similar .
Structured procedure statements
- Two structured process statements :
initial
andalways
, Basic statements of behavior level modeling . - And C Different language ,Verilog In essence, it is concurrent and non sequential , Concurrent execution .
- Every
initial
andalways
Statement represents an independent execution process , Each execution process starts from simulation time 0 Start execution , Two statements cannot be nested .
initial
- All in
initial
The statements within the statement form ainitial
block .initial
Block slave simulation 0 Start at every moment , The whole simulation process is only executed once . - A module has more than one
initial
block , From simulation 0 Start , Concurrent execution , Each block is independent . - There are multiple behavior statements in the block , You need to group these statements , Use
begin ... end
Combine them into a block statement ; If there is only one statement in the block , You don't have to usebegin ... end
. - Illustrate with examples
- Execution order
- initial Block statements can only be executed once during the entire simulation , Therefore, it is generally used to initialize 、 Signal monitoring 、 Generate simulation waveform, etc .
- Initialization method
Initialize while variables are declared
At the same time, port / Data declaration and initialization
ANSI C Style Port declaration initialization
always
always
All the behavior statements in the statement form aalways
Sentence block , The statement block is simulated 0 Execute the behavior statements in sequence from time to time , After the last execution is completed , Start executing the first statement again , And so on and so on , Until the end of the simulation .( Generally speaking, there are sequential statements , Very reasonable. .)always
Statements usually model a set of repeatedly executed activities in a circuit , Such as clock signal generator , Turn the clock signal every half a clock cycle . In real circuits, as long as the power is turned on , Clock signal generator from time 0 It works , Keep working .- Illustrate with examples
- explain :clock Signal placed on initial Statement , So only initialize once ; If you put it in always In the sentence , Every time always Statement will be initialized once , Then work endlessly . The way to stop is to cut off power (
$finish
) And interrupt ($stop
).
Procedure assignment statement
- The update object of procedure assignment statement is register 、 Integers 、 Real numbers or time variables . These types of variables are assigned , Its value remains unchanged , Until reassigned .
- Distinguish between continuous assignment statements : Consecutive assignment statements are always active , The change of any operand will lead to the re evaluation and re assignment of the expression , however , Procedure assignment statements only work when they are executed .
- Verilog There are two types of procedure assignment statements : Blocking and non-blocking .
Block assignment
- Assignor :
=
- Blocking statements are executed sequentially , If in a begin end Block used blocking assignment , Then this block statement represents serial behavior .
- Direct example
- explain :
- Only in sentences x=0 After execution , Will execute y=1, sentence count=count+1 Execute in order at the end .
- x=0 To reg_b=reg_a The sentence between is 0 It starts at the moment ( But there is sequence ).
- 15 Time units , Start execution reg_a[2].
- 25 Time units , perform reg_b[15:13].
- sentence count=count+1 It's also 25 Time units .
- There is also register variable assignment , When the left and right seat widths are different , Left side width , Then the high position will be supplemented 0; The right width discards the high bit that exceeds the left width .
Nonblocking assignment
- Assignor :
<=
- In the expression , As a relational operator ; In a non blocking environment , Assign as non blocking .
- The above example
- explain :
- The simulator schedules the blocking assignment to the corresponding time , Then continue to execute the following statements , Didn't stop to wait for the assignment to complete .
- Don't be in the same always Block mixed with blocking and non blocking assignment statements .
- application : It can be used to model common hardware circuit behavior , Such as after an event , The behavior of concurrent transmission of multiple data .
- Avoid competition
- Non blocking can be achieved by blocking
- summary
- If an event occurs, there will be concurrent transmission of multiple data , Non blocking description is recommended .
- Typical non blocking applications include : Pipeline modeling 、 Modeling of multiple mutually exclusive data transmission .
- Non blocking problem : The decrease of simulation speed 、 Memory usage increases .
Timing control
Based on the delay
Based on events
Level sensitive
Conditional statements
Multiple branch statement
Multiple branches
casex and casez
Loop statement
while loop
for loop
repeat loop
forever loop
Sequential block and parallel block
Block statement type
Block statement features
Generating block
Loop generation statement
Conditional generation statement
case Generating statement
give an example
Choose a multi-path selector
Four digit counter
Traffic light controller
Summary
边栏推荐
- Plot function drawing of MATLAB
- 2022 chemical automation control instrument examination summary and chemical automation control instrument simulation examination questions
- After modifying the background of jupyter notebook and adding jupyterthemes, enter 'JT -l' and the error 'JT' is not an internal or external command, nor a runnable program
- Kindle operation: transfer downloaded books and change book cover
- Grey correlation analysis link (portal) matlab
- 4、策略学习
- ROS 问题(topic types do not match、topic datatype/md5sum not match、msg xxx have changed. rerun cmake)
- COMSOL - Construction of micro resistance beam model - final temperature distribution and deformation - establishment of geometric model
- Leetcode notes No.21
- Four digit nixie tube display multi digit timing
猜你喜欢
Basic realization of line chart (II)
Talk about smart Park
Gnuradio transmits video and displays it in real time using VLC
Guojingxin center "APEC education +" Shanghai Jiaotong University Japan Cooperation Center x Fudan philosophy class "Zhe Yi" 2022 New Year greetings
Application of state mode in JSF source code
The beauty of Mathematics -- the principle of fine Fourier transform
Redis cluster
写一个纯手写的qt的hello world
About snake equation (3)
MATLAB R2021b 安装libsvm
随机推荐
common commands
Redux使用
Tapdata 的 2.0 版 ,開源的 Live Data Platform 現已發布
Multi purpose signal modulation generation system based on environmental optical signal detection and user-defined signal rules
Apt get error
Understanding of expectation, variance, covariance and correlation coefficient
Connect to the previous chapter of the circuit to improve the material draft
2022 low voltage electrician examination content and low voltage electrician simulation examination question bank
用户之声 | 冬去春来,静待花开 ——浅谈GBase 8a学习感悟
npm 内部拆分模块
LaTeX 中 xcolor 颜色的用法
2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
qt-使用自带的应用框架建立--hello world--使用min GW 32bit
2、TD+Learning
2021-03-06 - play with the application of reflection in the framework
项目经理有必要考NPDP吗?我告诉你答案
[loss function] entropy / relative entropy / cross entropy
4、策略学习
Gnuradio transmits video and displays it in real time using VLC
2021-04-12 - new features lambda expression and function functional interface programming