now inside processes

O

Olaf Petzold

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
 
O

Olaf Petzold

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
 
M

Mike Treseler

Olaf said:
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
 
M

Mike Treseler

Olaf said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,918
Members
47,458
Latest member
Chris#

Latest Threads

Top