我在Verilog系统中有一个简单的fifo代码。我得到了几条vlog-2110 illegal reference to net错误消息。我查看了以前的堆栈溢出准则,没有发现我正在做的事情有什么问题。救命啊!
下面是我的错误信息,后面跟着我的代码。我会非常感激的。谢谢您抽时间见我。
错误信息:
vlog -work -sv -stats=none C:/ ModelSim _FIFO.sv模型技术ModelSim_FIFO.sv模型技术ModelSim_FIFO.sv(26):( vlog -2110)非法引用ModelSim_FIFO.sv(26):(vlog-2110)非法引用网络“空”.Error:C:/User/Single_FIFO.sv(28)::(vlog-2110)非法引用网“空”.Error: C:/Users/Single_FIFO.sv(30):(vlog-2110)非法引用网“满”.Error:C:/.Error/Single_FIFO.O.sv(32):(vlog-2110)非法引用网“满”。..
我的简单fifo代码:它的小冒犯部分,如下所示。
module fifo_core_and_cntl (data_in, data_put, data_get, clk, reset_n, data_out, occucy, empty, full);
input [7:0]data_in;
input data_put, data_get, clk, reset_n;
output [7:0]data_out;
output empty, full;
output [4:0]occucy;
logic [4:0]current_readptr, current_writeptr, next_readptr, next_writeptr;
logic [15:0][7:0]data_fifo; // This is data Fifo: 2D packed array of vectors: sixteen 8 bit vectors.
always_ff @ (posedge clk, negedge reset_n) // For the Current counter updates.
if (!reset_n)
begin
current_writeptr <= 0;
current_readptr <= 0;
end
else
begin
current_writeptr <= next_writeptr;
current_readptr <= next_readptr;
end
end
always_comb begin // Combo logic for fifo status outputs and also for internal fifo rd/wr pointer updates.
occucy = current_writeptr - current_readptr; // fifo occupancy indication
if (current_writeptr == current_readptr)
empty = 1'b1;
else
empty = 1'b0;
end
endmodule发布于 2015-03-30 09:32:49
empty和full被声明为output,这意味着它们的隐含类型是wire。您只能使用连续的assign驱动电线。
assign empty = some_value;如果要从始终块分配这些信号,则应显式地将它们声明为logic (如果使用Verilog,则为reg ):
output logic empty, full;发布于 2015-03-30 15:47:56
在默认情况下,不能将过程分配给连线,这是输出的信号类型。由于您已经在使用SystemVerilog,所以您应该更新您的端口声明列表,使其更加简单。
module fifo_core_and_cntl (
input wire [7:0] data_in,
input wire data_put, data_get, clk, reset_n,
output logic [7:0]data_out,
output logic empty, full,
output logic [4:0]occupy
);https://stackoverflow.com/questions/29340394
复制相似问题