EmbDev.net

Forum: FPGA, VHDL & Verilog level sensitive timing control


von neha s. (neha_s)


Rate this post
useful
not useful
module latch(output reg q,input d,input clk);
  always
  begin
  wait (clk) #100 q=d;
  end
endmodule
module simlat;
  reg D,CLK;
  wire Q;
  initial D=1'b1;
  initial CLK=0'b1;
  latch l1(Q,D,CLK);
  //always #10 CLK=~CLK;//if this is included my simulator hangs 
completely
  initial #16 D=~D;
  initial #200 $finish;
endmodule

//without that statement prgram works just fine. please tell me why??
// thanks in advance.

von wait? (Guest)


Rate this post
useful
not useful
You can't synthesize a wait... try with

always @(posedge clk)

von jojo (Guest)


Rate this post
useful
not useful
always begin

#10 CLK=~CLK;

end


maybe helps?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.