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.

[SOLVED] Case statement Verilog

Status
Not open for further replies.

stark43

Member level 1
Member level 1
Joined
Oct 24, 2021
Messages
35
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
386
Hello, I see sample codes like this. It got a little weird. Each mipi_clk will have rst_cnt <= 0, but rst_cnt <=1 if the necessary conditions are met. Aren't these processes parallel?

1658414245040.png
 

Solution
The way that Verilog scheduling works for these non-blocking statements (<=). The RHS of the assignments are computed from top to bottom, and the assignment of these RHS results to the LHS is assigned at the end of the always block.

If a value is updated multiple times the last assignment "wins" and is assigned to the LHS.

kaz1

Full Member level 5
Full Member level 5
Joined
Aug 15, 2019
Messages
252
Helped
16
Reputation
32
Reaction score
35
Trophy points
28
Location
UK
Activity points
1,536
Hello, I see sample codes like this. It got a little weird. Each mipi_clk will have rst_cnt <= 0, but rst_cnt <=1 if the necessary conditions are met. Aren't these processes parallel?

View attachment 177552
The first assignment is default.
The last condition overrides.
 

KlausST

Super Moderator
Staff member
Advanced Member level 7
Joined
Apr 17, 2014
Messages
23,490
Helped
4,757
Reputation
9,535
Reaction score
5,170
Trophy points
1,393
Activity points
155,796
Hi,

but in opposite to software code it is not written to "0" and some time later to "1" resulting in a short pulse or glitch.
It is processed at the same time, thus no glitch. Either clean "0" or clean "1" synchronized to posedge of mipi_clk.

Klaus
 

ads-ee

Super Moderator
Staff member
Advanced Member level 7
Joined
Sep 10, 2013
Messages
7,941
Helped
1,822
Reputation
3,654
Reaction score
1,807
Trophy points
1,393
Location
USA
Activity points
60,176
The way that Verilog scheduling works for these non-blocking statements (<=). The RHS of the assignments are computed from top to bottom, and the assignment of these RHS results to the LHS is assigned at the end of the always block.

If a value is updated multiple times the last assignment "wins" and is assigned to the LHS.
 
Solution
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top