Skip to content

Commit 696e1c2

Browse files
authored
Merge pull request #15 from projf/parameters
Switched parameter location in modules.
2 parents eabe516 + 5471765 commit 696e1c2

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

rtl/display_clocks.v

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,21 @@
77

88
// Defaults to 25.2 and 126 MHz for 640x480 at 60 Hz
99

10-
module display_clocks #(
11-
MULT_MASTER=31.5, // master clock multiplier (2.000-64.000)
12-
DIV_MASTER=5, // master clock divider (1-106)
13-
DIV_5X=5.0, // 5x clock divider (1-128)
14-
DIV_1X=25, // 1x clock divider (1-128)
15-
IN_PERIOD=10.0 // period of i_clk in ns (100 MHz = 10.0 ns)
16-
)
17-
(
10+
module display_clocks (
1811
input wire i_clk, // input clock
1912
input wire i_rst, // reset (active high)
2013
output wire o_clk_1x, // pixel clock
2114
output wire o_clk_5x, // 5x clock for 10:1 DDR SerDes
2215
output wire o_locked // clock locked? (active high)
2316
);
2417

25-
wire clk_fb; // internal feedback
18+
parameter MULT_MASTER=31.5; // master clock multiplier (2.000-64.000)
19+
parameter DIV_MASTER=5; // master clock divider (1-106)
20+
parameter DIV_5X=5.0; // 5x clock divider (1-128)
21+
parameter DIV_1X=25; // 1x clock divider (1-128)
22+
parameter IN_PERIOD=10.0; // period of i_clk in ns (100 MHz = 10.0 ns)
23+
24+
wire clk_fb; // internal clock feedback
2625

2726
MMCME2_BASE #(
2827
.BANDWIDTH("OPTIMIZED"), // Jitter programming (OPTIMIZED, HIGH, LOW)

rtl/display_timings.v

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,7 @@
77

88
// Defaults to 640x480 at 60 Hz
99

10-
module display_timings #(
11-
H_RES=640, // horizontal resolution (pixels)
12-
V_RES=480, // vertical resolution (lines)
13-
H_FP=16, // horizontal front porch
14-
H_SYNC=96, // horizontal sync
15-
H_BP=48, // horizontal back porch
16-
V_FP=10, // vertical front porch
17-
V_SYNC=2, // vertical sync
18-
V_BP=33, // vertical back porch
19-
H_POL=0, // horizontal sync polarity (0:neg, 1:pos)
20-
V_POL=0 // vertical sync polarity (0:neg, 1:pos)
21-
)
22-
(
10+
module display_timings (
2311
input wire i_pix_clk, // pixel clock
2412
input wire i_rst, // reset: restarts frame (active high)
2513
output wire o_hs, // horizontal sync
@@ -30,6 +18,17 @@ module display_timings #(
3018
output reg signed [15:0] o_sy // vertical beam position (including blanking)
3119
);
3220

21+
parameter H_RES=640; // horizontal resolution (pixels)
22+
parameter V_RES=480; // vertical resolution (lines)
23+
parameter H_FP=16; // horizontal front porch
24+
parameter H_SYNC=96; // horizontal sync
25+
parameter H_BP=48; // horizontal back porch
26+
parameter V_FP=10; // vertical front porch
27+
parameter V_SYNC=2; // vertical sync
28+
parameter V_BP=33; // vertical back porch
29+
parameter H_POL=0; // horizontal sync polarity (0:neg, 1:pos)
30+
parameter V_POL=0; // vertical sync polarity (0:neg, 1:pos)
31+
3332
// Horizontal: sync, active, and pixels
3433
localparam signed H_STA = 0 - H_FP - H_SYNC - H_BP; // horizontal start
3534
localparam signed HS_STA = H_STA + H_FP; // sync start

0 commit comments

Comments
 (0)