• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Conversion of an Integer port in VHDL to equivalent in ...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 65
  • Views 15514
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Conversion of an Integer port in VHDL to equivalent in Verilog

Sarvesh
Sarvesh over 16 years ago

Hello,

I am using NC-VHDL and trying to port map a verilog file in the VHDL enviroment. I am not able to convert an integer port which is present in the original file. Is there any workaround for this in Verilog ? I have tried using [15:0] array also a [31:0] array but there is a compilation error as NCVHDL says it cannot find any equivalent matching datatype. Please help.

Regards,

  • Cancel
  • Mickey
    Mickey over 16 years ago

     Hi Sarvesh,

    Just to be clear, you have a verilog module with an integer port and you are instantiating that verilog module in vhdl.  If that's the case, take a look at the example below and let me know if that helps.

    verilog

    -----------

    module using_integer_port (clk, in1, out1);
    input clk;
    input  in1;
    output out1;

    wire [31:0] in1;
    integer out1;

    always @(posedge clk)
      out1 = in1;
    endmodule
    -------------------------

    vhdl 

    ------------------------

    library ieee;
    use ieee.std_logic_1164.all;
    entity test is
    end test;


    architecture vhdl of test is

    component using_integer_port
           port (clk: in std_logic;
                 in1: in std_logic_vector;
                  out1: out std_logic_vector);
    end component;
    signal clk: std_logic := '0';
    signal d: std_logic_vector (31 downto 0);
    signal q: std_logic_vector (31 downto 0);

    begin
        clk <= not clk after 20 ns;

        process begin
            wait for 3 ns;    
                 d <= X"01000111";
            wait for 5 ns;
                 d <= X"11000111";
            wait for 13 ns;
                 d <= X"00011001";
        end process;
        inst:using_integer_port port map (clk, d, q);
    end vhdl;

    --------------

    Hope that helps.

    Best regards,

    Mickey

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • cubicle82
    cubicle82 over 16 years ago

    Mickey said:
    module using_integer_port (clk, in1, out1);

    input clk;
    input  in1;
    output out1;

    wire [31:0] in1;
    integer out1;

    always @(posedge clk)
      out1 = in1; // coding style-error, flipflop should be '<='

    endmodule

     

    As written, your Verilog-module has single bit-wide ports. I don't think Verilog-2001 allows module-ports to be specified as type integer.  (Parameters, function-args, and task-args can be formally specified integer.)

     

    My VHDL is a bit rusty, but I'm guessing it's shorthand for a 32-bit signed integer?  If that's the case, you could try something like this:

    `define fake_integer signed [31:0]

     

    module v2001_using_integer_port (

      input wire clk,

      input wire `fake_integer in1,

      output reg `fake_integer out1

      );


    always @(posedge clk)
      out1 <= in1;
    endmodule

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information