mirror of
https://github.com/handsomezhuzhu/2025-yatcpu.git
synced 2026-02-20 20:10:14 +00:00
Fixing Z710 frequency TNS too large
- now Z7-10 vivado project no longer copy files to local folder, so vivado can auto update it in generate_bitstream.tcl - Z7-10 clock freq is divided by 5 from 125MHz to 25MHz in clock_control.v - adds Zynq7000 v1.3 for lab2
This commit is contained in:
@@ -1,46 +1,25 @@
|
||||
`timescale 1ns / 1ps
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// Company:
|
||||
// Engineer:
|
||||
//
|
||||
// Create Date: 2023/11/29 15:52:55
|
||||
// Design Name:
|
||||
// Module Name: clock_control
|
||||
// Project Name:
|
||||
// Target Devices:
|
||||
// Tool Versions:
|
||||
// Description:
|
||||
//
|
||||
// Dependencies:
|
||||
//
|
||||
// Revision:
|
||||
// Revision 0.01 - File Created
|
||||
// Additional Comments:
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fpga4student.com: FPGA projects, VHDL projects, Verilog projects
|
||||
// Verilog project: Verilog code for clock divider on FPGA
|
||||
// Top level Verilog code for clock divider on FPGA
|
||||
module clock_control(
|
||||
input clk_in,
|
||||
input clock_in,
|
||||
input enable_clk,
|
||||
output clk_out
|
||||
);
|
||||
|
||||
// if clock is divided
|
||||
localparam clk_div = 2; // clock is diveded by half of divisor
|
||||
reg [3:0] cnt = 4'd0;
|
||||
reg out = 1'b0;
|
||||
always @(posedge clk_in) begin
|
||||
cnt <= cnt + 4'd1;
|
||||
if (cnt >= (clk_div - 1)) begin
|
||||
out <= ~out;
|
||||
cnt <= 0;
|
||||
output reg clock_out
|
||||
);
|
||||
reg[3:0] counter = 4'd0;
|
||||
parameter DIVISOR = 4'd5;
|
||||
// The frequency of the output clk_out
|
||||
// = The frequency of the input clk_in divided by DIVISOR
|
||||
// For example: Fclk_in = 50Mhz, if you want to get 1Hz signal to blink LEDs
|
||||
// You will modify the DIVISOR parameter value to 28'd50.000.000
|
||||
// Then the frequency of the output clk_out = 50Mhz/50.000.000 = 1Hz
|
||||
always @(posedge clock_in)
|
||||
begin
|
||||
counter <= counter + 4'd1;
|
||||
if(counter>=(DIVISOR-1)) begin
|
||||
counter <= 4'd0;
|
||||
end
|
||||
clock_out <= ((counter<DIVISOR/2)?1'b1:1'b0) && enable_clk;
|
||||
end
|
||||
assign clk_out = out & enable_clk;
|
||||
|
||||
|
||||
// original clock
|
||||
// assign clk_out = clk_in & enable_clk;
|
||||
|
||||
endmodule
|
||||
|
||||
Reference in New Issue
Block a user