nextpnr/machxo2/examples/rgbcount.v

34 lines
620 B
Coq
Raw Normal View History

2021-02-04 04:31:14 +08:00
// Modified from:
// https://github.com/tinyfpga/TinyFPGA-A-Series/tree/master/template_a2
// https://tinyfpga.com/a-series-guide.html used as a basis.
module top (
2021-02-04 04:31:14 +08:00
(* LOC="21" *)
inout pin6,
(* LOC="26" *)
inout pin9_jtgnb,
(* LOC="27" *)
inout pin10_sda,
);
wire clk;
2021-02-04 04:31:14 +08:00
OSCH #(
.NOM_FREQ("2.08")
) internal_oscillator_inst (
.STDBY(1'b0),
2021-02-04 04:31:14 +08:00
.OSC(clk)
);
2021-02-04 04:31:14 +08:00
reg [23:0] led_timer;
2021-02-04 04:31:14 +08:00
always @(posedge clk) begin
led_timer <= led_timer + 1;
2021-02-04 04:31:14 +08:00
end
2021-02-04 04:31:14 +08:00
// left side of board
assign pin9_jtgnb = led_timer[23];
assign pin10_sda = led_timer[22];
assign pin6 = led_timer[21];
endmodule