Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - procedure inside package body and modelsim error

 
Thread Tools Search this Thread
Old 04-11-2007, 08:14 PM   #1
Default procedure inside package body and modelsim error


Hi,

I try to move out some stuff for use with testbenches. Anyway, I wote:

---8<---
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

package tb_pkg is
procedure tic(clk : in time);
end package tb_pkg;


package body tb_pkg is
procedure tic(clk: in time) is
begin
wait until rising_edge(clk); -- line73
end procedure;
end package body tb_pkg;
--->8--

modelsim got:
# ** Error: ../source/vhdl/tb_pkg.vhd(73): No feasible entries for
subprogram "rising_edge".
# ** Warning: [2] ../source/vhdl/tb_pkg.vhd(73): Wait statement has no
sensitivity list or time out clause.

Mmhh, this happens only by use with the package. How to get it working
and what is the reason for? It's inspired by
http://home.comcast.net/~mike_treseler/test_uart.vhd

Thanks
Olaf


Olaf Petzold
  Reply With Quote
Old 04-11-2007, 10:45 PM   #2
Jonathan Bromley
 
Posts: n/a
Default Re: procedure inside package body and modelsim error
On Wed, 11 Apr 2007 21:14:58 +0200, Olaf Petzold <> wrote:

>Hi,
>
>I try to move out some stuff for use with testbenches. Anyway, I wote:
>
>---8<---
>library ieee;
>use ieee.std_logic_1164.all;
>use ieee.numeric_std.all;
>
>package tb_pkg is
> procedure tic(clk : in time);
>end package tb_pkg;


I suspect your "clk" should be of type "std_logic", not "time".

>package body tb_pkg is
> procedure tic(clk: in time) is
> begin
> wait until rising_edge(clk); -- line73
> end procedure;
>end package body tb_pkg;


Now I'm sure! TWO things wrong here:

(1) there's no rising_edge function for "time", unless you
wrote it yourself. Let's assume that you meant "std_logic".

(2) rising_edge needs a *signal* to work on, because
it needs to test the signal's 'event attribute. You are
giving it a *constant*, the procedure's input parameter.

Let's try again... with a tick-count parameter for
added versatility...

package tb_pkg is
procedure tic(signal clk: in std_logic; N: in positive := 1);
end package;
package body tb_pkg is
procedure tic(signal clk: in std_logic; N: in positive := 1) is
begin
for i in 1 to N loop wait until rising_edge(clk); end loop;
end;
end package;

Should be OK now

Presumably it worked when you had the procedure in a process,
because you didn't pass "clk" as a parameter, but used it directly?
--
Jonathan Bromley, Consultant

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

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK

http://www.MYCOMPANY.com

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


Jonathan Bromley
  Reply With Quote
Old 04-11-2007, 10:50 PM   #3
Mike Treseler
 
Posts: n/a
Default Re: procedure inside package body and modelsim error
Olaf Petzold wrote:

> I try to move out some stuff for use with testbenches.
>


Add the clock to your sim package like this:

> library ieee;
> use ieee.std_logic_1164.all;
> use ieee.numeric_std.all;
>
> package tb_pkg is

signal clk_s : std_ulogic := '0'; --
procedure tic; --
> end package tb_pkg;
>
>
> package body tb_pkg is
> procedure tic is
> begin

wait until rising_edge(clk_s); --
> end procedure;
> end package body tb_pkg;


Also see the "Remote Testbench Procedure"

-- Mike Treseler


Mike Treseler
  Reply With Quote
Old 04-11-2007, 11:25 PM   #4
Andy Peters
 
Posts: n/a
Default Re: procedure inside package body and modelsim error
On Apr 11, 12:14 pm, Olaf Petzold <o...@mdcc.de> wrote:
> Hi,
>
> I try to move out some stuff for use with testbenches. Anyway, I wote:
>
> ---8<---
> library ieee;
> use ieee.std_logic_1164.all;
> use ieee.numeric_std.all;
>
> package tb_pkg is
> procedure tic(clk : in time);
> end package tb_pkg;
>
> package body tb_pkg is
> procedure tic(clk: in time) is
> begin
> wait until rising_edge(clk); -- line73
> end procedure;
> end package body tb_pkg;
> --->8--
>
> modelsim got:
> # ** Error: ../source/vhdl/tb_pkg.vhd(73): No feasible entries for
> subprogram "rising_edge".
> # ** Warning: [2] ../source/vhdl/tb_pkg.vhd(73): Wait statement has no
> sensitivity list or time out clause.
>
> Mmhh, this happens only by use with the package. How to get it working
> and what is the reason for? It's inspired byhttp://home.comcast.net/~mike_treseler/test_uart.vhd


You need to put another set of library/use clauses before the package
body declaration.

-a



Andy Peters
  Reply With Quote
Old 04-11-2007, 11:31 PM   #5
kennheinrich@sympatico.ca
 
Posts: n/a
Default Re: procedure inside package body and modelsim error


On Apr 11, 3:14 pm, Olaf Petzold <o...@mdcc.de> wrote:
> Hi,
>
> I try to move out some stuff for use with testbenches. Anyway, I wote:
>
> ---8<---
> library ieee;
> use ieee.std_logic_1164.all;
> use ieee.numeric_std.all;
>
> package tb_pkg is
> procedure tic(clk : in time);
> end package tb_pkg;
>
> package body tb_pkg is
> procedure tic(clk: in time) is
> begin
> wait until rising_edge(clk); -- line73
> end procedure;
> end package body tb_pkg;
> --->8--
>
> modelsim got:
> # ** Error: ../source/vhdl/tb_pkg.vhd(73): No feasible entries for
> subprogram "rising_edge".
> # ** Warning: [2] ../source/vhdl/tb_pkg.vhd(73): Wait statement has no
> sensitivity list or time out clause.
>
> Mmhh, this happens only by use with the package. How to get it working
> and what is the reason for? It's inspired byhttp://home.comcast.net/~mike_treseler/test_uart.vhd
>
> Thanks
> Olaf


Olaf,

One problem is that 'time' doesn't have rising edges (as meant by the
rising_edge function: a change which brings the signal to a value of
'1'). Time is just an integer range. Logic signals have rising
edges. I suspect that you either want to define clk as std_logic, or
(for simulation) change your procedure to wait until time >
some_next_value_of_time.

- Kenn



kennheinrich@sympatico.ca
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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