now inside processes

O

Olaf Petzold

Guest
Hi,

during writing a TB I'm using the following statement:

next_state_decode : process (reset, state)
constant t0 : time := (10-1)*PERIOD;
...
begin
next_state <= state;
case (state) is
when tb_reset =>
if (reset = RESET_ACTIVE) then
next_state <= tb_reset;
else
next_state <= tb_init;
end if;
when tb_init =>
if (now < t0) then
next_state <= tb_init;
else
next_state <= tb_full_write;
end if;
....
Unfortunally the states never changes from state tb_init to
other/further. How can I use the keyword now inside a process, or is
this not possible? A work arround is to use a time counter (as I did
before). May some other hints?

Thanks
Olaf
 
Olaf Petzold wrote:

May some other hints?
It is not necessary to write a
synchronous process to make a synchronous
testbench. Drop the sensitivity list
and use synchronous waits:

procedure tic is
begin
wait until rising_edge(clk_s);
end procedure tic;


http://home.comcast.net/~mike_treseler/test_uart.vhd
 
Mike Treseler schrieb:
Olaf Petzold wrote:

May some other hints?


It is not necessary to write a
synchronous process to make a synchronous
testbench. Drop the sensitivity list
and use synchronous waits:

procedure tic is
begin
wait until rising_edge(clk_s);
end procedure tic;


http://home.comcast.net/~mike_treseler/test_uart.vhd
Thanks. So, your suggestion is to use procedures instead a FSM driven
TB as I did try?

Thanks
Olaf
 
At this time, I try to rewrite my TB using procedures. To get status
informations I use the following:

procedure load_sample_tv (constant name : in string) is

file m_fd : text open read_mode is name;
....
type str_t is access String;
variable m_msg : str_t;
begin
m_msg := string'("read stimulie ") & name & string'(": ");
report m_msg; -- line 176
while not endfile(m_fd) loop
...
end loop;
m_msg := string'("SUCCESS (") & integer'image(i) & string'("
lines).");
report m_msg; -- line 187

end procedure load_sample_tv;

My first try to use access String and got wrong:

# ** Error: (176): Variable "m_msg" is type str_t; expecting type string.
# ** Error: (186): Assignment target type str_t is different from
expression type string.
# ** Error: (187): Variable "m_msg" is type str_t; expecting type string.

How can I write it to compile. Unfortunally there seems no way to
concat both message and print it using one report statement, isn't it?

Thanks
Olaf
 
Olaf Petzold wrote:

Thanks. So, your suggestion is to use procedures instead a FSM driven TB
as I did try?
My intended suggestion was to use a single
process thread with synchronous waits.
Procedures are optional.
Straight-line code works also.

-- Mike Treseler
 
Olaf Petzold wrote:

procedure load_sample_tv (constant name : in string) is
file m_fd : text open read_mode is name;
....
type str_t is access String;
variable m_msg : str_t;
begin
Declare variables and files in the process
*before* load_sample_tv.

-- Mike Treseler
 

Welcome to EDABoard.com

Sponsor

Back
Top