Am I breaking a rule?

T

Tricky

I have this setup in a file:

type pt is protected
end protected pt;

type pt is protected body
file ft : text;
end protected body pt;


When I compile it in modelsim I get the error: Unknown method "ft"
pointing at the end of the the protected type declaration.

Am I breaking a VHDL rule (ie. files cant be put inside protected
types) is it a modelsim bug?
 
J

Jonathan Bromley

I have this setup in a file:

type pt is protected
end protected pt;

type pt is protected body
file ft : text;
end protected body pt;


When I compile it in modelsim I get the error: Unknown method "ft"
pointing at the end of the the protected type declaration.

Am I breaking a VHDL rule (ie. files cant be put inside protected
types) is it a modelsim bug?

Just guessing here, but... did you remember to
use std.textio.all;
to get the definition of "text"?

If that's the problem, then the error message is,
how shall we say, less than helpful...
 
T

Tricky

Just guessing here, but... did you remember to
  use std.textio.all;
to get the definition of "text"?

If that's the problem, then the error message is,
how shall we say, less than helpful...

Yes I have included std.textio. Had the problem in 2 different files

Ill raise the issue with mentor
 
K

Kenn Heinrich

Tricky said:
I have this setup in a file:

type pt is protected
end protected pt;

type pt is protected body
file ft : text;
end protected body pt;


When I compile it in modelsim I get the error: Unknown method "ft"
pointing at the end of the the protected type declaration.
When I use the following source code:
-- --------------------
use std.textio.all;
entity e is

end e;

architecture a of e is
type pt is protected
end protected pt;

type pt is protected body
file ft : text;
end protected body pt;
begin -- a
end a;
-- --------------------

I get a fatal internal error from

Model Technology ModelSim XE III vcom 6.4b Compiler 2008.11 Nov 15 2008
-- Loading package standard
-- Loading package textio
-- Compiling entity e
-- Compiling architecture a of e
** Fatal: Unexpected signal: 11.
** Error: rule.vhd(12): VHDL Compiler exiting

But I get no issues from a newer full blown version:

Model Technology ModelSim SE-64 vcom 6.5b Compiler 2009.05 May 21 2009
-- Loading package standard
-- Loading package textio
-- Compiling entity e
-- Compiling architecture a of e

Am I breaking a VHDL rule (ie. files cant be put inside protected
types) is it a modelsim bug?

You're allowed to declare files in a body. Looks like the latter.

- Kenn

--
 
T

Tricky

When I use the following source code:
-- --------------------
use std.textio.all;
entity e is

end e;

architecture a of e is
  type pt is protected
   end protected pt;

  type pt is protected body
    file ft  : text;
  end protected body pt;
begin  -- a
end a;
-- --------------------

I get a fatal internal error from

Model Technology ModelSim XE III vcom 6.4b Compiler 2008.11 Nov 15 2008
-- Loading package standard
-- Loading package textio
-- Compiling entity e
-- Compiling architecture a of e
** Fatal: Unexpected signal: 11.
** Error: rule.vhd(12): VHDL Compiler exiting

But I get no issues from a newer full blown version:

Model Technology ModelSim SE-64 vcom 6.5b Compiler 2009.05 May 21 2009
-- Loading package standard
-- Loading package textio
-- Compiling entity e
-- Compiling architecture a of e


You're allowed to declare files in a body. Looks like the latter.

 - Kenn

--

I was using 6.4b. Ill upgrade to 6.5. Thanks Kenn
 
T

Tricky

Turns out it is almost a double bug. While at first it was a problem
with modelsim not accepting files in protected types, in 6.5+ the
following causes an error, confirmed by mentor:

1 library ieee;
2 use ieee.std_logic_1164.all;
3
4 library std;
5 use std.textio.all;
6
7 package p is
8
9 type data_file_t is file of character;
10
11 type stimulus_generation_t is protected
12 end protected stimulus_generation_t;
13
14 end package p;
15
16 package body p is
17
18 type stimulus_generation_t is protected body
19 file f_txt : text;
20 end protected body stimulus_generation_t;
21
22 end package body;

Because I have declared a file type previously, it conflicts now with
the f_txt in the protected type. The solution is to put the file type
declaration and the protected type into separate packages.
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top