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.

Why this Verilog coding used in testbench is wrong?

Status
Not open for further replies.

lostin_eda

Newbie level 6
Newbie level 6
Joined
Aug 16, 2007
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,366
About verilog coding

Hey, the following statement which is used in testbench, and i think it is wrong, right? and tell me why it is wrong thanks for your help

always @ ( a or b or c)
begin
if ( a)
begin
@ (posedge clock);
e = b;
end
else
begin
# 10 ;
e =c ;
end
end
 

Re: About verilog coding

@ (posedge clock);
 

Re: About verilog coding

kanagavel_docs said:
Hi,

Plese describe your requirement...

Kanags

I just want to know that whether "@ (posedge clock )" could be added in the statement
if "a" is true "e" will be assigned with "b" after the rising edge of clock comes, but if "a" or "b" or "c" changed when waiting for the rising edge of clock?
 

Re: About verilog coding

Hi,

This always block is sensitive to a, b, c inputs only. So tough to capture the rising edge of clock. If the clock rise and any one of the input change happens at the same time only the execution will move from this statement. So, add clock in the sensitive list and try.

Regards,
Kanags
 

    lostin_eda

    Points: 2
    Helpful Answer Positive Rating
About verilog coding

Thank you all
 

About verilog coding

i have run this code in ISE9.2i, but there is no error checked ,except no changes on signal.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top