Verilog task yield "x" for a variable in a timestep

OP (Company: HIT) #5385785
Rate this post
• ▲ useful
▼ not useful
Hi!
In Modelsim SE 10.1a, I tried to code a counter which counts from 0 to 
118 again and again. When the counter reaches #40 and #59, port ctl_1 
and ctl_2 each delivers "1" for 4 period of clocks. Below is my 
code(also attached from files).

But when I simulate, at #40 ctl_1 becomes "x" instead of "1", meanwhile, 
the similar #59 functions just right(wave.jpg shows that). Below is my 
module code. Using tasks is just for the purpose of studying, when I 
give up using task and simply use NBA such as ctl_1 <= 1, the problem 
disappears. Can anyone give any hints? Thanks!
Attached files:

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.