1.delay control : an expression specifies the time duration between initially encountering the statement and when the statement actually executes.

the delay expressiong can be dynamic function of the state of the circuit,but it can be a simple number that separates statement

executions in time.

2.event control: which allows statement execution to be delayed until the occurence of some simulation event occurring in a procedure executing

concurrently with this procedure.

a simulation event can be a change of value on a net or variable(an implicit event) or the occurrence of an explicity named event

that is triggered from other procedures(an explicit event).

most often , an event control is p positive or negative edge on a clock signal.


Simulation time can advance by one of the following three methods:

1.a delay control   ----> introduced by the symbol #

2.an event control  -----> introduced by the symbol @

3.the wait statement ----> operates like a combination of the event control and the while loop


Delay control:

1.the delay expression evaluates to an unknow or high-impedance value, it shall be interpreted as zero delay.

2.the delay expression evaluates to a negative value, it shall be interpreted as a two-complement unsigned integer of

the same size as a time variable.

3.specify parameters are permitted in the delay expression.

eg: #10 rega = regb;

#D   rega = regb;  //D is parameter

#((d+e)/2) rega = regb;

 #regr  regr = regr + 1;   // delay is the value in regr

Event control:

1.implicity event( a value change on a net or variable)

2.explicity  event(the occurrence of a declared event即named event)

1.a negedge : from 1 to x / z /0; from x /z to 0

2.a posedge : from x/z/0 to 1    ; from x /z to 1

1.an implicity event shall be detected on any change in the value of the expression.

2.an edge event shall be detected only on the least significant bit (LSB)of the expression.

3.a change of value in any operand of the expression without a change in the expression in the result of the                                                 expression shall not be detected as an event.

@xx statements;

@(posedge xx) statements;

@(negedge xx) statements;

an event shall not hold any data. The following are the characteristic of a named event:

---It can be made to occur at any particular time.

---It has no time duration

--- Its occurrence can be recognized by using the event control

事件event 可以做或运算:

@(trig or enable) rega = regb;

@(posedge clk_a or posedge clk_b or trig) rega = regb;

可以把上面的or换成逗号(,)。


对@*解析:

All net and variable indentifiers that appear in the statement will be automatically added to the event expression with

these exception:

1.Identifiers that only appear in wait or event expressions

2.Identifiers that only appear as a hierachical_variable_identifier in the variable_lvalue of the left_hand side of assignments

Nets and variables that appear on the right_hand side of assignments,in function and task calls, in case and conditional                                          expressions, as an index variable on the left-hand side of assignments, or as variables in case item expressions shall all be                                     included by these rules.

eg1: //此例子或许可以实现event与操作

always@*  begin   ///equivalent to @(b)

@(i) kid = b;   //i is not added to @*

end

eg2:

always@*begin //same as @(a or en)

y = 8'bff;

y[a] = !en;

eg3:

always@* begin //same as @(a or en)

next = 4'b0;

case(1'b1)

state[IDLE] : if(go) next[READ] = 1'b1;

else    next[IDLE]  = 1'b1;

state[READ] :          next[DLY]   = 1'b1;

state[DLY]   : if(!ws) next[DONE]  = 1'b1;

else    next[READ]  = 1'b1;

state[DONE] :            next[IDLE]   = 1'b1;

endcase

end


level-sensitive event control / edge-senstive event control

1.@(xx)

@(posedge xx)

@(negedge xx)

分别是双边沿、上升沿、下降沿三种事件控制格式。

2.wait(xx) 是电平事件控制 ,xx为真是执行wait后面的语句。


intra-assignment timing controls / inter-assignment timing controls

1. An intra-assignment delay or event control shall delay the assignment of the new value to the left-hand side,but

right-hand expression shall be evaluated before the delay,instead of after the delay .

2. the intra-assignment delay and event control can be applied to both blocking assignments and nonblocking                                                         assignments.(此条Verilog标准讲的不是很细,有些模糊

3.the number of occurrences of an event can be variable

repeat (a) @(event_expression)

INTRA-ASSIGNMENT TIMING CONTROL EQUIVALENCE(有些像非阻塞赋值)

with intra-assignment construct                                                                      without intra-assignment construct

a = #5 b;  ===========================================>  begin

temp =b;

# a = temp;

end

---------------------------------------------------------------------------------------------------------------------------------------------------------

a = @(posedge clk) b;                                                                                       begin

                                  temp = b;

                                             @(posedge clk);

                                             a = temp;

                                             end

----------------------------------------------------------------------------------------------------------------------------------------------------------

a = repeat(3) @(posedge clk) b;                                                                       begin

                                             temp = b;

                                             @(posedge clk);

                                             @(posedge clk);

                                             @(posedge clk);

                                             a = temp;

                                             end

PS:1.intra-assignment can prevent  a race-condition

fork            ///data swap

a = #4 b;

b = #4 a;

end

2.intra-assignment waiting for events is also effective

fork          ///data shift

a = @(posedge clk)  b;

b = @(posedge clk) c;

end

verilog behaviral modeling -- procedural timing contronls的更多相关文章

  1. verilog behavioral modeling --procedural assignments

    1.procedural assignments are used for updating reg ,integer , time ,real,realtime and memory data ty ...

  2. verilog behavioral modeling ---Block statements

    block statements : 1. sequential block  : begin-end block 2.parallel block       :  fork - join bloc ...

  3. verilog behavioral modeling --loop statement

    1.forever 2.repeat 3.while 4.for The for statement accomplishes the same results as the following ps ...

  4. ModelSim+Synplify+Quartus的Alte

    [page_break] 本文适合初学者,源代码:mux4_to_1.v  工作内容: 1.设计一个多路选择器,利用ModelSimSE做功能仿真: 2.利用Synplify Pro进行综合,生成xx ...

  5. Linking code for an enhanced application binary interface (ABI) with decode time instruction optimization

    A code sequence made up multiple instructions and specifying an offset from a base address is identi ...

  6. Verilog中的specify block和timing check

    在ASIC设计中,有两种HDL construct来描述delay信息: 1)Distributed delays:通过specify event经过gates和nets的time,来描述delay; ...

  7. Verilog Tips and Interview Questions

    Verilog Interiew Quetions Collection :  What is the difference between $display and $monitor and $wr ...

  8. verilog FAQ(zz)

    1. What is the race condition in verilog? Ans :The situation when two expressions are allowed to exe ...

  9. 9.3.1 The assign and deassign procedural statements

    IEEE Std 1364™-2001, IEEE Standard Verilog® Hardware Description Language The assign procedural cont ...

随机推荐

  1. [題解](DP)CF713C_Sonya and Problem Wihtout a Legend

    對於不嚴格單調的我們可以n^2DP,首先每個數一定在原數組中出現過,如果沒出現過不如減小到出現過的那個花費更小,效果相同 所以f[i][j]表示把i改到離散化后j的最小代價,每次維護前一狀態最小值mn ...

  2. C# 中的构造函数与析构函数

    C# 中的构造函数 类的 构造函数 是类的一个特殊的成员函数,当创建类的新对象时执行. 构造函数的名称与类的名称完全相同,它没有任何返回类型. 下面的实例说明了构造函数的概念: using Syste ...

  3. Gym - 101810D ACM International Collegiate Programming Contest (2018)

    bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #de ...

  4. SecureCRT无法连接虚拟机Linux—虚拟网卡(NAT方式)IP(169.254.xx.xx)无效问题

    搞了一晚上,终于解决了http://blog.csdn.net/zengxianyang/article/details/50394809

  5. 23 在java中使用groovy类

    1       在java中使用groovy类 1.1  直接调用groovy类 在java中调用Groovy类,需要增加Groovy运行时到java的classpath中. pom.xml < ...

  6. Retrofit实现Delete请求

    //设置取消关注 @Headers("Content-Type:application/x-www-form-urlencoded") @HTTP(method = "D ...

  7. P1218 [USACO1.5]特殊的质数肋骨 Superprime Rib

    题目描述 农民约翰的母牛总是产生最好的肋骨.你能通过农民约翰和美国农业部标记在每根肋骨上的数字认出它们.农民约翰确定他卖给买方的是真正的质数肋骨,是因为从右边开始切下肋骨,每次还剩下的肋骨上的数字都组 ...

  8. AJPFX关于单例设计模式

    单例设计模式优势:保证一个类在内存中的对象唯一性. 比如:多程序读取一个配置文件时,建议配置文件封装成对象.会方便操作其中数据,又要保证多个程序读到的是同一个配置文件对象,就需要该配置文件对象在内存中 ...

  9. lwz-过去一年的总结(15-16)

    今天2016年2月6日,还有1个半小时的时间,就要离开这个工作了9个月的地方,准备前往下个城市了.趁着这点时间,来给过去的一年做个即兴的总结吧. 2015年的2月份,在以前同学的提议和支持下,我重新学 ...

  10. SpringAOP 设计原理

    1.  设计原理 引入了,代理模式. java 程序执行流: 如果从虚拟机的角度看,整个程序的过程就是方法的调用,我们按照方法的执行顺序,将方法调用成一串. 在方法之间有着Join Point 连接点 ...