Am I breaking a rule?

Discussion in 'VHDL' started by Tricky, Mar 5, 2010.

  1. Tricky

    Tricky Guest

    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?
     
    Tricky, Mar 5, 2010
    #1
    1. Advertising

  2. On Fri, 5 Mar 2010 10:16:13 -0800 (PST), Tricky <>
    wrote:

    >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...
    --
    Jonathan Bromley
     
    Jonathan Bromley, Mar 5, 2010
    #2
    1. Advertising

  3. Tricky

    Tricky Guest

    On Mar 5, 6:32 pm, Jonathan Bromley <>
    wrote:
    > On Fri, 5 Mar 2010 10:16:13 -0800 (PST), Tricky <>
    > wrote:
    >
    > >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...
    > --
    > Jonathan Bromley


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

    Ill raise the issue with mentor
     
    Tricky, Mar 5, 2010
    #3
  4. Tricky <> writes:

    > 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

    --
     
    Kenn Heinrich, Mar 6, 2010
    #4
  5. Tricky

    Tricky Guest

    On Mar 6, 3:24 am, Kenn Heinrich <> wrote:
    > Tricky <> writes:
    > > 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
    >
    > --


    I was using 6.4b. Ill upgrade to 6.5. Thanks Kenn
     
    Tricky, Mar 6, 2010
    #5
  6. Tricky

    Tricky Guest

    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.
     
    Tricky, Mar 8, 2010
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jurjen de Groot

    Re: Business rule implementation

    Jurjen de Groot, Aug 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    354
    Jurjen de Groot
    Aug 6, 2003
  2. Daniel
    Replies:
    1
    Views:
    1,744
    Steven Cheng[MSFT]
    Jul 10, 2004
  3. Miguel Dias Moura

    How to display records according to this rule?

    Miguel Dias Moura, Dec 7, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    359
    Martin Dechev
    Dec 9, 2004
  4. Amy
    Replies:
    0
    Views:
    513
  5. Replies:
    0
    Views:
    1,370
Loading...

Share This Page