Added base GOWIN eda script

This commit is contained in:
2023-10-14 20:30:45 +02:00
parent da27f38f0f
commit 84695d44b4
7 changed files with 198 additions and 1 deletions

2
examples/GW1NSR-4C/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
OUT
BUILD

View File

@ -0,0 +1,8 @@
IO_LOC "led_o" 10;
IO_PORT "led_o" PULL_MODE=NONE DRIVE=8;
IO_LOC "reset_n_i" 15;
IO_PORT "reset_n_i" PULL_MODE=UP;
IO_LOC "clk_i" 45;
IO_PORT "clk_i" PULL_MODE=UP;

View File

@ -0,0 +1 @@
create_clock -name CLK_IN -period 37.037 -waveform {0 18.52} [get_ports {clk_i}]

View File

@ -0,0 +1,23 @@
module led_blink
(
input clk_i,
input reset_n_i,
output led_o
);
reg [23:0] counter;
reg polarity;
always@(posedge clk_i) begin
if (!reset_n_i)
counter <= 24'h00000;
else
counter <= counter + 1'b1;
if (counter == 24'hFFFFF)
polarity <= ~polarity;
end
assign led_o = polarity;
endmodule

View File

@ -0,0 +1,28 @@
[project]
name = gowin_project
version = 0.1
out_dir = OUT
build_dir = BUILD
[server]
hostname = localhost
port = 2020
privkey = /home/joppe/.ssh/id_rsa
pubkey = /home/joppe/.ssh/id_rsa.pub
# ######################################
# Basic synthesis
[target.synth]
toolchain = gowin
# Toolchain settings
family = GW1NSR-4C
device = GW1NSR-LV4CQN48PC6/I5
toplevel = led_blink
# Fileset
# files_vhdl =
files_verilog = RTL/toplevel.v
files_con = CON/io.cst
CON/io.sdc
# ######################################