首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:"(vlog-2110)非法引用net“

错误:"(vlog-2110)非法引用net“
EN

Stack Overflow用户
提问于 2015-03-30 07:19:00
回答 2查看 42.4K关注 0票数 7

我在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代码:它的小冒犯部分,如下所示。

代码语言:javascript
复制
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
EN

回答 2

Stack Overflow用户

发布于 2015-03-30 09:32:49

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

代码语言:javascript
复制
assign empty = some_value;

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

代码语言:javascript
复制
output logic empty, full;
票数 13
EN

Stack Overflow用户

发布于 2015-03-30 15:47:56

在默认情况下,不能将过程分配给连线,这是输出的信号类型。由于您已经在使用SystemVerilog,所以您应该更新您的端口声明列表,使其更加简单。

代码语言:javascript
复制
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
);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29340394

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档