2424 * the next display period
2525 */
2626template <
27+ unsigned int N = 8 ,
2728 unsigned int H_ACTIVE = 640 ,
2829 unsigned int H_FP = 16 ,
2930 unsigned int H_SYNC_PULSE = 96 ,
@@ -89,21 +90,19 @@ SC_MODULE(vga)
8990 {
9091 this ->o_hsync .write (IPS_VGA_ACTIVE);
9192 }
92- // End of H-sync pulse
9393 else if (this ->h_count == (H_SYNC_PULSE + H_BP))
9494 {
9595 this ->o_hsync .write (IPS_VGA_ACTIVE);
9696 }
97- // H front porch
9897 else if (this ->h_count == (H_SYNC_PULSE + H_BP + H_ACTIVE))
9998 {
100- this ->o_hsync .write (IPS_VGA_INACTIVE );
99+ this ->o_hsync .write (IPS_VGA_ACTIVE );
101100 }
102101 // End of HSYNC
103102 else if (this ->h_count == (H_SYNC_PULSE + H_BP + H_ACTIVE + H_FP))
104103 {
105104 // Restart H counter
106- this ->o_hsync .write (IPS_VGA_ACTIVE );
105+ this ->o_hsync .write (IPS_VGA_INACTIVE );
107106 this ->h_count = 0 ;
108107
109108 // Increment H counter
@@ -112,7 +111,7 @@ SC_MODULE(vga)
112111 // VSYNC pulse
113112 if (this ->v_count == V_SYNC_PULSE)
114113 {
115- this ->o_vsync .write (IPS_VGA_INACTIVE );
114+ this ->o_vsync .write (IPS_VGA_ACTIVE );
116115 }
117116 // End of V-sync pulse
118117 else if (this ->v_count == (V_SYNC_PULSE + V_BP))
@@ -122,12 +121,12 @@ SC_MODULE(vga)
122121 // V front porch
123122 else if (this ->v_count == (V_SYNC_PULSE + V_BP + V_ACTIVE))
124123 {
125- this ->o_vsync .write (IPS_VGA_INACTIVE );
124+ this ->o_vsync .write (IPS_VGA_ACTIVE );
126125 }
127126 // End of VSYNC
128127 else if (this ->v_count == (V_SYNC_PULSE + V_BP + V_ACTIVE + V_FP))
129128 {
130- this ->o_vsync .write (IPS_VGA_ACTIVE );
129+ this ->o_vsync .write (IPS_VGA_INACTIVE );
131130 this ->v_count = 0 ;
132131 }
133132 }
0 commit comments