OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [BFM/] [src/] [clock/] [tb_clk.v] - Blame information for rev 48

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 34 qaztronic
// --------------------------------------------------------------------
2
//
3
// --------------------------------------------------------------------
4
 
5
`timescale 10ps/1ps
6
 
7
 
8
module
9
  tb_clk
10
  #(
11
    parameter CLK_DUTY_CYCLE  = 50,
12
    parameter CLK_PERIOD      = 32
13
  )
14
  (
15
    output reg clock
16
  );
17
 
18
  initial
19
    clock <= 1'b1;
20
 
21
  always
22
    if(CLK_DUTY_CYCLE == 50)
23
      #(CLK_PERIOD/2) clock <= ~clock;
24
    else
25
      if(clock)
26
        #(CLK_PERIOD * (CLK_DUTY_CYCLE/100)) clock <= ~clock;
27
      else
28
        #(CLK_PERIOD * ( (100 - CLK_DUTY_CYCLE)/100 ) ) clock <= ~clock;
29
 
30
endmodule
31
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.