Matt,
I recommend that you simulate this before
you go further. Your while loop in the
procedure proc1 executes in 0 time. Since
no time passes between iterations (assigments
to data), when a value of data is scheduled it will
replace (meaning delete from ever happening) the
previous value. So the only value on data
is the last value.
Time needs to pass when apply run your sequence on
data. Note procedures (unlike functions) are permitted
to have wait statements in them. If you are waiting on
a data object, that object will need to have the class
of signal.
You might want to reconsider your problem.
You want your procedures to do an action on an
interface. This means that if you are driving things
to a RAM interface, then you will want the procedure
to drive data, address, and the control signals.
Cheers,
Jim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Lewis
Director of Training mailto:
[email protected]
SynthWorks Design Inc.
http://www.SynthWorks.com
1-503-590-4787
Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Matt said:
Jim,
My procedure is called in a process;
process(rst, clk)
variable ptr: int_r;
begin
rising_edge(clk) then
wr<='1';
proc1(ram, ptr, "jksdf kjsdfjk");
end if;
addr_int<=ptr;
end process;
The contents of the procedure;
procedure proc1(signal data: out bit_vector(7 downto 0);
variable ptr: out int_r;
info: string) is
variable i: int_r:=0;
begin
while i<=info'HIGH loop
if i=0 then
data<=prel;
i:=i+1;
elsif i<=info'LENGTH then
data<=func_call(info(i));
i:=i+1;
else
data<=(others=>'0');
end if;
end if;
ptr:=i;
exit when i=info'HIGH+1;
end loop;
end ChWriteMM;
I would like to be able to get all the values of the variable i as it
increments and use them to strobe a ram address.
I dont think this is possible as the procedure is being called in one clk
cycle.
The variable i is incrementing but at what period i do not know.
When i simulate the code the value of ptr is the final value of i
(info'HIGH), this is no good i need to pass all the
values of i as it reaches info'HIGH.
Thanks,
Matt
--