好的,谢谢你的回复。
我将尝试使用模板。我的测试平台看起来像这样(有7seg显示的端口,但我在之前的代码中跳过它们):`timescale 1ns / 1psmodule zad5_test;
//输入reg clk_i;
reg rst_i;
//输出wire [3:0] led7_seg_an;
wire [7:0] led7_seg_o;
//比尔斯线ps2_clk_io;
wire ps2_data_io;
//实例化被测单位(UUT)zad5 uut(.clk_i(clk_i),. first_i(rst_i),. led7_seg_an(led7_seg_an),. led7_seg_o(led7_seg_o),. ps2_clk_io(ps2_clk_io),. ps2_data_io(ps2_data_io));
总是开始#10 clk_i = ~clk_i;
结束初始开始clk_i = 1'b0;
ps2_clk_io = 1;
ps2_data_io = 1;
rst_i = 1;
#1000;
rst_i = 0;
#70000 ps2_data_io = 0;
//起始位#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 0#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 1#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 2#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 1;
// bit 3#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 1;
// bit 4#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 1;
// bit 5#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 6#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 7#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
//奇偶校验位#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 1;
//停止位#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
结束endmodule据我记得当然,在Verilog中,bufif0是一个原语,如NAND或NOR门,代表三态缓冲器,低电平有效使能。
我错了吗?
我没有这个模块的任何代码。
好的,谢谢你的回复。
我将尝试使用模板。我的测试平台看起来像这样(有7seg显示的端口,但我在之前的代码中跳过它们):`timescale 1ns / 1psmodule zad5_test;
//输入reg clk_i;
reg rst_i;
//输出wire [3:0] led7_seg_an;
wire [7:0] led7_seg_o;
//比尔斯线ps2_clk_io;
wire ps2_data_io;
//实例化被测单位(UUT)zad5 uut(.clk_i(clk_i),. first_i(rst_i),. led7_seg_an(led7_seg_an),. led7_seg_o(led7_seg_o),. ps2_clk_io(ps2_clk_io),. ps2_data_io(ps2_data_io));
总是开始#10 clk_i = ~clk_i;
结束初始开始clk_i = 1'b0;
ps2_clk_io = 1;
ps2_data_io = 1;
rst_i = 1;
#1000;
rst_i = 0;
#70000 ps2_data_io = 0;
//起始位#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 0#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 1#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 2#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 1;
// bit 3#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 1;
// bit 4#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 1;
// bit 5#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 6#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
// bit 7#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 0;
//奇偶校验位#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
#16500 ps2_data_io = 1;
//停止位#16500 ps2_clk_io = 0;
#33000 ps2_clk_io = 1;
结束endmodule据我记得当然,在Verilog中,bufif0是一个原语,如NAND或NOR门,代表三态缓冲器,低电平有效使能。
我错了吗?
我没有这个模块的任何代码。
举报