Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelSim/QuestaSim issues warning regarding ext_string_pkg #996

Closed
Tracked by #997
nselvara opened this issue Mar 8, 2024 · 0 comments
Closed
Tracked by #997

ModelSim/QuestaSim issues warning regarding ext_string_pkg #996

nselvara opened this issue Mar 8, 2024 · 0 comments
Milestone

Comments

@nselvara
Copy link

nselvara commented Mar 8, 2024

Hi guys, once again when I run VUnit test ModelSim/QuestaSim (I'm using both) spit out warnings regarding the ext_string_pkg file.
The warnings are:

  • \vunit\vhdl\data_types\src\api\external_integer_vector_pkg.vhd(40): Function 'read_integer' may complete without a RETURN at line 39.
  • \vunit\vhdl\data_types\src\api\external_integer_vector_pkg.vhd(46): Function 'get_ptr' may complete without a RETURN at line 45.

The flagged lines of code are:

  impure function read_char (
    id : integer;
    i  : integer
  ) return character is begin
    assert false report "EXTERNAL read_char" severity failure;
    --! Return statement missing!
  end;

  impure function get_ptr (
    id : integer
  ) return extstring_access_t is begin
    assert false report "EXTERNAL get_string_ptr" severity failure;
    --! Return statement missing!
  end;

I think just adding a return statement with a dummy value, would do the trick or converting those to procedure may also do the trick:

  impure function read_char (
    id : integer;
    i  : integer
  ) return character is begin
    assert false report "EXTERNAL read_char" severity failure;
    return "";
  end;

  impure function get_ptr (
    id : integer
  ) return extstring_access_t is 
      variable dummy_ptr: extstring_access_t;
    begin
    assert false report "EXTERNAL get_string_ptr" severity failure;
    dummy_ptr := new extstring_access_t
    dummy_ptr.all; -- Don't know if the syntax is correct
  end;

Or

  procedure read_char (
    id : integer;
    i  : integer
  ) is begin
    assert false report "EXTERNAL read_char" severity failure;
  end;

  procedure get_ptr (
    id : integer
  )  is begin
    assert false report "EXTERNAL get_string_ptr" severity failure;
  end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants