gpt4 book ai didi

verilog - 运行执行后出错

转载 作者:行者123 更新时间:2023-12-01 11:35:55 25 4
gpt4 key购买 nike

我是 Verilog 的新手,因此我遇到了一些我自己无法解决的问题。我制作了一个由 2 个文件组成的程序,合成成功但是当我尝试生成比特流时,我遇到如下错误。

[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[0].    
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[10].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[11].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[12].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[13].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[14].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[15].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[1].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[2].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[3].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[4].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[5].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[6].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[7].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[8].
[Opt 31-37] Multi-driver net found in the design: uut/TX_Data_IBUF[9].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[0].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[10].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[11].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[12].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[13].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[14].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[15].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[1].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[2].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[3].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[4].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[5].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[6].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[7].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[8].
[Opt 31-37] Multi-driver net found in the design: uut/USB_2_RXData_IBUF[9].
[Opt 31-37] Multi-driver net found in the design: uut/execute_in.

请看下面的代码

`timescale 1ns / 1ps

module ber
(
clk,
rstn,
TX_Data [15:0],
RX_Data [15:0],
total_error [15:0],
clear,
enable
);

//inputs
input clk;
input rstn;
input [15:0] TX_Data;
input [15:0] RX_Data;
input clear;
input enable;
//outputs
output [15:0] total_error;

reg [4:0] i;
reg [15:0] subtotal, next_subtotal;

assign total_error = subtotal;

always @(*) begin : comb
if (rstn==1'b0)
begin
next_subtotal = 0;
end else
if (clear==1'b1)
begin
next_subtotal = 0;
end else
if (enable == 1'b1)
begin
for (i = 0; i < 16; i = i + 1)
begin
if (TX_Data[i] != RX_Data[i])
begin
next_subtotal = next_subtotal + 1;
end
end
end
end

always @(posedge clk) begin : dff
if (rstn==1'b0)
begin
subtotal <= 7'b0000000;
end else
begin
subtotal <= next_subtotal;
end
end

endmodule

这是用上述文件实例化的另一个文件

// --------------------------------------------------------------------
`timescale 1ns/1ps
module BitErrorRate
(
reg_0_in,
reg_1_in,
reg_2_in,
reg_3_in,
reg_4_in,
reg_5_in,
reg_6_in,
reg_0_out,
reg_1_out,
reg_2_out,
reg_3_out,
reg_4_out,
reg_5_out,
reg_6_out,
//-----------------
clk,
resetn,
TX_Data [15:0],
TX_Valid,
TX_Ready,
TX_Last,
USB_2_RXData [15:0],
USB_2_RXActive,
USB_2_RXValid
);
//-------------------
input [31:0] reg_0_in; //
input [31:0] reg_1_in; //
input [31:0] reg_2_in; //
input [31:0] reg_3_in; //
input [31:0] reg_4_in; //
input [31:0] reg_5_in; //
input [31:0] reg_6_in; //

output [31:0] reg_0_out;
output [31:0] reg_1_out;
output [31:0] reg_2_out;
output [31:0] reg_3_out;
output [31:0] reg_4_out;
output [31:0] reg_5_out;
output [31:0] reg_6_out;

//-----------------------------------USB20 BER interface
input resetn, clk;

input [15:0] TX_Data;
input TX_Last;
input TX_Valid;
output TX_Ready;

input [15:0] USB_2_RXData;
input USB_2_RXActive;
input USB_2_RXValid;
//-----------------------------------
reg [31:0] reg_0_out;
reg [31:0] reg_1_out;
reg [31:0] reg_2_out;
reg [31:0] reg_3_out;
reg [31:0] reg_4_out;
reg [31:0] reg_5_out;
reg [31:0] reg_6_out;
reg [6:0] sel;


reg start; //converted from change_enb
reg execute;
reg execute_in,execute_reg,execute_ack;
wire execute_enb;
reg store_config_in, store_config;
wire busy, busy_d2;

parameter IDLE_STATE=3'd0,
COUNT_STATE=3'd1; // running

reg [15:0] T_Data;
reg [15:0] R_Data;
reg T_Ready;


assign TX_Data = T_Data;
assign USB_2_RXData = R_Data;
assign TX_Ready = T_Ready;

//INSTANTIATION OF BER (unit under test)
ber uut
(
.clk(clk),
.rstn(resetn),
.TX_Data(TX_Data),
.RX_Data(USB_2_RXData),
.total_error(total_error),
.clear(clear_err_cnt),
.enable(execute_in)
);

//------------------------------------------
always @(posedge clk)
execute_reg<=execute;

always @(posedge clk)
execute_ack<=execute_reg;


assign execute_enb=execute_reg&&(!execute); //1 to 0 ,negative edge
assign clear_err_cnt = reg_0_in[1];
assign TX_Ready = reg_0_in[2];
//------------------------------------------


//------------------------------------------
always @( posedge clk or negedge resetn)
begin
if( resetn == 1'b0 )
begin
{execute, execute_in} <= 2'd0;
{store_config, store_config_in} <= 2'd0;

end
else
begin
execute_in <= reg_0_in[0]; // sampling only

if (execute_ack)
execute <= 1'b0;
else
execute <=execute_in;

{store_config, store_config_in} <= {store_config_in, reg_0_in[1]};
end
end

//------------------------------------------
always @( posedge clk or negedge resetn)
begin
if( resetn == 1'b0 )
begin
reg_0_out <= 32'h0;
reg_1_out <= 32'h0;
reg_2_out <= 32'h0;
reg_3_out <= 32'h0;
reg_4_out <= 32'h0;
reg_5_out <= 32'h0;
reg_6_out <= 32'h0;
end
else
begin
reg_0_out[0] <= busy || busy_d2 || execute || execute_ack ;
reg_0_out[1] <= store_config;
reg_0_out[2] <= reg_0_in[2];
reg_0_out[3] <= TX_Valid;
reg_0_out[4] <= TX_Last;
reg_0_out[31:5] <= reg_0_in[31:5];
reg_1_out <= reg_1_in;
reg_2_out <= reg_2_in;
reg_3_out <= total_error;
reg_4_out <= reg_4_in;
reg_5_out <= reg_5_in;
reg_6_out <= TX_Data[15:0];
end
end
//------------------------------------------
always @ (posedge clk) //making a function for start using mux
begin
if (execute_in == 1'b1) //before was 1'b0 that will make the value to be 0
begin
T_Data <= reg_4_in[15:0]; //loading the contents of register 4 in data_1
R_Data <= reg_5_in[15:0]; //loading the contents of register 5 in data_2
end
else
begin
T_Data <= 16'b0; //if start is not equal to 1, then the data is 0
R_Data <= 16'b0; //if start is not equal to 1, then the data is 0
end
end
//------------------------------------------
//making state machine here
//using non blocking assignment
always @ (posedge clk or negedge resetn)
begin
if (resetn == 1'b0) //idle state
begin
sel <= 7'b0000000; //state 0
end
else if (TX_Valid == 7'b0000001)
begin
sel <= 7'b0000001; //state 1
end
else if (sel == 7'b0000001)
begin
sel <= 7'b0000010; //state 2
end
else if (USB_2_RXActive == 7'b0000001)
begin
sel <= 7'b0000011; //state 3
end
else if (TX_Valid == 7'b0000001 && USB_2_RXValid == 7'b0000001)
begin
sel <= 7'b0000100; //state 4
end
else if (sel == 7'b0000100)
begin
sel <= 7'b0000101; //state 5
end
else if (TX_Valid == 7'b0000000 && USB_2_RXValid == 7'b0000000)
begin
sel <= 7'b0000100; //goes back to state 4
end
end
//------------------------------------------
//making outputs for state machine
//using blocking assignment here
always @ (*)
begin
case (sel)
7'b0000000 :
execute_in = 1'b0; //state 0
7'b0000001 :
T_Ready = 1'b1; //state 1
7'b0000010 :
T_Ready = 1'b0; //state 2
7'b0000011 :
execute_in = 1'b1; //state 3
7'b0000100 :
T_Ready = 1'b1; //state 4
7'b0000101 :
T_Ready = 1'b0; //state 5
endcase
end
//------------------------------------------
endmodule

我使用的是 Vivado 2014.3 软件。请帮我解决这个问题。

最佳答案

您为输入信号设置值!这是不允许的,你应该设置值来输出信号。

例如在模块“BitErrorRate”中,“USB_2_RXData”被定义为输入。

input [15:0] USB_2_RXData;

但是您为此输入设置了一个值:

assign USB_2_RXData = R_Data;

为了解决这个问题,将USB_2_RXData定义为输出。

output [15:0] USB_2_RXData;

关于verilog - 运行执行后出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27211701/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com