1

对于系统 verilog 测试平台,我需要使用参数创建 2 个时钟

Clock1 = 250MHz,起始相位0度

时钟 2 = 250MHz,起始相位与时钟 1 成 90 度

我尝试了以下方法,但它对时钟生成没有影响,并且两者仍处于同相状态。我如何实现这种相移?

  parameter CLK_PERIOD = 4000; //250MHz = 4000ps

  initial
    Clock1 = 1'b0;
  always
    Clock1= #(CLK_PERIOD/2.0) ~Clock1;

  initial begin
    Clock2 = 1'b0;
    #1000; //to make it 90degrees out of phase with Clock1
  end
  always
    Clock2= #(CLK_PERIOD/2.0) ~Clock2;
4

1 回答 1

0

foreverClock2 initial块内使用:

module tb;
  parameter CLK_PERIOD = 4000; //250MHz = 4000ps
  bit Clock1, Clock2;
  initial
    Clock1 = 1'b0;
  always
    Clock1= #(CLK_PERIOD/2.0) ~Clock1;

  initial begin
    Clock2 = 1'b0;
    #1000; //to make it 90degrees out of phase with Clock1
    forever Clock2= #(CLK_PERIOD/2.0) ~Clock2;
  end
endmodule
于 2016-06-16T17:54:32.813 回答