FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-18-2006, 03:41 PM
Al
Guest
 
Posts: n/a
Default procedure and actual parameters

Hi everyone, I have this simple procedure which will call two times
another procedure, in which I give actual parameters to assign values.
These actuals are declared in a package so that they can be visible to
all the procedures in any part of the hierarchy.

procedure WRITEop (
ctrl : in string;
data : in string) is
begin

send_data (strobe, write, select, data, io);
send_data (strobe, write, select, ctrl, io);

end procedure;

unfortunately this doesn't compile with Modelsim and the error message
is the following:

> # ** Error: ../SlowControl_st.vhd(197): Cannot drive signal 'sc_write' from this subprogram.
> # ** Error: ../SlowControl_st.vhd(197): Cannot drive signal 'sc_select' from this subprogram.
> # ** Error: ../SlowControl_st.vhd(197): Cannot drive signal 'sc_io' from this subprogram.
> # ** Error: ../SlowControl_st.vhd(239): No feasible entries for subprogram "send_data".
> # ** Error: ../SlowControl_st.vhd(280): No feasible entries for subprogram "send_data".
> # ** Error: ../SlowControl_st.vhd(325): No feasible entries for subprogram "send_data".
> # ** Error: ../SlowControl_st.vhd(341): No feasible entries for subprogram "send_data".


The "send_data" procedure is the following:

procedure send_data(
signal strb : out std_logic;
signal wr : out std_logic;
signal sel : out std_logic;
data : in string;
signal IO_reg : out std_logic_vector (15 downto 0)
) is

variable data_send : std_logic_vector (15 downto 0);
variable data_line : line;

begin

sel <= '1';
write(data_line, data);
hread(data_line, data_send);
wr <= '0';
strb <= '0';
IO_reg <= (others => 'Z');
wait until rising_edge (clk);
wr <= '1';
wait for 7 ns;
IO_reg <= data_send;
wait until rising_edge (clk);
strb <= '1';
wait until rising_edge (clk);
strb <= '0';
wr <= '0';
wait for 4 ns;
IO_reg <= (others => 'Z');
end procedure;

I wanted to make a procedure which can make different operations calling
other procedures, without the need to pass these actual parameters all
the time.
Have I been clear? (sorry but i don't think is a matter of language,
just a matter of my mind!)
Do you have any suggestions?

Al

--
Alessandro Basili
CERN, PH/UGC
Hardware Designer
Reply With Quote
  #2 (permalink)  
Old 10-18-2006, 04:20 PM
Andy
Guest
 
Posts: n/a
Default Re: procedure and actual parameters

A procedure not declared in a process cannot drive signals not passed
explicitly to it. This has to do with locally statically being able to
determine the signals that a process (implied or explicit) drives.
This has been covered in recent threads here.

To simplify the parameter passing, you can create one or more records
for the ports. The only problem is that VHDL currently only allows a
single mode for the entire record, and all of its elements. Supposedly
they're working on that... For now, you can use inout, but that means
that all of the elements have to be resolved types, and you must
remember to drive "inputs" with 'Z's from within the procedures, so
that the default driver value ('U') does not conflict with whoever is
trying to drive it with a real value. The necessity of resolving all
those signals also eats simulation performance.

Andy


Al wrote:
> Hi everyone, I have this simple procedure which will call two times
> another procedure, in which I give actual parameters to assign values.
> These actuals are declared in a package so that they can be visible to
> all the procedures in any part of the hierarchy.
>
> procedure WRITEop (
> ctrl : in string;
> data : in string) is
> begin
>
> send_data (strobe, write, select, data, io);
> send_data (strobe, write, select, ctrl, io);
>
> end procedure;
>
> unfortunately this doesn't compile with Modelsim and the error message
> is the following:
>
> > # ** Error: ../SlowControl_st.vhd(197): Cannot drive signal 'sc_write' from this subprogram.
> > # ** Error: ../SlowControl_st.vhd(197): Cannot drive signal 'sc_select' from this subprogram.
> > # ** Error: ../SlowControl_st.vhd(197): Cannot drive signal 'sc_io' from this subprogram.
> > # ** Error: ../SlowControl_st.vhd(239): No feasible entries for subprogram "send_data".
> > # ** Error: ../SlowControl_st.vhd(280): No feasible entries for subprogram "send_data".
> > # ** Error: ../SlowControl_st.vhd(325): No feasible entries for subprogram "send_data".
> > # ** Error: ../SlowControl_st.vhd(341): No feasible entries for subprogram "send_data".

>
> The "send_data" procedure is the following:
>
> procedure send_data(
> signal strb : out std_logic;
> signal wr : out std_logic;
> signal sel : out std_logic;
> data : in string;
> signal IO_reg : out std_logic_vector (15 downto 0)
> ) is
>
> variable data_send : std_logic_vector (15 downto 0);
> variable data_line : line;
>
> begin
>
> sel <= '1';
> write(data_line, data);
> hread(data_line, data_send);
> wr <= '0';
> strb <= '0';
> IO_reg <= (others => 'Z');
> wait until rising_edge (clk);
> wr <= '1';
> wait for 7 ns;
> IO_reg <= data_send;
> wait until rising_edge (clk);
> strb <= '1';
> wait until rising_edge (clk);
> strb <= '0';
> wr <= '0';
> wait for 4 ns;
> IO_reg <= (others => 'Z');
> end procedure;
>
> I wanted to make a procedure which can make different operations calling
> other procedures, without the need to pass these actual parameters all
> the time.
> Have I been clear? (sorry but i don't think is a matter of language,
> just a matter of my mind!)
> Do you have any suggestions?
>
> Al
>
> --
> Alessandro Basili
> CERN, PH/UGC
> Hardware Designer


Reply With Quote
  #3 (permalink)  
Old 10-18-2006, 04:23 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: procedure and actual parameters

Al wrote:

> I wanted to make a procedure which can make different operations calling
> other procedures, without the need to pass these actual parameters all
> the time.


Either declare or overload the
procedure in the calling process.
Read today's posing in the thread
"Re: RFC on VHDL LRM 93[8.4.1]"

-- Mike Treseler
Reply With Quote
  #4 (permalink)  
Old 10-18-2006, 04:54 PM
Al
Guest
 
Posts: n/a
Default Re: procedure and actual parameters



Mike Treseler wrote:
>
> Either declare or overload the
> procedure in the calling process.
> Read today's posing in the thread
> "Re: RFC on VHDL LRM 93[8.4.1]"
>
> -- Mike Treseler


I got the point, I should have read that thread before posting mine!
Thanks

Al


--
Alessandro Basili
CERN, PH/UGC
Hardware Designer
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need info on systolic arrays in actual use Marc Reinig FPGA 7 03-12-2008 11:28 AM
Simulation and actual FPGA implementation, how different it is? Ankit Raizada FPGA 3 04-14-2005 10:30 AM
Actual is not a globally static expression valentin tihomirov VHDL 7 02-17-2004 04:48 PM
Error: Actual is not a globally static expression Steve Harrad VHDL 5 12-22-2003 09:49 PM
Tool survey for syntax for formal => actual eadgbe VHDL 3 09-11-2003 01:37 PM


All times are GMT +1. The time now is 07:22 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved