“并发分配或输出端口连接的目标应为网络类型”

问题描述 投票:0回答:1

尝试合成要在Anvyl板上运行的代码时,我遇到以下错误:

ERROR:HDLCompiler:329-“ C:/ Users / Chase / Desktop / Code Templates / final_bcd_counter.v”第25行:并发分配或输出端口连接的目标应为网络类型。

ERROR:HDLCompiler:329-“ C:/ Users / Chase / Desktop / Code Templates / final_bcd_counter.v”第26行:并发分配或输出端口连接的目标应为网络类型。

我提供了一个Lab_board.v文件来驱动开发板,如下所示:

`timescale 1ns / 1ps

module lab_board(LED, SW, CLK);

output  [7:0] LED;
input  [7:0] SW;
input CLK;

bcd_count_7 counter( 
.max_count(SW[6:0]), 
.CLK(CLK), 
.run(SW[7]), 
.digit_l(LED[3:0]),
.digit_2(LED[7:4])
); 


endmodule

引发错误的代码是我的final_bcd_counter.v文件,该文件是将所有需要的值传递到电路板的程序的主要驱动程序。如下:

// This is the top module for the programmable BCD counter.
// It implements a programmable 7-bit counter and a binary-
// to-bcd converter that can output two digits.


module bcd_count_7(max_count, CLK, run, digit_1, digit_2);

  input [6:0] max_count;
  input CLK, run;
  output reg [3:0] digit_1;
  output reg [3:0] digit_2;

  //Wires and registers for interconnect if needed
  wire [6:0] countin_out;

  // Programmable 7-bit counter module
  prog_count_7 counter(.max_count(max_count), 
            .run(run), 
            .CLK(CLK), 
            .count_out(countin_out));

  // Binary-to-BCD Converter for converting count_out to BCD
  binary_bcd_2 bcd_converter(.bin_in(countin_out),
                  .digit_1(digit_1), 
                  .digit_2(digit_2));

endmodule

我尝试更改digit_1和digit_2的类型,但无济于事。解决方案可能是创建连接到实验室板上的导线,而不是传递输出寄存器,如果是的话,那会是什么样?

感谢您的帮助。如果需要,我可以提供程序中其他模块的代码。

谢谢!

verilog hdl
1个回答
0
投票

您已将digit_1 / 2声明为变量,并且在Verilog中它必须是网络,我假设这些是binary_bcd_2模块的输出端口。 SystemVerilog没有此限制。

仅从端口声明中删除reg关键字。我添加了wire清晰度,但这是隐式的

module bcd_count_7(
  input wire [6:0] max_count,
  input wire CLK, run,
  output wire [3:0] digit_1,
  output wire [3:0] digit_2
);
© www.soinside.com 2019 - 2024. All rights reserved.