05-10-2012 07:36 AM
I'm making a tes bench for a code. I want to give an input (which is a std_logic) a '1' for only 10 ns after the first 80 ns.
I used the "wait for 80 ns;" statement to initiate the starting time and the input was '1' but it was constantly '1' for the whole time after that. How can I make the input '0' again after 80 ns (it's like a brief push on a push button).
Solved! Go to Solution.
05-10-2012 11:44 PM
the wait statement just sets some timing information but does not change signal values.
The scenario you described would need something like this in your stimuli process:
my_input <= '0'; -- initial input value
wait for 80 ns; -- initial delay
my_input <= '1'; -- input asserted
wait for 10 ns; -- signal hold time
my_input <= '0'; -- input deasserted
... -- more stimuli to follow
Another option would be to use the after statement in the assignment to the signal.
This is a little more tricky , but shorter and works concurrently as well as in a process.
Syntax may look like this:
my_input <= '0',
'1' after 80 ns,
'0' after 90 ns;
This table like style makes reading and editing easier, compared to a single line.
See, that the times are absolute here starting at the time of assingment, and increasing then.
For special modeling purtposes there are modifiers like "transport", "reject" etc. Read about the details in a textbook about VHDL.
Have a nice simulation