繁体   English   中英

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

[英]Error: “(vlog-2110) Illegal reference to net”

我在System Verilog中有一个简单的fifo代码。 我得到几个vlog-2110 illegal reference to net错误消息。 我查看了以前的stackoverflow指南,但没有发现我的操作有任何问题。 请帮忙!!!

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

错误讯息:

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

我的简单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

emptyfull被声明为output ,这意味着它们的隐含类型是wire 您只能通过连续assign来驱动电线:

assign empty = some_value;

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

`output logic empty, full;

您无法对电线进行过程分配,这是默认情况下输出的信号类型。 由于您已经在使用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
);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM