在 verilog 中包含一个模块 [英] Include a module in verilog

查看:35
本文介绍了在 verilog 中包含一个模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个 verilog 模块包含到另一个文件中.如何将其包含在代码中以及如何编译代码以包含头文件?和c一样吗?

I want to include a verilog module into another file. How do I include it in the code and how do I compile the code to include the header file? Is it like in c?

推荐答案

  1. 一个基本示例可以将它们包含在同一个文件中,如页面所示一天 4 个 verilog.

应该会自动找到同一文件夹中的所有文件.

All files in the same folder should be automatically found.

包括它们如 Hello_World_Program_Output 所示 或下面的示例.

Include them as shown in Hello_World_Program_Output or Example below.

高级工作流可以让 files.f 列出指定包含目录的 verilog 或配置文件.

Advanced workflows can have files.f listing the verilog or config files specifying include directories.

包括 (3) 的示例:

Include example for (3):

`include "folder/sub.sv"
module top;
  sub sub_i(
    .a(),
    .b()
    ...

文件扩展名.v 用于verilog 编译,您的编译器应使用Verilog 2005 之前的最新标准..sv 扩展名用于SystemVerilog.它在 2009 年取代了 Verilog.文件扩展名导致编译器切换到 SystemVerilog.

The file extension .v is used for verilog compilation, your compiler should use the latest standard up to Verilog 2005. The .sv extension is for SystemVerilog. Which replaced Verilog in 2009. The file extension causes the compiler to switch to SystemVerilog.

这篇关于在 verilog 中包含一个模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆