modelsim仿真报错:vlog-2388 ‘scl‘ already declared in this scope

问题背景:

1、使用vivado直接仿真的时候没有报错。

2、在vivado中调用modelsim的时候报错。

报错的代码:

复制代码
module iic_write(
   input clk,
   input rst,
   output  scl,
   input en,
   inout sda
    );
    reg scl;
    ......

报错的意思是scl已经声明过了,modelsim认为端口声明" output scl,"和变量类型声明"reg scl"重复了。

修改成这样,就不会报错了。

module iic_write(

input clk,

input rst,

output reg scl,

input en,

inout sda

);

// reg scl;

在声明端口的时候,把变量类型一起声明了。

相关推荐
浩子智控2 天前
电子设备DevOps
fpga开发
cycf3 天前
CRC校验
fpga开发
landyjzlai3 天前
AMBA总线(15)关于AXI-stream(sg模式)
arm开发·fpga开发·amba
白狐_7983 天前
Quartus Prime 新手完全使用指南
fpga开发
Aaron15883 天前
三种主流接收机架构(超外差、零中频、射频直采)对比及发展趋势浅析
c语言·人工智能·算法·fpga开发·架构·硬件架构·信号处理
博览鸿蒙3 天前
一颗数字系统是如何在 FPGA 上“跑起来”的?
fpga开发
雨洛lhw3 天前
FPGA JTAG接口设计全解析
fpga开发·jtag
minglie14 天前
iverilog 配合 Makefile 搭建 Verilog 仿真工程
fpga开发
芒果树技术4 天前
MangoTree案例分享:基于AtomRIO FPGA平台,客户实现自适应主动减振
测试工具·fpga开发·模块测试
雨洛lhw4 天前
按键电路设计的细节
fpga开发