Talk About Network

Google





Electronic Equipment > VHDL > Re: Defined ran...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 6063 of 6445
Post > Topic >>

Re: Defined ranges

by kennheinrich@[EMAIL PROTECTED] Jun 5, 2008 at 04:15 AM

On Jun 5, 12:30 am, rickman <gnu...@[EMAIL PROTECTED]
> wrote:
> I am using a subtype to define a range as used in a SLV declaration.
>
>   subtype  INST_RNG             is natural range 23 downto 0;
>   signal CTPCurCmd              : std_logic_vector (INST_RNG);
>
> But if I try to use the same subtype to define a sub-range in an
> assignment, I get this error message.
>
> # Error: COMP96_0263: IRIG_FPGA_TB.vhd : (504, 68): Type names are not
> allowed as primaries.
>
> Is this just a limitation of the tool I am using or is this a language
> issue?  Is there a better way to define ranges so the parts of an
> array can be dealt with symbolically?
>
> Rick

Without an example of what you mean by "define a sub-range in an
assignment", I'm working in the dark. However, on first blush, this
sounds like a tool error: using a type mark as a discrete range in a
slice name (which I what I'm guessing you want), is allowed. In
particular, the LRM grammar says

slice_name uses a discrete_range
discerete_range can be a discrete_subtype_indication
a subtype_indication can be a type_mark, which is a simple identifier
denoting a type or subtype.

The message implies that the compiler isn't looking for the discrete
range interpretation, it's only trying to parse as an expression,
which has "primary" as one of the underlying constituents.

The Modelsim 6.0a compiler accepts the following without error: (note
that I made up an assignment)

library IEEE;
use IEEE.std_logic_1164.all;

entity test is
end test;

architecture test of test is
  subtype INST_REG is natural range 0 to 23;
  signal CTPCurCmd : std_logic_vector(INST_REG);
  signal foo : std_logic_vector(INST_REG);
begin  -- test
  foo(INST_REG) <= CTPCurCmd(INST_REG);
end test;


Hope this helps,

 - Kenn
 




 3 Posts in Topic:
Defined ranges
rickman <gnuarm@[EMAIL  2008-06-04 21:30:06 
Re: Defined ranges
kennheinrich@[EMAIL PROTE  2008-06-05 04:15:49 
Re: Defined ranges
rickman <gnuarm@[EMAIL  2008-06-05 05:51:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Thu Jan 8 12:16:13 PST 2009.