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.

What will synthesizer do when there is a race condition?

Status
Not open for further replies.

kelvin_sg

Advanced Member level 4
Joined
Aug 17, 2004
Messages
102
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Singapore
Activity points
852
I was studying codes written by others, one style is confusing me,

Code:
always @(posedge clk or negedge rst) begin
if (rst == 1'b0) begin
   dat <= 10'd0;
end
else begin
   if (sel0) begin
      dat <= dat0;
   end
   if (sel1) begin
      dat <= dat1;
   end
end
end

The code is from a well known IC design companies, whom we outsource
RTL design to.

Will synthesizer do well with this? I was taught not to use this style previously.
 

Not a great way to code , but it will be implemented as a mux (or equivalent) followed by a flop (with asynchronous reset) ...
However there might be an inferred latch - due to the absence of an else statement for the if statement

How do you see the race condition happening ???
 

vinayshivakumar said:
Not a great way to code , but it will be implemented as a mux (or equivalent) followed by a flop (with asynchronous reset) ...
However there might be an inferred latch - due to the absence of an else statement for the if statement

How do you see the race condition happening ???

so it's not called a race.. :!: but I am concerned with condition when "sel0&sel1 == 1'b1"

AFAIK Simulation-wise, it will behave like the table, but I am not sure how
synthesizer will deal with it. That's why I ask.
The code will be used in both design compiler and Cadence's RTL compiler.



sel0 sel1 dat
0 0 dat(-1) <-unchange
1 0 dat0
0 1 dat1
1 1 dat1


always @(posedge clk or negedge rst) begin
if (rst == 1'b0) begin
dat <= 10'd0;
end
else begin
if (sel0) begin
dat <= dat0;
end
if (sel1) begin
dat <= dat1;
end
end
end
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top