initial commit

This commit is contained in:
2025-08-02 06:09:31 +03:00
commit 00015ffc03
85 changed files with 62051 additions and 0 deletions

40
step2.v Normal file
View File

@@ -0,0 +1,40 @@
/**
* Step 2: Blinker (slower version)
* DONE*
*/
`default_nettype none
`include "clockworks.v"
module SOC (
input clk, // system clock
input rst_i, // reset button
output [4:0] led, // system LEDs
input RXD, // UART receive
output TXD // UART transmit
);
wire clkI; // internal clock
wire resetn; // internal reset signal, goes low on reset
// A blinker that counts on 5 bits, wired to the 5 LEDs
reg [4:0] count = 0;
always @(posedge clkI) begin
count <= !resetn ? 0 : count + 1;
end
// Clock gearbox (to let you see what happens)
// and reset circuitry (to workaround an
// initialization problem with Ice40)
Clockworks #(
.SLOW(21) // Divide clock frequency by 2^21
)CW(
.CLK(clk),
.RESET(rst_i),
.clk(clkI),
.resetn(resetn)
);
assign led = count;
assign TXD = 1'b0; // not used for now
endmodule