Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Same procedure call in different processes ?

Reply
Thread Tools

Same procedure call in different processes ?

 
 
C T
Guest
Posts: n/a
 
      04-14-2004
I would like to write procedures that can be used in different
processes.

Here is a sample of my VHDL codes:

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

architecture BEHAV of SBUS is

constant addr_hiZ : std_logic_vector(22 downto 0) :=
"ZZZZZZZZZZZZZZZZZZZZZZZ";
constant data_hiZ : std_logic_vector(31 downto 0) :=
"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";

type state_type is (s0,s1,s2,s3,s4,s5,s6,s7);
signal read_sbus, write_sbus, rw_gsp, rw_tsp: state_type;

....

procedure readx(
signal addr : in std_logic_vector(22 downto 0);
signal data : out std_logic_vector(31 downto 0);
signal ack : in std_logic;
signal addr_o : out std_logic_vector(22 downto 0);
signal data_o : inout std_logic_vector(31 downto 0);
signal as, read, rw_done: out std_logic
) is
begin
case read_sbus is
when s0 =>
rw_done <= '0';

data_o <= data_hiZ;
addr_o <= addr_hiZ;
as <= '1' after pd;
read <= '1';
read_sbus <= s1;
....
when s5 =>
rw_done <= '1';
addr_o <= addr_hiZ;
read_sbus <= s0;
when others =>
read_sbus <= s0;
end case;
end procedure;

----similarly for procedure writex


begin --arch

GSP: process(CLK)
begin
if RESET = '0' then
....
elsif rising_edge(CLK) then
if gsp_en = '1' then
case rw_gsp is
when s0 =>
....
readx(iaddr, idata, ack, addr, data, as, read, rw_done);
....
when s1 =>
....
writex(iaddr, idata, ack, addr, data, as, read, rw_done);
....
when others =>
rw_gsp <= s0;
end case;
end if;
end if;
end process;

TSP: process(CLK)
begin
if RESET = '0' then
....
elsif rising_edge(CLK) then
if tsp_en = '1' then
case rw_tsp is
when s0 =>
....
readx(iaddr, idata, ack, addr, data, as, read, rw_done);
....
when s1 =>
....
writex(iaddr, idata, ack, addr, data, as, read, rw_done);
....
when others =>
rw_sp <= s0;
end case;
end if;
end if;
end process;

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


I got following error messages when compiling the codes:


-- Compiling architecture behav of tsbus
** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(67): Cannot
drive signal 'read_sbus' from this subprogram.

** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(111): Cannot
drive signal 'write_sbus' from this subprogram.
** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(172): No
feasible entries for subprogram 'readx'.
** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(242): No
feasible entries for subprogram 'writex'.
** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(394): VHDL
Compiler exiting

I tried to put signal declation for read_sbus, write_sbus, etc. in
packages but that still did not help!

How can I do it correctly then? Many thanks in advance.

Calvin
 
Reply With Quote
 
 
 
 
Egbert Molenkamp
Guest
Posts: n/a
 
      04-15-2004
Have a look at
http://www.vhdl.org/vi/comp.lang.vhd...cedure_drivers

Egbert Molenkamp

"C T" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed) om...
> I would like to write procedures that can be used in different
> processes.
>
> Here is a sample of my VHDL codes:
>
> --------------------------------------------------------------------------

------
>
> architecture BEHAV of SBUS is
>
> constant addr_hiZ : std_logic_vector(22 downto 0) :=
> "ZZZZZZZZZZZZZZZZZZZZZZZ";
> constant data_hiZ : std_logic_vector(31 downto 0) :=
> "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";
>
> type state_type is (s0,s1,s2,s3,s4,s5,s6,s7);
> signal read_sbus, write_sbus, rw_gsp, rw_tsp: state_type;
>
> ...
>
> procedure readx(
> signal addr : in std_logic_vector(22 downto 0);
> signal data : out std_logic_vector(31 downto 0);
> signal ack : in std_logic;
> signal addr_o : out std_logic_vector(22 downto 0);
> signal data_o : inout std_logic_vector(31 downto 0);
> signal as, read, rw_done: out std_logic
> ) is
> begin
> case read_sbus is
> when s0 =>
> rw_done <= '0';
>
> data_o <= data_hiZ;
> addr_o <= addr_hiZ;
> as <= '1' after pd;
> read <= '1';
> read_sbus <= s1;
> ...
> when s5 =>
> rw_done <= '1';
> addr_o <= addr_hiZ;
> read_sbus <= s0;
> when others =>
> read_sbus <= s0;
> end case;
> end procedure;
>
> ----similarly for procedure writex
>
>
> begin --arch
>
> GSP: process(CLK)
> begin
> if RESET = '0' then
> ...
> elsif rising_edge(CLK) then
> if gsp_en = '1' then
> case rw_gsp is
> when s0 =>
> ...
> readx(iaddr, idata, ack, addr, data, as, read, rw_done);
> ...
> when s1 =>
> ...
> writex(iaddr, idata, ack, addr, data, as, read, rw_done);
> ...
> when others =>
> rw_gsp <= s0;
> end case;
> end if;
> end if;
> end process;
>
> TSP: process(CLK)
> begin
> if RESET = '0' then
> ...
> elsif rising_edge(CLK) then
> if tsp_en = '1' then
> case rw_tsp is
> when s0 =>
> ...
> readx(iaddr, idata, ack, addr, data, as, read, rw_done);
> ...
> when s1 =>
> ...
> writex(iaddr, idata, ack, addr, data, as, read, rw_done);
> ...
> when others =>
> rw_sp <= s0;
> end case;
> end if;
> end if;
> end process;
>
> --------------------------------------------------------------------------

------
>
>
> I got following error messages when compiling the codes:
>
>
> -- Compiling architecture behav of tsbus
> ** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(67): Cannot
> drive signal 'read_sbus' from this subprogram.
>
> ** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(111): Cannot
> drive signal 'write_sbus' from this subprogram.
> ** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(172): No
> feasible entries for subprogram 'readx'.
> ** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(242): No
> feasible entries for subprogram 'writex'.
> ** Error: H:/Documents/Digital IO/VHDL Files/tsbus.vhd(394): VHDL
> Compiler exiting
>
> I tried to put signal declation for read_sbus, write_sbus, etc. in
> packages but that still did not help!
>
> How can I do it correctly then? Many thanks in advance.
>
> Calvin



 
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
Weird issue, same code, same browser, two different apache servers,very different css bluebaron HTML 3 11-04-2009 07:13 PM
running same script on same data on two different machines -->different result Christopher Brewster Python 5 11-14-2008 08:19 PM
Two processes writing to the same XML file at the same time? darrel ASP .Net 2 04-05-2006 05:30 PM
write to the same file from multiple processes at the same time? gabor Python 19 05-31-2005 01:57 PM
same code produces different decimal symbol on different computers with same settings ASP General 2 12-29-2003 02:29 PM



Advertisments