Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SystemVerilog @(posedge ) inside the always @(posedge ) block

Status
Not open for further replies.

cyboman

Member level 4
Member level 4
Joined
Mar 9, 2010
Messages
71
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
USA
Activity points
1,808
i'm reading a book on verification with system verilog. the book contains sample code which i have questions about

here is the code:
Code:
always @(posedge arbif.request[0]) begin
  $display('displays something');
  @(posedge arbif.grant[0]);
  $display('another something');
end

arbif.request[0] is of type logic. the same goes for arbif.grant[0]

question 1
i always used and was taught to use always @(posedge/negedge ) only with clk or reset. i was told the simulator and the synthesizer will not be able to understand it. so why are we using it here?

question 2
i have never seen posedge statement in another posedge. what would happen here? will the simulator simply ignore all the positive edges of arbif.request[0] when it sees arbif.grant[0]? will it simply wait for a posedge on the arbif.grant[0] and then continue execution?

any help is appreciated.
 

question1: Its not mandatory that posedge is used for clock only. In other words, posedge of any signal can be used in a design. Just that if clock is used across all the blocks in a design, all the changes in the design will happen with a particular event. Hence the name synchronous design. If any other signal name is replaced with clock, design will still function.
 
Q2. The idea is strictly excluded by the concept of edge sensitive events. Should simply give a syntax error.
Thinking of the hardware description language aspect clarifies, that the construct is meaningless.
 

Q2. The idea is strictly excluded by the concept of edge sensitive events. Should simply give a syntax error.
Thinking of the hardware description language aspect clarifies, that the construct is meaningless.

FvM, can you elaborate more on this. i don't think i understand what you are trying to say.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top