data/full_repos/permissive/172995952/src/VGA_module.v
1: b"%Error: data/full_repos/permissive/172995952/src/VGA_module.v:40: Duplicate declaration of signal: 'COLOUR_IN'\n                                                                : ... note: ANSI ports must have type declared with the I/O (IEEE 1800-2017 23.2.2.2)\n    wire  [11:0] COLOUR_IN;\n                 ^~~~~~~~~\n        data/full_repos/permissive/172995952/src/VGA_module.v:26: ... Location of original declaration\n    input [11:0] COLOUR_IN,\n                 ^~~~~~~~~\n%Error: Exiting due to 1 error(s)\n"
module VGA_module(
    input CLK,
    input [11:0] COLOUR_IN,
    output reg [11:0] COLOUR_OUT,
    output reg HS,
    output reg VS,
    output reg [9:0] ADDRH,
    output reg [8:0] ADDRY
    );
    

    wire  TRIG_1;
    wire  HorTriggOut;
    wire  VerticalTriggOut;
    wire  [9:0] HorCount;
    wire  [9:0] VerticalCount;
    wire  [11:0] COLOUR_IN;
   

    parameter VertTimeToPulseWidthEnd   = 10'd2;
    parameter VertTimeToBackPorchEnd    = 10'd31;
    parameter VertTimeToDisplayTimeEnd  = 10'd511;
    parameter VertTimeToFrontPorchEnd   = 10'd521;
    

    parameter HorzTimeToPulseWidthEnd   = 10'd96;
    parameter HorzTimeToBackPorchEnd    = 10'd144;
    parameter HorzTimeToDisplayTimeEnd  = 10'd784;
    parameter HorzTimeToFrontPorchEnd   = 10'd800;
    

    
    Generic_counter # (.COUNTER_WIDTH(2),
                       .COUNTER_MAX(3)
                       )
                       FreqCounter (
                       .CLK(CLK),
                       .ENABLE_IN(1'b1),
                       .RESET(1'b0),
                       .TRIG_OUT(TRIG_1)
                       );
    

    
    Generic_counter # (.COUNTER_WIDTH(10),
                       .COUNTER_MAX(799)
                       )
                       HorizCounter (
                       .CLK(CLK),
                       .ENABLE_IN(TRIG_1),
                       .RESET(1'b0),
                       .TRIG_OUT(HorTriggOut),
                       .COUNT(HorCount)
                       );
                       

                       
     Generic_counter # (.COUNTER_WIDTH(10),
                        .COUNTER_MAX(520)
                       )
                       VerticalCounter (
                       .CLK(CLK),
                       .ENABLE_IN(HorTriggOut),
                       .RESET(1'b0),
                       .COUNT(VerticalCount)
                       );
               
     


                    
     always@( posedge CLK) begin
          if (HorCount < HorzTimeToPulseWidthEnd)
          HS <= 0;
          else 
          HS <= 1;
     end
     


     
     always@(posedge CLK) begin
          if (VerticalCount < VertTimeToPulseWidthEnd)
          VS <= 0;
          else 
          VS <= 1;
     end
     


     
     always@( posedge CLK) begin
          if (HorCount < HorzTimeToDisplayTimeEnd && HorCount > HorzTimeToBackPorchEnd 
          && VerticalCount < VertTimeToDisplayTimeEnd && VerticalCount > VertTimeToBackPorchEnd)
          COLOUR_OUT <= COLOUR_IN;    
               
          else 
          COLOUR_OUT <= 0;          
      end      
          



           
     always@(posedge CLK) begin
          if (HorCount < HorzTimeToDisplayTimeEnd && HorCount > HorzTimeToBackPorchEnd)
                ADDRH <= HorCount - HorzTimeToBackPorchEnd;
          else 
                ADDRH <= 0;      
     end           
     



     
     always@(posedge CLK) begin           
          if ( VerticalCount < VertTimeToDisplayTimeEnd && VerticalCount > VertTimeToBackPorchEnd)
                 ADDRY <= VerticalCount - VertTimeToBackPorchEnd;
          else 
                 ADDRY <= 0;
     end
                
endmodule
module VGA_module(
    input CLK,
    input [11:0] COLOUR_IN,
    output reg [11:0] COLOUR_OUT,
    output reg HS,
    output reg VS,
    output reg [9:0] ADDRH,
    output reg [8:0] ADDRY
    );

    

    wire  TRIG_1;
    wire  HorTriggOut;
    wire  VerticalTriggOut;
    wire  [9:0] HorCount;
    wire  [9:0] VerticalCount;
    wire  [11:0] COLOUR_IN;
   

    parameter VertTimeToPulseWidthEnd   = 10'd2;
    parameter VertTimeToBackPorchEnd    = 10'd31;
    parameter VertTimeToDisplayTimeEnd  = 10'd511;
    parameter VertTimeToFrontPorchEnd   = 10'd521;
    

    parameter HorzTimeToPulseWidthEnd   = 10'd96;
    parameter HorzTimeToBackPorchEnd    = 10'd144;
    parameter HorzTimeToDisplayTimeEnd  = 10'd784;
    parameter HorzTimeToFrontPorchEnd   = 10'd800;
    

    
    Generic_counter # (.COUNTER_WIDTH(2),
                       .COUNTER_MAX(3)
                       )
                       FreqCounter (
                       .CLK(CLK),
                       .ENABLE_IN(1'b1),
                       .RESET(1'b0),
                       .TRIG_OUT(TRIG_1)
                       );
    

    
    Generic_counter # (.COUNTER_WIDTH(10),
                       .COUNTER_MAX(799)
                       )
                       HorizCounter (
                       .CLK(CLK),
                       .ENABLE_IN(TRIG_1),
                       .RESET(1'b0),
                       .TRIG_OUT(HorTriggOut),
                       .COUNT(HorCount)
                       );
                       

                       
     Generic_counter # (.COUNTER_WIDTH(10),
                        .COUNTER_MAX(520)
                       )
                       VerticalCounter (
                       .CLK(CLK),
                       .ENABLE_IN(HorTriggOut),
                       .RESET(1'b0),
                       .COUNT(VerticalCount)
                       );
               
     


                    
     always@( posedge CLK) begin
          if (HorCount < HorzTimeToPulseWidthEnd)
          HS <= 0;
          else 
          HS <= 1;
     end
     


     
     always@(posedge CLK) begin
          if (VerticalCount < VertTimeToPulseWidthEnd)
          VS <= 0;
          else 
          VS <= 1;
     end
     


     
     always@( posedge CLK) begin
          if (HorCount < HorzTimeToDisplayTimeEnd && HorCount > HorzTimeToBackPorchEnd 
          && VerticalCount < VertTimeToDisplayTimeEnd && VerticalCount > VertTimeToBackPorchEnd)
          COLOUR_OUT <= COLOUR_IN;    
               
          else 
          COLOUR_OUT <= 0;          
      end      
          



           
     always@(posedge CLK) begin
          if (HorCount < HorzTimeToDisplayTimeEnd && HorCount > HorzTimeToBackPorchEnd)
                ADDRH <= HorCount - HorzTimeToBackPorchEnd;
          else 
                ADDRH <= 0;      
     end           
     



     
     always@(posedge CLK) begin           
          if ( VerticalCount < VertTimeToDisplayTimeEnd && VerticalCount > VertTimeToBackPorchEnd)
                 ADDRY <= VerticalCount - VertTimeToBackPorchEnd;
          else 
                 ADDRY <= 0;
     end
                
endmodule