我声明了以下systemverilog模块:
button.getBackground().mutate().setColorFilter(parseColor(tintColor), PorterDuff.Mode.SRC_ATOP);
我正在使用Vivado 2018.2在此模块上运行功能测试。我在测试台中将以下数组传递给module_top:
module module_top
(
input logic clk,
input logic rst,
input logic signed [7 : 0 ] x_in,
input logic signed [5 : 0 ] y_in [24:0]
);
module_1 module_1_inst_1( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[4 : 0 ]));
module_1 module_1_inst_2( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[9 : 5 ]));
module_1 module_1_inst_3( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[14: 10]));
module_1 module_1_inst_4( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[19: 15]));
module_1 module_1_inst_5( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[24: 20]));
endmodule
module module_1
(
input logic clk,
input logic rst,
input logic signed [7 : 0 ] x_in,
input logic signed [5 : 0 ] y_in [4:0]
);
always_ff @(posedge clk) begin
$display("INFO: ", $sformatf("y_in=%p", y_in));
end
endmodule
当我查看wavforms时,module_1的所有实例化都获得正确的y_in slice摘录module_1_inst_2。对我来说,很奇怪的是,我在module_1_inst_2中获得y_in的Z值。例如,如果我运行模拟,由于我在时钟的每个pos沿打印y_in值,因此得到以下信息:
y_in = {
6'b001111, 6'b001111, 6'b001111, 6'b001111, 6'b001111,
6'b001111, 6'b001111, 6'b001111, 6'b001111, 6'b001111,
6'b001111, 6'b001111, 6'b001111, 6'b001111, 6'b001111,
6'b001111, 6'b001111, 6'b001111, 6'b001111, 6'b000000,
6'b001111, 6'b001111, 6'b001111, 6'b001111, 6'b001111
};
但是,如果我将此打印内容向上移动到层次结构(module_top)的上一层,则y_in正确地具有所有值。当检查波形时,我得到了相同的观察结果。
另一方面,如果我将y_in的宽度从6更改为7位,那么它可以工作!因此,我猜测Xilinx不能正确支持模块的passign数组吗?还是我做错了什么?
答案 0 :(得分:1)
给出一个如下所示的完整示例将很有帮助,该示例可与其他模拟器配合使用。数组串联{,,,}
或分配模式'{,,,}
都应该起作用。
因此,我怀疑您是工具问题,或是未显示的内容有问题。
module module_top
(
input logic clk,
input logic rst,
input logic signed [7 : 0 ] x_in,
input logic signed [5 : 0 ] y_in [24:0]
);
module_1 module_1_inst_1( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[4 : 0 ]));
module_1 module_1_inst_2( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[9 : 5 ]));
module_1 module_1_inst_3( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[14: 10]));
module_1 module_1_inst_4( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[19: 15]));
module_1 module_1_inst_5( .clk(clk), .rst(rst), .x_in(x_in), .y_in(y_in[24: 20]));
endmodule
module module_1
(
input logic clk,
input logic rst,
input logic signed [7 : 0 ] x_in,
input logic signed [5 : 0 ] y_in [4:0]
);
always_ff @(posedge clk) begin
$display("%m INFO: ", $sformatf("y_in=%p", y_in));
end
endmodule
module top;
logic signed [5 : 0 ] y_in [24:0];
bit clk,rst;
logic signed [7 : 0 ] x_in;
module_top dut (.*);
always #2 clk++;
initial begin
y_in = {
1,2,3,4,5,
6'b001111, 6'b001111, 6'b001111, 6'b001111, 6'b001111,
6'b001111, 6'b001111, 6'b001111, 6'b001111, 6'b001111,
6'b001111, 6'b001111, 6'b001111, 6'b001111, 6'b000000,
6'b001111, 6'b001111, 6'b001111, 6'b001111, 6'b001111
};
#10 $finish;
end
endmodule