A
Anon Anon
Guest
I have a test-bed that is exercising my entity, setting some inputs and
then setting an 'Execute' bit to force the entity to do its stuff. The
entity is designed to begin execution on the leading edge of the Execute
bit, which clearly means that the test-bed has to reset this at some
convenient time. Unfortunately, the test-bed doesnt really include any
slack time in which to do this, so I have coded it along these lines:
Testbed:
process exercise_the_entity(clk)
begin
if rising_edge(clk) then
<set up data etc for the entity>
Execute <= 1; -- start the processing
Else -- must be falling edge of CLK
Execute <= 0; -- clear the flag, in case its set
End if;
end process;
This doesnt feel right to me, since it means that Im making changes on
the falling edge of the clock which I understand to be a bad thing.
Can anybody suggest a better approach?
In addition, is this likely to be synthesisable?
Thanks
then setting an 'Execute' bit to force the entity to do its stuff. The
entity is designed to begin execution on the leading edge of the Execute
bit, which clearly means that the test-bed has to reset this at some
convenient time. Unfortunately, the test-bed doesnt really include any
slack time in which to do this, so I have coded it along these lines:
Testbed:
process exercise_the_entity(clk)
begin
if rising_edge(clk) then
<set up data etc for the entity>
Execute <= 1; -- start the processing
Else -- must be falling edge of CLK
Execute <= 0; -- clear the flag, in case its set
End if;
end process;
This doesnt feel right to me, since it means that Im making changes on
the falling edge of the clock which I understand to be a bad thing.
Can anybody suggest a better approach?
In addition, is this likely to be synthesisable?
Thanks