## ##################################################
## GPIO Led 8 led array on bank NA (Optional)
## ##################################################
Pin_out "RED_LEDS[0]" Loc = "IO_NA_A0";
Pin_out "RED_LEDS[1]" Loc = "IO_NA_A1";
Pin_out "RED_LEDS[2]" Loc = "IO_NA_A2";
Pin_out "RED_LEDS[3]" Loc = "IO_NA_A3";
Pin_out "RED_LEDS[4]" Loc = "IO_NA_A4";
Pin_out "RED_LEDS[5]" Loc = "IO_NA_A5";
Pin_out "RED_LEDS[6]" Loc = "IO_NA_A6";
Pin_out "RED_LEDS[7]" Loc = "IO_NA_A7";
## ##################################################
## GPIO Led 8 led array on PMOD (Optional)
## ##################################################
Pin_out "PMOD_LEDS[0]" Loc = "IO_EA_B7";
Pin_out "PMOD_LEDS[1]" Loc = "IO_EA_A7";
Pin_out "PMOD_LEDS[2]" Loc = "IO_EA_B6";
Pin_out "PMOD_LEDS[3]" Loc = "IO_EA_A6";
Pin_out "PMOD_LEDS[4]" Loc = "IO_EA_B5";
Pin_out "PMOD_LEDS[5]" Loc = "IO_EA_A5";
Pin_out "PMOD_LEDS[6]" Loc = "IO_EA_B4";
Pin_out "PMOD_LEDS[7]" Loc = "IO_EA_A4";
## ##################################################
## GPIO Led 8 rgb led array on bank NB (Optional)
## ##################################################
Pin_out "RGB_LEDS[0]" Loc = "IO_NB_A0";
Pin_out "RGB_LEDS[1]" Loc = "IO_NB_A1";
Pin_out "RGB_LEDS[2]" Loc = "IO_NB_A2";
Pin_out "RGB_LEDS[3]" Loc = "IO_NB_A3";
Pin_out "RGB_LEDS[4]" Loc = "IO_NB_A4";
Pin_out "RGB_LEDS[5]" Loc = "IO_NB_A5";
Pin_out "RGB_LEDS[6]" Loc = "IO_NB_A6";
Pin_out "RGB_LEDS[7]" Loc = "IO_NB_A7";
Pin_out "RGB_R" Loc = "IO_NB_B0";
Pin_out "RGB_B" Loc = "IO_NB_B1";
Pin_out "RGB_G" Loc = "IO_NB_B2";
Net "LED" Loc = "IO_SB_B6";
module blink(
input wire CLK,
input wire RESET,
output wire LED, // pmod blinks 2 or 5
output wire [7:0] RED_LEDS
);
reg [26:0] counter;
reg [7:0] sum = 8'b11111111;
wire clk270, clk180, clk90, clk0, usr_ref_out;
wire usr_pll_lock_stdy, usr_pll_lock;
CC_PLL #(
.REF_CLK(10.0), // reference input in MHz
.OUT_CLK(100.0), // pll output frequency in MHz
.PERF_MD("SPEED"), // LOWPOWER, ECONOMY, SPEED
.LOW_JITTER(1), // 0: disable, 1: enable low jitter mode
.CI_FILTER_CONST(2), // optional CI filter constant
.CP_FILTER_CONST(4) // optional CP filter constant
) pll_inst (
.CLK_REF(CLK), .CLK_FEEDBACK(1'b0), .USR_CLK_REF(1'b0),
.USR_LOCKED_STDY_RST(1'b0), .USR_PLL_LOCKED_STDY(usr_pll_lock_stdy), .USR_PLL_LOCKED(usr_pll_lock),
.CLK270(clk270), .CLK180(clk180), .CLK90(clk90), .CLK0(clk0), .CLK_REF_OUT(usr_ref_out)
);
assign LED = counter[26];
assign RED_LEDS = sum;
always @(posedge clk0)
begin
if (!RESET) begin
counter <= 0;
end else begin
counter <= counter + 1'b1;
end
if ( &counter[22:0] ) begin
sum <= sum - 1;
end
end
endmodule