LoginSignup
1
0

More than 5 years have passed since last update.

SystemVerilogにてmoduleにinteger型の値を渡す

Last updated at Posted at 2017-10-27

はじめに

 SystemVerilogではinteger型を扱えます。しかし、moduleの入力ポート名の部分はネットタイプでなければならないのでinteger型をそのまま用いることはできません。ここではSystemVerilogの入力ポートにinteger型を用い、moduleにinteger型の値を渡す方法について調査した結果を書きます。

方法

 integer型はSystemVerilogではreg signed [31:0]として扱われるので、integer型としたい入力ポートの型をreg signed [31:0]とするだけです。必要に応じてsignedをつけて符号付きとしたり、reg signed [15:0]とするなどしてビット数を減らすこともできます。

参考文献

http://www.edaboard.com/thread141629.html
https://stackoverflow.com/questions/36667351/integer-input-ports-in-verilog-simillar-to-vhdl

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0