LoginSignup
0
0

More than 3 years have passed since last update.

windowsでiverilog その57

Last updated at Posted at 2020-07-26

概要

windowsでiverilogやってみた。
inoutの作法、調べてみた。

inoutの作法

双方向入出力やりたいので、inout を使います。

inout は、wire扱い。
regを設定できない。
inout から読むときは、そのまま読める。
inoutに書くときは、regに書いて、assign する。
assignは、書込時にreg、読込時に、zにしておく。

サンプルコード

module tmc(input clk, input rst, input rw, inout dio);
    reg out;
    assign dio = (rw) ? out : 1'bz;
endmodule

以上。

0
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
0
0