//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Tubo 8051 cores MAC Interface Module ////
|
//// Tubo 8051 cores MAC Interface Module ////
|
//// ////
|
//// ////
|
//// This file is part of the Turbo 8051 cores project ////
|
//// This file is part of the Turbo 8051 cores project ////
|
//// http://www.opencores.org/cores/turbo8051/ ////
|
//// http://www.opencores.org/cores/turbo8051/ ////
|
//// ////
|
//// ////
|
//// Description ////
|
//// Description ////
|
//// Turbo 8051 definitions. ////
|
//// Turbo 8051 definitions. ////
|
//// ////
|
//// ////
|
//// To Do: ////
|
//// To Do: ////
|
//// nothing ////
|
//// nothing ////
|
//// ////
|
//// ////
|
//// Author(s): ////
|
//// Author(s): ////
|
//// - Dinesh Annayya, dinesha@opencores.org ////
|
//// - Dinesh Annayya, dinesha@opencores.org ////
|
//// ////
|
//// ////
|
|
//// Revision : Mar 2, 2011 ////
|
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Copyright (C) 2000 Authors and OPENCORES.ORG ////
|
//// Copyright (C) 2000 Authors and OPENCORES.ORG ////
|
//// ////
|
//// ////
|
//// This source file may be used and distributed without ////
|
//// This source file may be used and distributed without ////
|
//// restriction provided that this copyright statement is not ////
|
//// restriction provided that this copyright statement is not ////
|
//// removed from the file and that any derivative work contains ////
|
//// removed from the file and that any derivative work contains ////
|
//// the original copyright notice and the associated disclaimer. ////
|
//// the original copyright notice and the associated disclaimer. ////
|
//// ////
|
//// ////
|
//// This source file is free software; you can redistribute it ////
|
//// This source file is free software; you can redistribute it ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// Public License as published by the Free Software Foundation; ////
|
//// Public License as published by the Free Software Foundation; ////
|
//// either version 2.1 of the License, or (at your option) any ////
|
//// either version 2.1 of the License, or (at your option) any ////
|
//// later version. ////
|
//// later version. ////
|
//// ////
|
//// ////
|
//// This source is distributed in the hope that it will be ////
|
//// This source is distributed in the hope that it will be ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
//// details. ////
|
//// details. ////
|
//// ////
|
//// ////
|
//// You should have received a copy of the GNU Lesser General ////
|
//// You should have received a copy of the GNU Lesser General ////
|
//// Public License along with this source; if not, download it ////
|
//// Public License along with this source; if not, download it ////
|
//// from http://www.opencores.org/lgpl.shtml ////
|
//// from http://www.opencores.org/lgpl.shtml ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
|
|
/***************************************************************
|
/***************************************************************
|
Description:
|
Description:
|
Synchronizes the pulse from one clock to another
|
Synchronizes the pulse from one clock to another
|
* clock domain
|
* clock domain
|
***********************************************************************/
|
***********************************************************************/
|
//`timescale 1ns/100ps
|
|
module half_dup_dble_reg (
|
module half_dup_dble_reg (
|
//outputs
|
//outputs
|
sync_out_pulse,
|
sync_out_pulse,
|
//inputs
|
//inputs
|
in_pulse,
|
in_pulse,
|
dest_clk,
|
dest_clk,
|
reset_n);
|
reset_n);
|
|
|
output sync_out_pulse; //output synchronised to slow clock
|
output sync_out_pulse; //output synchronised to slow clock
|
input in_pulse; //input based on fast clock, pulse
|
input in_pulse; //input based on fast clock, pulse
|
input dest_clk; //slow clock
|
input dest_clk; //slow clock
|
input reset_n;
|
input reset_n;
|
|
|
reg s1_sync_out,d_sync_out,s2_sync_out;
|
reg s1_sync_out,d_sync_out,s2_sync_out;
|
|
|
//double register the data in the slow clock domain
|
//double register the data in the slow clock domain
|
always @(posedge dest_clk or negedge reset_n)
|
always @(posedge dest_clk or negedge reset_n)
|
begin
|
begin
|
if (!reset_n)
|
if (!reset_n)
|
begin
|
begin
|
s1_sync_out <= 0;
|
s1_sync_out <= 0;
|
s2_sync_out <= 0;
|
s2_sync_out <= 0;
|
d_sync_out <= 0;
|
d_sync_out <= 0;
|
end // if (reset_n)
|
end // if (reset_n)
|
else
|
else
|
begin
|
begin
|
s1_sync_out <= in_pulse;
|
s1_sync_out <= in_pulse;
|
s2_sync_out <= s1_sync_out;
|
s2_sync_out <= s1_sync_out;
|
d_sync_out <= s2_sync_out;
|
d_sync_out <= s2_sync_out;
|
end // else: !if(reset_n)
|
end // else: !if(reset_n)
|
end // always @ (posedge dest_clk or negedge reset_n)
|
end // always @ (posedge dest_clk or negedge reset_n)
|
|
|
assign sync_out_pulse = d_sync_out;
|
assign sync_out_pulse = d_sync_out;
|
|
|
endmodule // dble_reg
|
endmodule // dble_reg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|