Re: problems with vectors?


Subject: Re: problems with vectors?
From: Dale E Martin (dmartin@cliftonlabs.com)
Date: Thu Mar 15 2001 - 09:56:40 MST


> The following code does not compile. seems that scram has difficulties
> with vectors, or problems with for?

No, your code has 2 syntax errors that scram is correctly reporting to you.
The syntax error messages are what come out of PCCTs, and they're not
always totally clear, but generally at least flagged on the right line.
One of the developers has been working on this aspect of error reporting,
btw, and there will be some improvements coming soon.

> attached is the stdlogic.vhd file
>
> vvvvvvvvvvvvv
> library ieee ;
> use ieee.std_logic_1164.all ;
>
> package lib_basepkg is
> end lib_basepkg ;
>
> package body lib_basepkg is
> function Replicate(constant Cnt:Positive;Arg:std_ulogic) return std_ulogic_vector is
> variable Replicated : std_ulogic_vector((Cnt)+(0)-1 downto (0)) ;
> begin
> for iBit in Cnt-1 downto 0 loop
> Replicated[iBit] := Arg ;

You mean:
      Replicated(iBit) := Arg ;

I assume.

> end loop;
> return Replicated ;
> end Replicate ;
> function BusAndFunc(Arg:std_ulogic_vector) return std_ulogic is
> variable Combined : std_ulogic ;
> begin
> Combined:='1' ;
> for iBit in Arg'range loop
> Combined := Combined and Arg[iBit] ;

Likewise:
      Combined := Combined and Arg(iBit) ;

> end loop ;
> return Combined ;
> end BusAndFunc ;
> end lib_basepkg ;

With those changes, this code analyzes fine with my working copy.

Thanks,
        Dale

-- 
Dale E. Martin, Clifton Labs, Inc.
Senior Computer Engineer
dmartin@cliftonlabs.com
http://www.cliftonlabs.com
pgp key available



This archive was generated by hypermail 2b25 : Mon Mar 18 2002 - 13:00:01 MST