在试图合成代码以在Anvyl板上运行时,我遇到了以下错误:
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文件来驱动板,如下所示:
`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的类型,但没有结果。解决方案是否是创建连接到实验室板的电线,而不是传递输出寄存器,如果是,那会是什么样子?
任何帮助都是非常感谢的。如果需要的话,我可以提供程序中其他模块的代码。
谢谢!
发布于 2020-02-07 16:12:56
您已经将位1/2声明为变量,它需要是Verilog中的一个net,我假设这些是来自您的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
);https://stackoverflow.com/questions/60116253
复制相似问题