Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Re: Quartus warning in NUMERIC_STD.vhd

Reply
Thread Tools

Re: Quartus warning in NUMERIC_STD.vhd

 
 
Mike Treseler
Guest
Posts: n/a
 
      07-11-2003
Alan Fitch wrote:

>
> I personally don't think it should be a warning, as it's quite legal
> to declare null vectors


I agree.

A bad assignment to a null vector will cause other errors.
A null vector declaration alone is innocuous.

If one bit is 0 to 0 then
no bits must be 0 to -1

Let's see:
-------------------

entity null_string is
end null_string;

architecture sim of null_string
is
constant null_vec : std_logic_vector := "";
constant one_vec : std_logic_vector := "0";
constant two_vec : std_logic_vector := "00";

begin

what : process is
begin
report "null_vec is "& integer'image(null_vec'left)
& " to "& integer'image(null_vec'right);
report " one_vec is "& integer'image( one_vec'left)
& " to "& integer'image( one_vec'right);
report " two_vec is "& integer'image( two_vec'left)
& " to "& integer'image( two_vec'right);
wait;
end process what;

end sim;

--VSIM 1> run
--# ** Note: null_vec is 0 to -1
--# ** Note: one_vec is 0 to 0
--# ** Note: two_vec is 0 to 1

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

I suppose that null vectors are rare as signals
but null vector constants and variables are necessary to make
clean vector functions.


--Mike Treseler

 
Reply With Quote
 
 
 
 
Clyde R. Shappee
Guest
Posts: n/a
 
      07-12-2003
Hi, Mike,

Could please enlighten me on your usage

integer'image(null_vec'left)

What's it doing? Is image the function that Ben Cohen provides on his CD
with his books?

What is integer' doing? type casting?

Have I been asleep, or why don't I know about this from all of my reading.

Please advise, and thank you.

Clyde

Mike Treseler wrote:

> Alan Fitch wrote:
>
> >
> > I personally don't think it should be a warning, as it's quite legal
> > to declare null vectors

>
> I agree.
>
> A bad assignment to a null vector will cause other errors.
> A null vector declaration alone is innocuous.
>
> If one bit is 0 to 0 then
> no bits must be 0 to -1
>
> Let's see:
> -------------------
>
> entity null_string is
> end null_string;
>
> architecture sim of null_string
> is
> constant null_vec : std_logic_vector := "";
> constant one_vec : std_logic_vector := "0";
> constant two_vec : std_logic_vector := "00";
>
> begin
>
> what : process is
> begin
> report "null_vec is "& integer'image(null_vec'left)
> & " to "& integer'image(null_vec'right);
> report " one_vec is "& integer'image( one_vec'left)
> & " to "& integer'image( one_vec'right);
> report " two_vec is "& integer'image( two_vec'left)
> & " to "& integer'image( two_vec'right);
> wait;
> end process what;
>
> end sim;
>
> --VSIM 1> run
> --# ** Note: null_vec is 0 to -1
> --# ** Note: one_vec is 0 to 0
> --# ** Note: two_vec is 0 to 1
>
> ------------------------
>
> I suppose that null vectors are rare as signals
> but null vector constants and variables are necessary to make
> clean vector functions.
>
> --Mike Treseler


 
Reply With Quote
 
 
 
 
Clyde R. Shappee
Guest
Posts: n/a
 
      07-13-2003
Thanks...

I guess there are features in VHDL 93 that I have not been aware of. I'll have
to read up and give them a try.

CRS

Mike Treseler wrote:

> Clyde R. Shappee wrote:
> > Hi, Mike,
> >
> > Could please enlighten me on your usage
> >
> > integer'image(null_vec'left)

>
> It an integer, the left index of the vector.
>
> > What's it doing? Is image the function that Ben Cohen provides on his CD
> > with his books?

>
> No. Standard VHDL. Supported by all the sim and synth tools I have tried.
>
> > What is integer' doing? type casting?

>
> No. It's a built in VHDL "attribute" , a kind of function.
>
> > Have I been asleep, or why don't I know about this from all of my reading.

>
> A lot of the cool parts of VHDL-93 were neglected, because
> they didn't work with every version of every tool.
> They now work with most versions of most tools, so
> feel free to use them.
>
> -- Mike Treseler


 
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
Quartus II Warning: Found pins functioning as undefined clocks Markus Jochim VHDL 1 06-01-2007 02:27 AM
Strange error in Quartus II 3.0 Panic VHDL 2 10-24-2003 01:42 AM
I'm looking for Altera Quartus II 3.0 License file dong seok huh VHDL 1 09-18-2003 01:24 PM
Quartus VHDL problem with aggregate and type cast rickman VHDL 3 07-15-2003 04:24 AM
Re: Quartus bug or wrong VHDL? Paul Leventis VHDL 0 06-24-2003 02:10 AM



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