首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >(vlog-2110)非法引用网络"START“。"A“"B”

(vlog-2110)非法引用网络"START“。"A“"B”
EN

Stack Overflow用户
提问于 2018-11-07 19:51:35
回答 1查看 358关注 0票数 0

为什么会出现这个错误?我不明白,开始,A和B是在情感列表中声明的..代码是测试平台中的程序。设计是一种多元化的设计。开始,A和B是我设计的信号,我需要这个信号在变量中工作。

当我使用questasim运行RTL模拟时,错误跳过。我试图将赋值更改为blockin,但无济于事。

我也试着改变信号声明的方式,但什么也没改变。

代码语言:javascript
复制
program estimulos(input CLOCK, RESET,input logic START,input logic signed[7:0] A, B,output logic signed[15:0] S,output logic END_MULT,

  reg [15:0] cola_targets   [$],
  reg [15:0] target,pretarget,salida_obtenida,
  reg FINAL);

//esto nos permitirá utilziar el operador ## para los ciclcos de reloj

covergroup valores_X;    
  idea1A:coverpoint A;
  idea2B:coverpoint B;
endgroup;      


//declaraciones de tres objetos
  Bus busInst; //objeto de la clase para RSCG
  valores_X veamos; //objeto del covergroup

task monitor_input;
   begin
     while (1)
       begin       
         @(posedge CLOCK);
         if (START==1'b1)
           begin
             pretarget=A*B;//funcion ideal de obtencion de la multiplicación
            cola_targets={pretarget,cola_targets};//meto el valor deseado en la cola
           end
        end
   end
 endtask
 // defino mo
  task monitor_output;
   begin
     while (1)
       begin       
         @(posedge CLOCK);
         if (END_MULT==1'b1)
           begin
            target= cola_targets.pop_back();
             assert (salida_obtenida==target) else $error("operacion mal realizada");
           end
        end
   end
 endtask 


  initial
begin
    busInst = new;
    veamos=new;
    fork
      monitor_input;
      monitor_output;
    join_none
  while ( veamos.get_coverage()<25)
    begin
       busInst.paresA.constraint_mode(1);
        busInst.paresB.constraint_mode(1);
        busInst.imparesA.constraint_mode(0);
        busInst.imparesB.constraint_mode(0);
       $display("pruebo con paresA, paresB");
       assert (busInst.randomize()) else    $fatal("randomization failed");
        A<= busInst.A;  
        B<= busInst.B;
        veamos.sample();
            @(posedge CLOCK);
       START <= 1;
        @(posedge CLOCK);
       START <= 0;
      @(negedge END_MULT);
   end
   $stop;
end
endprogram
EN

回答 1

Stack Overflow用户

发布于 2018-11-07 21:50:05

你的问题是因为STARTAB是网络。(参见my answer here )。从initial (或always块)驱动网络是非法的。但是你为什么要驱动输入呢?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53188917

复制
相关文章

相似问题

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