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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [BFM/] [src/] [clock/] [tb_clk.v] - Rev 48

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

// --------------------------------------------------------------------
//
// --------------------------------------------------------------------
 
`timescale 10ps/1ps
 
 
module
  tb_clk
  #(
    parameter CLK_DUTY_CYCLE  = 50,
    parameter CLK_PERIOD      = 32
  )
  (
    output reg clock
  );
 
  initial
    clock <= 1'b1;
 
  always
    if(CLK_DUTY_CYCLE == 50)
      #(CLK_PERIOD/2) clock <= ~clock;
    else
      if(clock)
        #(CLK_PERIOD * (CLK_DUTY_CYCLE/100)) clock <= ~clock;
      else
        #(CLK_PERIOD * ( (100 - CLK_DUTY_CYCLE)/100 ) ) clock <= ~clock;
 
endmodule
 
 

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

powered by: WebSVN 2.1.0

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