• 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 15516
  • 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
Parents
  • 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
Reply
  • 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
Children
No Data

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