1 module MulDivDCM(input xtal, output clk);
7 BUFG CLKFX_BUFG_INST (.I(CLKFX_BUF),
9 DCM_SP DCM_SP_INST (.CLKFB(GND_BIT),
17 defparam DCM_SP_INST.CLK_FEEDBACK = "NONE";
18 defparam DCM_SP_INST.CLKDV_DIVIDE = 2.0;
19 defparam DCM_SP_INST.CLKFX_DIVIDE = div;
20 defparam DCM_SP_INST.CLKFX_MULTIPLY = mul;
21 defparam DCM_SP_INST.CLKIN_DIVIDE_BY_2 = "FALSE";
22 defparam DCM_SP_INST.CLKIN_PERIOD = 20.000;
23 defparam DCM_SP_INST.CLKOUT_PHASE_SHIFT = "NONE";
24 defparam DCM_SP_INST.DESKEW_ADJUST = "SYSTEM_SYNCHRONOUS";
25 defparam DCM_SP_INST.DFS_FREQUENCY_MODE = "LOW";
26 defparam DCM_SP_INST.DLL_FREQUENCY_MODE = "LOW";
27 defparam DCM_SP_INST.DUTY_CYCLE_CORRECTION = "TRUE";
28 defparam DCM_SP_INST.FACTORY_JF = 16'hC080;
29 defparam DCM_SP_INST.PHASE_SHIFT = 0;
30 defparam DCM_SP_INST.STARTUP_WAIT = "TRUE";
37 output reg [2:0] green,
46 MulDivDCM dcm25(xtal, clk25);
47 defparam dcm25.div = 4;
48 defparam dcm25.mul = 2;
50 SyncGen sync(clk25, vs, hs, x, y, border);
52 always @(posedge clk25) begin
53 red <= border ? 0 : 3'b100;
54 green <= border ? 0 : 0;
55 blue <= border ? 0 : 0;
62 output reg [11:0] x, y,
66 parameter XFPORCH = 16;
68 parameter XBPORCH = 48;
71 parameter YFPORCH = 10;
73 parameter YBPORCH = 29;
75 always @(posedge pixclk)
77 if (x >= (XRES + XFPORCH + XSYNC + XBPORCH))
79 if (y >= (YRES + YFPORCH + YSYNC + YBPORCH))
86 hs <= (x >= (XRES + XFPORCH)) && (x < (XRES + XFPORCH + XSYNC));
87 vs <= (y >= (YRES + YFPORCH)) && (y < (YRES + YFPORCH + YSYNC));
88 border <= (x > XRES) || (y > YRES);