📄 dcm_phase_shift.v
字号:
/*-----------------------------------------------------------------------------
-- Digital Clock Manager (DCM) --
-- DCM in Phase Shifter mode instanciation using Synplify --
-------------------------------------------------------------------------------
--
-- GENERAL:
-- Synplify (with attribute specification) can infer Virtex-II DCM
-- cells for clock de-skew purposes. For more advanced features instanciation
-- is required.
--
-- DCM resources:
-- - Digital Clock Manager (DCM) provides the following functions:
-- - Clock Delay Locked Loop (DLL): DCM generates new system clocks
-- (internal or external to the FPGA), that are phase-aligned to the
-- input clock. (Clock De-skew)
-- - Digital Frequency Synthesizer (DFS): DCM generates a wide range of
-- output clock frequencies, performing a flexible input clock
-- multiplication or division. (Frequency Synthesis)
-- - Digital Phase Shifter (DPS): DCM provides both coarse and fine-grained
-- phase shifting with dynamic phase shift control, between DCM input
-- and output clocks. (Phase Shifting)
--
-- NOTES:
-- - Synplify infers a DCM in mode Delay Locked Loop (DLL) when input clock
-- signal is tagged with attribute "xc_clockbuftype" set to "BUFGDLL".
-- (Clock De-skew)
-- - For other features instanciattion is required
-- Log file message:
-- - Resource Usage Report section (Cell usage)
-- DCM 1 use
-------------------------------------------------------------------------------
-- Example: Phase shifter mode DCM instanciation (clk is dynamically phased
-- shifted compared to CLKIN)
-----------------------------------------------------------------------------*/
module dcm_phase_shift (clk33_board, rst_dll, ce, pulse_psen, psincdec, a, b, p, locked, psdone);
input clk33_board;
input rst_dll;
input ce;
input pulse_psen;
input psincdec;
input [15:0] a;
input [15:0] b;
output [31:0] p;
output locked;
output psdone;
reg [31:0] p;
wire clk33_ibufg;
wire clk0_dcm;
wire clk;
IBUFG clk_pad_ibufg
( .I(clk33_board),
.O(clk33_ibufg) );
DCM my_dcm
( .CLKIN(clk33_ibufg),
.CLKFB(clk),
.DSSEN(1'b0),
.PSINCDEC(psincdec),
.PSEN(pulse_psen),
.PSCLK(clk33_ibufg),
.RST(rst_dll),
.CLK0(clk0_dcm),
.CLK90(),
.CLK180(),
.CLK270(),
.CLK2X(),
.CLK2X180(),
.CLKDV(),
.CLKFX(),
.CLKFX180(),
.LOCKED(locked),
.PSDONE(psdone),
.STATUS() )
/* synthesis xc_props = "DLL_FREQUENCY_MODE = LOW, CLKOUT_PHASE_SHIFT = VARIABLE, PHASE_SHIFT = -5, STARTUP_WAIT = TRUE" */;
// Note: Don't insert any carriage return between the attributes above.
BUFG dcm_output_buffer // feedback provides phase alignment between
( .I(clk0_dcm),
.O(clk) );
// other code
always @(posedge clk)
begin
if (ce == 1'b1)
p <= a * b;
end
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -