Error:Case expression must be of a locally static subtype.

M

Mohammed A khader

Hi All,

When simulating the following piece of code I came across this
Error: COMP96_0316: Sincos_Rom.vhd : (37, 22): Case expression must be
of a locally static subtype.

In case statement I am concatenating 3 std_logic types to a vector of
signed type of length 3.It is clear from the defination that vector is
static (that is vector length is locally fixed as 3 ).
In order to force the singed vector to 3 I changed it to follwoing
expression
case signed(2 downto 0)'( Sincos_Sel & negate & image) is ...

but still some other syntax error was displayed.
Error: COMP96_0015: Sincos_Rom.vhd : (37, 31): ')' expected.

Please help me in understanding it...

Code is here ......


Operation_Sel:case signed'( Sincos_Sel & negate & image) is

when "000" =>
shift := '0';
complement := '0';

when "001" =>
shift := '1';
complement := '0';

when "010" =>
shift := '0';
complement := '1';

when "011" =>
shift := '1';
complement := '1';

when "100" =>
shift := '1';
complement := '0';

when others =>
shift := 'X';
complement := 'X';
end case Operation_Sel;

Thanks,

Mohammed Khader.
 
J

Jonathan Bromley

Hi All,

When simulating the following piece of code I came across this
Error: COMP96_0316: Sincos_Rom.vhd : (37, 22): Case expression must be
of a locally static subtype.

In case statement I am concatenating 3 std_logic types to a vector of
signed type of length 3.It is clear from the defination that vector is
static (that is vector length is locally fixed as 3 ).

Yes, but its subtype is not static. Irritating but true.
Some simulators have a compiler switch that allows this
illegal VHDL to be tolerated, and I think the VHDL-200x "fast track"
working group has proposed it as a future relaxation of the rules.
But for the time being you need to fix it yourself.
In order to force the singed vector to 3 I changed it to follwoing
expression
case signed(2 downto 0)'( Sincos_Sel & negate & image) is ...

but still some other syntax error was displayed.

You're on the right track, but the type-qualification
syntax T'(expr) requires a subtype name. So you need
to do something like....

process (....)
subtype SGN3 is signed(2 downto 0);
begin
...
case SGN3'(Sincos_Sel & negate & image) is ...

Even better, choose a nice meaningful name for your subtype!
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:[email protected]
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

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

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top