当前位置:网站首页>Chapter 6 data flow modeling
Chapter 6 data flow modeling
2022-07-01 23:33:00 【Jiangnan small workshop】
Data flow modeling
Continuous assignment
The continuous assignment statement is verilog The basic statement of data flow modeling , Used to deal with Wire network Assign a value .
This thing is equivalent to gate level description , But it describes the circuit from a higher abstract point of view .
Consecutive assignment statements must be in the form of the keyword
assignStart .Continuous assignment statements have the following characteristics :
- The value on the left must be a scalar / Vector network / The splicing of scalar and vector line nets , Choose one of the three , It cannot be a vector or a vector register .
- Always active , As long as one operand changes , The expression is immediately recalculated , Reassign .
- Operands can be scalars / Vector nets or registers / Function call .
- The assignment delay can be used to control the time when a new value is assigned to the network , Similar to door delay .
give an example
//out It's a network ,in1, in2 It is also a network assign out = in1 & in2; // addr yes 16 Bit vector line network // addr1_bits, addr2_bits All are 16 Bit vector register assgin addr[15:0] = addr1_bits[15:0] ^ addr2_bits[15:0]; // Splicing assign { c_out, sum[3:0]} = a[3:0] + b[3:0] + c_in;
Implicit continuous assignment
See this hidden word , I know , There must be something missing .
Online statement at the same time , Assign a value to it . The network can only be declared once , Therefore, there can only be one implicit continuous assignment .
// Normal assignment wire out; assgin out = in1 & in2; // It is equivalent to wire out = in1 & in2;
Implicit network declaration
Empathy , Since you can hide
assgin, That can be hiddenwireDo you ?Of course, it can be
// out No network statement is made for it , The simulator will infer out Is an implicitly declared network wire in1,in2; assgin out = in1 & in2;
Delay
- Delay in consecutive assignment statements , Used to control the time interval between any operand changes and the statement lvalue is given a new value ( To put it bluntly , When does the value on the left change , This time can be artificially defined ).
- Specify the method of assignment delay :
- Normal assignment delay
- Implicit continuous assignment delay
- Network declaration delay
Delay of ordinary assignment
- Specify the value of the delay in the continuous assignment statement , The delay value is located at
assginBack .assgin #10 out = in1 & in2; - Inertia delay : In the example above ,
in1 & in2The new value of , Before assigning to the left , Yes 10 Time unit delay , If in this 10 In units of time ,in1 & in2The value of has changed again , The new value of the assignment expression is retrievedin1 & in2The current value of the . This property is inertia delay .
- As shown in the figure , Signals smaller than the delay time are shielded , Because I just planned 10 Time unit assignment 1 to out, result in1 I become 0 了 , therefore out by 0. It can be used to shield pulse signals with short time .
Delay of implicit continuous assignment
- Empathy , The concept is the same , It's just that the assignment method has changed .
// Implicit continuous assignment wire #10 out = in1 & in2; // Equivalent to wire out; assign #10 out = in1 & in2;
Delay of network declaration
- Empathy , The concept is the same
// Network delay wire #10 out; assgin out = in1 & in2; // Equivalent to wire out; assign #10 out = in1 & in2;
expression
Data flow modeling uses expressions to describe the design . expression 、 Operators and operands are the basis of data flow modeling .
expression : Composed of operators and operands , The purpose is to calculate a result according to the meaning of the operator .
a ^ b addr[20:17] + addr[20:17] in1 | in2Operands : Operands can be any data type defined ,
The operator : An operation on an operand produces a result .
Operator type
- There are several types of operators : The arithmetic 、 Logic 、 Relationship 、 Equivalent 、 Bitwise 、 cut 、 displacement 、 Splicing and conditional operators .


- Pick a few unfamiliar records
Equivalent operator
- Relevant instructions are shown in the figure

Reduction operator
- There is only one operator , Operate on vector operands bit by bit , Produce one by one results .

Conditional operators
With three operands , usage :
condition_expr ? true_expr : false_expr;namely : Evaluate conditional expressions , If it is true , The calculation
true_expr; For false , Calculationfalse_expr; For uncertainty x, Then both expressions are evaluated , Then the two results are compared bit by bit . If equal , Then the value of this bit in the result is the value of this bit in the operand ; If you don't want to wait , Then the value of this bit in the result is x.Conditional expressions are similar to multiplexers

Be careful :if-else You can replace conditional expressions , But only in block statements , Cannot replace .
priority
- It is recommended to separate the expressions with parentheses .

give an example
Choose a multi-path selector
- Here's the picture , This is the door level modeling description learned earlier

- Use logical equations to describe

- Use the conditional operator

- so , Modeling with data flow is very simple .
Four position full adder
- Empathy , Use data flow operation statements to describe a four bit full adder

Pulse carry counter
summary
边栏推荐
- [leetcode] length of the last word [58]
- [untitled]
- from pip._internal.cli.main import main ModuleNotFoundError: No module named ‘pip‘
- 2022 safety officer-c certificate examination question simulation examination question bank and simulation examination
- SWT/ANR问题--SWT 导致 kernel fuse deadlock
- Redis master-slave synchronization
- Leetcode(34)——在排序数组中查找元素的第一个和最后一个位置
- Material Design组件 - 使用BottomSheet展现扩展内容(一)
- dat. GUI
- 常见的积分商城游戏类型有哪些?
猜你喜欢

Redis master-slave synchronization

2022 R1 fast opening pressure vessel operation test questions and answers

Experience of practical learning of Silicon Valley products

Distance measurement - Hamming distance

Zero foundation tutorial of Internet of things development
![[micro service sentinel] sentinel integrates openfeign](/img/8b/46156255fd980eb422c7e05d5af7ee.png)
[micro service sentinel] sentinel integrates openfeign

第六章 数据流建模

from pip._ internal. cli. main import main ModuleNotFoundError: No module named ‘pip‘

Huisheng Huiying 2022 intelligent, fast and simple video editing software

What professional classification does the application of Internet of things technology belong to
随机推荐
物联网现状及未来发展趋势
Matplotlib常用图表
股票开户哪个证券公司最好,有安全保障吗
ARP message header format and request flow
问题随记 —— /usr/bin/perl is needed by MySQL-server-5.1.73-1.glibc23.x86_64
物联网应用技术专业是属于什么类
Reproduction process and problems of analog transformer (ICLR 2022 Spotlight)
每日三题 6.30(2)
Postgresql源码(58)元组拼接heap_form_tuple剖析
2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板
ShanDong Multi-University Training #3
ShanDong Multi-University Training #3
上海炒股开户选择手机办理安全吗?
Behind sharing e-commerce: the spirit of CO creation, symbiosis, sharing, CO prosperity and win-win
力扣今日题-241. 为运算表达式设计优先级
SWT/ANR问题--SWT 导致 low memory killer(LMK)
mysql:insert ignore、insert和replace区别
Redis data types and application scenarios
Switch to software testing, knowing these four points is enough!
Redis 主从同步