"Lore Leunoeg" <
[email protected]> wrote in message
news:
[email protected]...
> Hello
>
> I need to write a testbench which assigns one value at the rising edge and
> another value at the falling edge of the clock.
>
> I tried the code below but the value is always assignd only at the rising
> edge. What is my mistake?
>
It is assigning at both edges, but you're only seeing it change at the
falling edge (not the rising edge as you state) because you never changed
the value of the variable 'i' prior to the rising edge assignment. I'm
assuming that you want to increment 'i' at both places which means that you
need to add "i:= i + 1;" either prior to the first assignment to s_din (the
one preceding when s_clk gets set to 1) or just prior to the "end loop"
statement. Lastly, you have no initial assignment for the variable 'i'
which is probably a mistake as well.
Kevin Jennings