为什么会出现这个错误?我不明白,开始,A和B是在情感列表中声明的..代码是测试平台中的程序。设计是一种多元化的设计。开始,A和B是我设计的信号,我需要这个信号在变量中工作。
当我使用questasim运行RTL模拟时,错误跳过。我试图将赋值更改为blockin,但无济于事。
我也试着改变信号声明的方式,但什么也没改变。
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发布于 2018-11-07 21:50:05
你的问题是因为START,A和B是网络。(参见my answer here )。从initial (或always块)驱动网络是非法的。但是你为什么要驱动输入呢?
https://stackoverflow.com/questions/53188917
复制相似问题