【问题标题】:What is "concurrent assignment to a non-net <port_name> is not permitted" Verilog simulation error?什么是“不允许同时分配给非网络 <port_name>”的 Verilog 模拟错误?
【发布时间】:2020-10-20 19:06:36
【问题描述】:

这是我的 cpu 设计代码,其中包含一系列端口。只有 clk 是输入:

module cpu_1(clk, inst_out, m1_out, QA, QB, IMME, WREG, M2REG, WMEM, ALUIMM, REGR1, m1_select, ALUC);
  input clk;
  output wire [31:0]inst_out;
  wire [31:0]ifid_out;
  output wire [3:0]ALUC;
  output wire [4:0]m1_out;
  output wire [31:0]QA;
  output wire [31:0]QB;
  output wire [31:0]IMME;
  output wire WREG, M2REG, WMEM, ALUIMM, REGR1, m1_select;
  wire [5:0]OP;
  wire [4:0]RS;
  wire [4:0]RT;
  wire [4:0]RD;
  wire [4:0]SA;
  wire [5:0]FUNC;
  wire [15:0]IMM;
  assign OP=ifid_out[31:26];
  assign RS=ifid_out[25:21];
  assign RT=ifid_out[20:16];
  assign RD=ifid_out[15:11];
  assign SA=ifid_out[10:6];
  assign FUNC=ifid_out[5:0];
  assign IMM=ifid_out[15:0];
  
  multiplexer_add4 ma4(pc_out, pc_in);
  program_counter pc(pc_in, pc_out);
  instruction_file INST_FILE(pc_out, inst_out);
  if_id IF_ID(inst_out, ifid_out, clk);
  control_unit CTRL(OP, FUNC, WREG, M2REG, WMEM, ALUC, ALUIMM, REGR1);
  multiplexer_1 m1(m1_select, RD, RT, m1_out);
  register_file rf(RS, RT, QA, QB);
  multiplexer_extension me(IMM, IMME);
  id_exe ID_EXE(WREG, M2REG, WMEM, ALUC, ALUIMM, m1_out, QA, QB, IMME, clk);
endmodule

这是我的 cpu 测试平台代码的一部分。我要实例化cpu模块:

module cpu_1_tb;
reg clk;
reg [31:0]inst_out;
reg [4:0]m1_out;
reg [31:0]QA;
reg [31:0]QB;
reg [3:0]ALUC;    
reg [31:0]IMME;
reg WREG, M2REG, WMEM, ALUIMM, REGR1, m1_select;

cpu_1 cpu_1_instance
(
.clk(clk),
.inst_out(inst_out),
.m1_out(m1_out),
.QA(QA),
.QB(QB),
.ALUC(ALUC),
.IMME(IMME),
.WREG(WREG),
.M2REG(M2REG),
.WMEM(WMEM),
.ALUIMM(ALUIMM),
.REGR1(REGR1),
.m1_select(m1_select)
);

但是我遇到了这个错误。错误的原因是什么,我能做些什么来解决它?

【问题讨论】:

    标签: debugging verilog


    【解决方案1】:

    您不应将模块输出信号连接到测试台中的reg。您的工具将reg 视为“非网络”。 在您的测试台中,更改:

    reg [31:0]inst_out;
    

    到:

    wire [31:0]inst_out;
    

    您应该对任何其他输出执行相同的操作。

    【讨论】:

      猜你喜欢
      • 2021-12-31
      • 1970-01-01
      • 1970-01-01
      • 2016-08-07
      • 2022-08-08
      • 2011-12-20
      • 1970-01-01
      • 2022-06-14
      • 2013-02-17
      相关资源
      最近更新 更多