unconstrained args for procedures

O

Olaf Petzold

Hi,

this time a question to unconstrained args for procedures. Is there a
way to write it something like:

package oo is
procedure foo (
signal a, b : in std_logic_vector(natural range <>);
....

package body oo is

procedure foo(
signal a, b : std_logic_vector(natural range <>);
...) is
constant WIDTH : natural := a'range;
...
begin
...

I got syntax errors. Imo there is no reasing why isn't possible.

Thank you
Olaf
 
O

Olaf Petzold

Olaf said:
Hi,

this time a question to unconstrained args for procedures. Is there a
way to write it something like:

package oo is
procedure foo (
signal a, b : in std_logic_vector(natural range <>);
....

package body oo is

procedure foo(
signal a, b : std_logic_vector(natural range <>);
...) is
constant WIDTH : natural := a'range;
...
begin
...

I got syntax errors. Imo there is no reasing why isn't possible.

Wow, it's easy - even leave the range specs empty. Unfortunally vsim
crashs on accessing a's range:

generating 'RANGE in gen_attr()
** Fatal: Unexpected signal: 11.

Regards,
Olaf
 
A

Andy Peters

Olaf said:
Hi,

this time a question to unconstrained args for procedures. Is there a
way to write it something like:

package oo is
procedure foo (
signal a, b : in std_logic_vector(natural range <>);
....

Drop the (natural range <>) part.

Simply declare it as std_logic_vector.

-a
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top