Accesing a procedure

Hi,

I have a problem with accessing a procedure in a special manner:

Some background information: I want to use a testbench in which I write the valid input data (16bit) for my VHDL module under test into a ringbuffer. That is my VHDL module gives out data (16 cleaned bit) after some pipelining stages. These output data should be compared with the data I have written into my ringbuffer (The data in the ringbuffer are unstuffed, that is after six consecutive ones the following zero is unstuffed. This unstuffing function is of course also implemented in the VHDL module under test itself.). By the means of this object-oriented check I want to verify my module.

Here is my problem:

------------------------------------------------------------ architecture testb of xy is signal t_Enable_in : std_logic; signal t_Clk : std_logic; signal t_Reset : std_logic; signal t_In_data : std_logic_vector(15 downto 0); constant history_size : integer := 1024; signal t_history : std_logic_vector(history_size-1 downto 0);

... procedure feed(signal d : in std_logic; signal history : out std_logic_vector(history_size-1 downto 0)) is variable ptr : integer range 0 to 1023; variable n : integer range 0 to 6; begin

if ((n=6) and (d='0')) then null; --??? Does this exist in VHDL ? else history (ptr mod history_size) t_history ); end loop; end if; end if; end process;

-------------------------------------------------------

------------------------------------------------------- end testb;

I get the following error message (Modelsim5.7e)

# ** Error: H:/EDA/Altera/USB_Extender/16bit_Interface_Module/Decode_destuff_new/simulation/modelsim/tb_decode_destuff_hs.vhd(134): The actual for parameter d must denote a static signal name. # ** Error: H:/EDA/Altera/USB_Extender/16bit_Interface_Module/Decode_destuff_new/simulation/modelsim/tb_decode_destuff_hs.vhd(146): VHDL Compiler exiting

How can I change that?

I would appreciate your time and help.

Kind regards Andres V.

Reply to
ALuPin
Loading thread data ...

into

after

unstuffing

module.

H:/EDA/Altera/USB_Extender/16bit_Interface_Module/Decode_destuff_new/s imulation/modelsim/tb_decode_destuff_hs.vhd(134):

H:/EDA/Altera/USB_Extender/16bit_Interface_Module/Decode_destuff_new/s imulation/modelsim/tb_decode_destuff_hs.vhd(146):

Hi Andres, the problem is that an individual bit of a vector inside a for loop is considered to be dynamic. In other words the indexing is dynamic. This is because for loops are "dynamically elaborated". Have a look at the section on "longest static prefix" in the comp.lang.vhdl FAQ.

There are a number of possibilities

1) pass the whole vector into the procedure and test it all in one go outside the for loop

2) re-write using a generate statement instead, i.e. create 16 parallel processes, one per bit. The generate index is then constant (not dynamically elaborated) so it will be ok.

e.g.

g: for i in 15 downto 0 generate

end generate;

Hope this helps - the comp.lang.vhdl FAQ section at

formatting link
is worth reading anyway,

regards

Alan

--
Alan Fitch
Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project
Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24
1AW, UK
Tel: +44 (0)1425 471223                          mail:
alan.fitch@doulos.com
Fax: +44 (0)1425 471573                           Web:
http://www.doulos.com

The contents of this message may contain personal views which are not
the
views of Doulos Ltd., unless specifically stated.
Reply to
Alan Fitch

Hi, here is what seems odd to me: t_history <= t_history. I think you don't need to do this, i.e. if t_Enable_in is not asserted, this signal will keep the old value. The 'null' command exists in VHDL, but I've never used it in this way. Testbenches usually contain checker procedures to check if the output complies with the expected. You can set the checker procedure to notify you about the test results by: assert (condition_not_fulfilled) report "test passed"; assert (condition_fulfilled) report "test failed"; where condition means comparing the expected output with the data you collected from the output. I hope I offered you at least a hint :) BR, Marija

Reply to
Marija

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.