M
makeuptest
I was writing some code and decided to make it a procedure to put in a
library. I have written functions many times, but not a procedure.
This was a routine for some registers and counters internal to the
procedure and so required a clock and reset. I couldn't figure out
how to wirte it so that it would be inside a clocked process, so I
added the clock and reset to the inputs and put the clocking code
within the procedure.
That was all well and good. But when I tried to test it, none of the
internal variables that should have created registers were being
remembered. I ran a simulation and the variables were getting reset
initially, but on the next entry to the procedure they were back to
being undefined.
Do I have a basic misunderstanding about how procedures operate? I
haven't found a good reference to explain enough to figure out what I
am doing wrong.
Greg
library. I have written functions many times, but not a procedure.
This was a routine for some registers and counters internal to the
procedure and so required a clock and reset. I couldn't figure out
how to wirte it so that it would be inside a clocked process, so I
added the clock and reset to the inputs and put the clocking code
within the procedure.
That was all well and good. But when I tried to test it, none of the
internal variables that should have created registers were being
remembered. I ran a simulation and the variables were getting reset
initially, but on the next entry to the procedure they were back to
being undefined.
Do I have a basic misunderstanding about how procedures operate? I
haven't found a good reference to explain enough to figure out what I
am doing wrong.
Greg