new using Verilog and coding the Upduino v3.1. Set a PLL module, using its output clock to increment a counter until it reaches 2000, and toggle the output LED. This is code:
module main_pll(REFERENCECLK, PLLOUTCORE, LED);
input REFERENCECLK;
output PLLOUTCORE;
output wire LED;
wire pllout;
reg [15:0] counter;
reg temp;
pllG pllmpd(.ref_clk_i(REFERENCECLK), .rst_n_i(), .outcore_o(PLLOUTCORE),.outglobal_o());
assign pllout = PLLOUTCORE;
assign LED = temp;
initial temp <= 1'b0;
initial counter <= 16`b0;
always @(posedge pllout) begin
counter <= counter + 1;
if (counter == 2000) begin
counter <= 0;
temp <= ~temp;
end
end
endmodule
The output LED doesn't toggle and not clear what the issue could be.
Can you please help me understanding what I am doing wrong?
Thanks, Gus