首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >并发分配或输出端口连接的目标应为净类型

并发分配或输出端口连接的目标应为净类型
EN

Stack Overflow用户
提问于 2020-02-07 15:17:03
回答 1查看 3.7K关注 0票数 0

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

代码语言:javascript
复制
 ERROR:HDLCompiler:329 - "C:/Users/Chase/Desktop/Code 
 Templates/final_bcd_counter.v" Line 25: Target <digit_1> of concurrent assignment or output port connection should be a net type.

 ERROR:HDLCompiler:329 - "C:/Users/Chase/Desktop/Code 
 Templates/final_bcd_counter.v" Line 26: Target <digit_2> of concurrent assignment or output port connection should be a net type.

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

代码语言:javascript
复制
`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文件,它是将所有需要的值传递给板的程序的主要驱动程序。其内容如下:

代码语言:javascript
复制
// 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的类型,但没有结果。解决方案是否是创建连接到实验室板的电线,而不是传递输出寄存器,如果是,那会是什么样子?

任何帮助都是非常感谢的。如果需要的话,我可以提供程序中其他模块的代码。

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-07 16:12:56

您已经将位1/2声明为变量,它需要是Verilog中的一个net,我假设这些是来自您的binary_bcd_2模块的输出端口。SystemVerilog没有这个限制。

只需从端口声明中删除reg关键字即可。为了清晰起见,我添加了wire,但这是隐式的

代码语言:javascript
复制
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
);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60116253

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档