作者kalawang (hold on)
看板Electronics
标题Re: [问题] 请教关於verilog testbench的问题
时间Sat May 1 19:35:53 2010
※ 引述《pierreqq (叶子上的风)》之铭言:
: ※ 引述《kalawang (To be or Not to be)》之铭言:
: : 我写了一个testbench 里面有二个input A, B讯号
: : 其中我想要input B在output 等於某个值时候再给值
: : 请问这有办法达成吗?
: module sim;
: reg [7:0] A, B;
: wire [7:0] out;
: myDesign Top(.A(A), .B(B), .O(out));
: initial begin
: B <= 8'hzz;
: .....
: wait ( out == 8'h55 );
: B <= 8'hAA;
: .....
: end
: endmodule
: 写testbench不用考虑太多...
感谢p大的回覆 想再请问一下
有没有办法达到不同的output而能产生不同的output
我现在想要做的是给一些test vector of A 而output会随着我的A改变
然後我想要在output == 某些值的时候 去assign B input。不过
同样的output也可能给不同的input of B。不知道该怎麽写?
举例来说 我可能会有
wait(out == 1) B = 1, or 2 or 3 ....
wait(out == 3) B = 2 or 5 ....
wait(out == 5) B = 2, or 4 or 5
而且 这三个wait我不想要有顺序关系 就是out 可能先是3 or 先是5
这样的testbench该怎麽写呢? 感谢帮忙
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.168.86.150