错误:“(vlog-2110)非法引用网络”

SSa*_*adh 7 system-verilog

我在 System Verilog 中有一个简单的 fifo 代码。我收到几条vlog-2110 illegal reference to net错误消息。我查看了之前的 stackoverflow 指南,并没有发现我正在做的事情有什么问题。请帮忙!!!

我在下面给出我的错误消息,然后是我的代码。我将非常感激。感谢您的时间。

错误信息:

vlog -work work -sv -stats=none C:/Users/Single_FIFO.sv Model Technology ModelSim DE vlog 10.4 Compiler 2014.12 Dec 3 2014 -- 编译模块 fifo_core_and_cntl
错误:C:/Users/Single_FIFO.sv(24): (vlog -2110) 非法引用网络“占用”。
错误:C:/Users/Single_FIFO.sv(26): (vlog-2110) 非法引用网络“空”。
错误:C:/Users/Single_FIFO.sv(28): (vlog-2110) 非法引用网络“空”。
错误:C:/Users/Single_FIFO.sv(30): (vlog-2110) 非法引用网络“满”。
错误:C:/Users/Single_FIFO.sv(32): (vlog-2110) 非法引用网络“满”。...... ......

我的简单先进先出代码:它的小违规部分,如下所示。

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
Run Code Online (Sandbox Code Playgroud)

Tud*_*imi 11

empty并且full被声明为output,这意味着它们的隐含类型是wire。您只能使用连续的 来驱动电线assign

assign empty = some_value;
Run Code Online (Sandbox Code Playgroud)

如果要从 always 块分配这些信号,则应将它们显式声明为logic(或者reg如果您使用的是 Verilog):

output logic empty, full;
Run Code Online (Sandbox Code Playgroud)