Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Integer data type can not be assigned in always block ?

Status
Not open for further replies.

rettylee

Newbie level 6
Joined
Dec 9, 2010
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,355
A verilog behavior model problem....

Hi,guys:
I want to add jitter to a signal clk.When using random generator task,I need integer data as seed in always block like this:
integer seed;
real d;
always begin
@(posedge clk);
seed = $random;
d = $dist_normal(seed,0,1)/1000.0;
# d ;
clk_out = 1;
@(negedge clk);
..........(like before)
clk_out = 0;
end

But after simulation,I found that seed changed not all with the posedge of clk,some of them changed not at the posedge of clk.I am confused. Is the problem from integer assign ? or my method have problems....
Thank you for your guide !
 
Last edited:

kornukhin

Full Member level 3
Joined
Sep 2, 2010
Messages
165
Helped
46
Reputation
92
Reaction score
46
Trophy points
1,308
Location
Zelenograd
Activity points
2,169
Don't use ';' after 'always'. Try this:

always@(posedge clk)
begin
seed <= $random;
...
end
 

rettylee

Newbie level 6
Joined
Dec 9, 2010
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,355
Thanks for your reply.I tried as you said except using "=" instead of "<=",because I need the begin....end block exeute sequently.But the result is the same as before......
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top