Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Accessing a procedure

Reply
Thread Tools

Accessing a procedure

 
 
ALuPin
Guest
Posts: n/a
 
      04-07-2004
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) <= d;
end if;

if d='0' then
n:=0;
else
n:=n+1;
end if;


end feed;

begin
....
-------------------------------------------------------
-------------------------------------------------------
process(t_Reset, t_Clk)
begin
if t_Reset='1' then
t_history <= (others => '0');
elsif rising_edge(t_Clk) then
t_history <= t_history;
if t_Enable_in='1' then
for i in 15 downto 0 loop
feed(d => t_In_data(i),
history => 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 With Quote
 
 
 
 
Egbert Molenkamp
Guest
Posts: n/a
 
      04-07-2004

"ALuPin" <> wrote in message
news: om...
> Hi,
>
> I have a problem with accessing a procedure in a special manner:
> procedure feed(signal d : in std_logic;
> signal history : out std_logic_vector(history_size-1
> # ** Error:

H:/EDA/Altera/USB_Extender/16bit_Interface_Module/Decode_destuff_new/simulat
ion/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/simulat
ion/modelsim/tb_decode_destuff_hs.vhd(146):
> VHDL Compiler exiting
>
> How can I change that?


Remove SIGNAL
procedure feed(d : in std_logic; ...

Egbert Molenkamp


..


 
Reply With Quote
 
 
 
 
fe
Guest
Posts: n/a
 
      04-07-2004
> 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) <= d;
> end if;
>
> if d='0' then
> n:=0;
> else
> n:=n+1;
> end if;
>
>
> end feed;
>


I didn't check why modelsim complain but your procedure will not work.
Variable inside a procedure are not static. So, each time you call the
procedure feed, n and ptr are recreated and initialize to 0 (begining of the
range).

More, you never assigned a value to ptr.

Yes null exist in VHDL.

You don't need to declare input d as a signal (procedure feed( d: in
std_logic; ...) except if feed is a concurrent procedure.

regards
fe





 
Reply With Quote
 
Mike Treseler
Guest
Posts: n/a
 
      04-07-2004
(ALuPin) wrote in message news:<. com>...
> Hi,
>
> I have a problem with accessing a procedure in a special manner:
>
> for i in 15 downto 0 loop
> feed(d => t_In_data(i),


> I get the following error message (Modelsim5.7e)
>> The actual for parameter d must denote a static signal name.


> How can I change that?


You could do the slice in the procedure.
Also note that procedure variables are not static.
The version below compiles but is incomplete and untested.

-- Mike Treseler
------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity xy is
end entity xy;

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(bit_ptr : in natural;
h_ptr : in natural;
data : in std_logic_vector;
signal history : out std_logic_vector
(history_size-1 downto 0)
) is
variable d : std_ulogic;
begin
d := data(bit_ptr);
history (h_ptr) <= d;
end feed;

begin
process(t_Reset, t_Clk)
variable bit_ptr_v : natural;
variable history_ptr_v : natural range 0 to 1023;
begin
if t_Reset = '1' then
t_history <= (others => '0');

elsif rising_edge(t_Clk) then
if t_Enable_in = '1' then
for i in 15 downto 0 loop
history_ptr_v := 1 + history_ptr_v;
feed(bit_ptr => i,
h_ptr => history_ptr_v,
data => t_In_data,
history => t_history
);
end loop;
end if;
end if;
end process;
end testb;
 
Reply With Quote
 
ALuPin
Guest
Posts: n/a
 
      04-08-2004
> Also note that procedure variables are not static.

Does that mean that variables in processes are static that is that
they keep their value ?
For simulation and also for synthesis? I thought they did not ...


Rgds
Andrés V.
 
Reply With Quote
 
Jonathan Bromley
Guest
Posts: n/a
 
      04-08-2004
On 7 Apr 2004 23:39:39 -0700, (ALuPin) wrote:

>> Also note that procedure variables are not static.

>
>Does that mean that variables in processes are static that is that
>they keep their value ?


Yes. Processes are elaborated at the beginning of simulation,
procedures are elaborated afresh on entry. Consequently, process
variables are static. By contrast, procedure and function
variables are dynamically elaborated and disappear when the
procedure/function exits.

>For simulation and also for synthesis?


Yes, both. With a few dishonourable exceptions, synthesis
will always deliver the same results as simulation, and will
refuse to process any constructs that can't deliver that
exact match. The exceptions relate to stuff that synthesis
tools think it's safe to ignore, such as time delays and
variable initialisations. Caveat scriptor
--
Jonathan Bromley, Consultant

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

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:
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 With Quote
 
Nicolas Matringe
Guest
Posts: n/a
 
      04-08-2004
Jonathan Bromley a écrit:
> [...] The exceptions relate to stuff that synthesis
> tools think it's safe to ignore, such as time delays and
> variable initialisations. Caveat scriptor


Sensitivity lists, too, perhaps?
Actually, I've been taught some years ago that they ignored them and I
never checked to see if they still did, apart from warning about
incomplete lists.

--
____ _ __ ___
| _ \_)/ _|/ _ \ Adresse de retour invalide: retirez le -
| | | | | (_| |_| | Invalid return address: remove the -
|_| |_|_|\__|\___/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
procedure as argument in procedure AlexWare VHDL 2 10-23-2009 09:14 AM
'Procedure or function <stored procedure name> has too many arguments specified',,,ARGH! Mike P ASP .Net 0 06-19-2006 01:19 PM
Accessing Stored Procedure from IIS stjulian ASP General 4 02-25-2005 09:25 PM
New Stored Procedure Template in .Net Sarmad Aljazrawi ASP .Net 0 12-16-2003 11:36 AM
Code behind Procedure Jim Ciotuszynski ASP .Net 2 10-10-2003 02:29 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57