Input 在verilog中使用两条总线线作为输入,另外两条作为输出时出错

Input 在verilog中使用两条总线线作为输入,另外两条作为输出时出错,input,io,output,verilog,bus,Input,Io,Output,Verilog,Bus,我试图定义我的JD和JC阵列,其中两条线用作输入,两条线用作输出。然而,如代码所示,我得到一个错误,说声明是非法的 错误显示: 错误:HDLCompiler:27-“top.v”第38行非法重新声明“JC” 错误:HDLCompiler:27-“top.v”行41非法重新声明'JD' 解决这个问题的最好办法是什么 代码示例 module top ( input wire mclk, //50 MHz by default input wire rcclk,

我试图定义我的JD和JC阵列,其中两条线用作输入,两条线用作输出。然而,如代码所示,我得到一个错误,说声明是非法的

错误显示:

错误:HDLCompiler:27-“top.v”第38行非法重新声明“JC” 错误:HDLCompiler:27-“top.v”行41非法重新声明'JD'

解决这个问题的最好办法是什么

代码示例

module top
(
    input wire mclk,             //50 MHz by default
    input wire rcclk,            //
    output  wire [7:0] seg,
    output wire dp,
    output wire [3:0] an,
    output wire [7:0] Led,
    input wire [7:0] sw,
    input wire [3:0] btn,

    //I/O pins
    input wire [3:0] JA,
    input wire [3:0] JB,
    //input wire [3:0] JC,

    input wire [3:2] JC,   //<< this is where I get the error
    output wire [1:0] JC,  //<< this is where I get the error

    input wire [3:2] JD,   //<< this is where I get the error
    output wire [1:0] JD   //<< this is where I get the error

);
模块顶部
(
输入线mclk,默认情况下为50 MHz
输入线rcclk//
输出线[7:0]分段,
输出线dp,
输出线[3:0]安,
输出线[7:0]发光二极管,
输入线[7:0]开关,
输入线[3:0]btn,
//I/O引脚
输入线[3:0]JA,
输入线[3:0]JB,
//输入线[3:0]JC,

输入线[3:2]JC,//您始终可以将
JC
JD
定义为双向管脚(
inout
):

inout [1:0] JC,
inout [1:0] JD