Forum Discussion
Altera_Forum
Honored Contributor
15 years agoIn your top file, add a counter to divide the clock down to a reasonable blink rate
Ex: In many of my designs say I have a 50 mhz clk, I make a 29 bit counter that I route bit 26 to a led and use bit 29 to switch between it and a OS process that blinks the led via a PIO write - this shows me if 1 hardware is loaded (the counter blinking the LED slowly) and 2 the OS is running (the SW blinking it fast) To do this I add a wire from pio output .pio_out() in the SOPC builder's instance in the top to the io assign and switch with the ? operator assign led_output = counter[29] ? counter[26] : pio_out; reg [29:0] counter; always@(posedge clk_50mhz or negedge global_resetn) begin if(global_resetn == 0) begin counter <= 0; end else begin counter <= counter + 29'h00000001; end end