Initial commit: minimal Quartus project ( Cyclone 10 LP, scripted flow)

This commit is contained in:
David Rodriguez 2026-04-03 22:46:51 +01:00
commit cbc6a5cbe7
6 changed files with 720 additions and 0 deletions

11
.gitignore vendored Normal file
View file

@ -0,0 +1,11 @@
build/
db/
incremental_db/
output_files/
*.rpt
*.qmsg
*.summary
*.smsg
*.sof
*.pof
*.jic

43
README.md Normal file
View file

@ -0,0 +1,43 @@
# simple_fpga_project
Minimal Quartus project for:
- Family: Cyclone 10 LP
- Device: 10CL010YU256C8G
## Folder structure
- `rtl/top.vhd` : top-level VHDL generated from the CSV pin list
- `constraints/pins.qsf` : pin assignments generated from the CSV file
- `quartus/create_project.tcl` : Quartus Tcl project generator
- `quartus/project_build.sh` : shell entry point for scripted project creation
- `build/` : working build directory
## How to run
From WSL/Linux:
```bash
cd quartus
chmod +x project_build.sh
./project_build.sh
```
This creates or updates the Quartus project in `build/`.
## Notes
- The top-level entity is `top`.
- The VHDL port names must match the names in `constraints/pins.qsf`.
- The generated VHDL directions are inferred from signal names and should be reviewed.
- This minimal flow creates the project and applies pin assignments. It does not run map/fit/asm/sta.
## To add full compile later
Add these commands after the Tcl step in `quartus/project_build.sh`:
```bash
quartus_map simple_fpga_project
quartus_fit simple_fpga_project
quartus_asm simple_fpga_project
quartus_sta simple_fpga_project
```

294
constraints/pins.qsf Normal file
View file

@ -0,0 +1,294 @@
# Auto-generated from pinout.csv
# Quartus pin assignments
set_location_assignment PIN_A3 -to PEI_DOUT5
set_location_assignment PIN_A4 -to PEI_DIN3
set_location_assignment PIN_A5 -to PEI_DIN1
set_location_assignment PIN_A6 -to PEI_DOUT6
set_location_assignment PIN_A7 -to PEI_DOUT10
set_location_assignment PIN_A8 -to PEI_CLKOUT
set_location_assignment PIN_A9 -to nTEMP_ALERT
set_location_assignment PIN_A10 -to nled_g
set_location_assignment PIN_A11 -to PEI_DOUT12
set_location_assignment PIN_A12 -to DAC_OUT76
set_location_assignment PIN_A13 -to DAC_OUT73
set_location_assignment PIN_A14 -to DAC_OUT78
set_location_assignment PIN_A15 -to DAC_OUT71
set_location_assignment PIN_B3 -to PEI_DIN0
set_location_assignment PIN_B4 -to PEI_DOUT0
set_location_assignment PIN_B5 -to PEI_DOUT1
set_location_assignment PIN_B6 -to PEI_DOUT13
set_location_assignment PIN_B7 -to PEI_DOUT2
set_location_assignment PIN_B8 -to PEI_CLKIN
set_location_assignment PIN_B10 -to nled_y
set_location_assignment PIN_B11 -to PEI_DOUT4
set_location_assignment PIN_B12 -to DAC_OUT79
set_location_assignment PIN_B13 -to DAC_OUT72
set_location_assignment PIN_B14 -to DAC_OUT77
set_location_assignment PIN_B16 -to scl_fpga
set_location_assignment PIN_C1 -to CFG_WDATA
set_location_assignment PIN_C3 -to shutdn
set_location_assignment PIN_C6 -to PEI_DOUT7
set_location_assignment PIN_C8 -to PEI_DOUT14
set_location_assignment PIN_C9 -to PEI_DOUT8
set_location_assignment PIN_C11 -to PEI_DOUT9
set_location_assignment PIN_C14 -to DAC_OUT70
set_location_assignment PIN_C15 -to DAC_OUT69
set_location_assignment PIN_C16 -to DAC_OUT68
set_location_assignment PIN_D2 -to CFG_nCS
set_location_assignment PIN_D3 -to PEI_DIN2
set_location_assignment PIN_D6 -to PEI_DOUT11
set_location_assignment PIN_D8 -to PEI_DOUT3
set_location_assignment PIN_D9 -to PEI_DOUT15
set_location_assignment PIN_D11 -to nled_r
set_location_assignment PIN_D12 -to DAC_OUT67
set_location_assignment PIN_D14 -to DAC_OUT60
set_location_assignment PIN_D15 -to DAC_OUT65
set_location_assignment PIN_D16 -to DAC_OUT66
set_location_assignment PIN_E2 -to STM8_ALERT_IN1
set_location_assignment PIN_E6 -to v_en0
set_location_assignment PIN_E7 -to PEI_SER_IN
set_location_assignment PIN_E8 -to PEI_SER_OUT
set_location_assignment PIN_E9 -to DAC_OUT74
set_location_assignment PIN_E10 -to DAC_OUT75
set_location_assignment PIN_E11 -to DAC_OUT61
set_location_assignment PIN_E15 -to clk25_in
set_location_assignment PIN_F4 -to CFG_nSTATUS
set_location_assignment PIN_F8 -to v_en3
set_location_assignment PIN_F9 -to DEBUG_OUT2
set_location_assignment PIN_F13 -to DAC_OUT62
set_location_assignment PIN_F14 -to DAC_OUT63
set_location_assignment PIN_F15 -to DAC_OUT64
set_location_assignment PIN_G1 -to heater_en0
set_location_assignment PIN_G11 -to DEBUG_OUT3
set_location_assignment PIN_G15 -to v_en1
set_location_assignment PIN_G16 -to v_en2
set_location_assignment PIN_H1 -to CFG_DCLK
set_location_assignment PIN_H2 -to CFG_RDATA
set_location_assignment PIN_H3 -to TCK
set_location_assignment PIN_H4 -to TDI
set_location_assignment PIN_H5 -to CFG_nCONFIG
set_location_assignment PIN_H14 -to CFG_CONFIG_DONE
set_location_assignment PIN_J1 -to lvds_d_out0_N
set_location_assignment PIN_J2 -to lvds_d_out0_P
set_location_assignment PIN_J4 -to TDO
set_location_assignment PIN_J5 -to TMS
set_location_assignment PIN_J12 -to DEBUG_OUT1
set_location_assignment PIN_J13 -to hd_out8
set_location_assignment PIN_J14 -to hd_in0
set_location_assignment PIN_J15 -to DEBUG_OUT5
set_location_assignment PIN_J16 -to DEBUG_OUT4
set_location_assignment PIN_K5 -to STM8_ALERT_IN0
set_location_assignment PIN_K6 -to lvds_d_in0_P
set_location_assignment PIN_K9 -to DAC_OUT17
set_location_assignment PIN_K10 -to WF_SEL0
set_location_assignment PIN_K12 -to hd_out1
set_location_assignment PIN_K15 -to DAC_OUT19
set_location_assignment PIN_K16 -to DAC_OUT16
set_location_assignment PIN_L1 -to lvds_d_in1_N
set_location_assignment PIN_L2 -to lvds_d_in1_P
set_location_assignment PIN_L6 -to lvds_d_in0_N
set_location_assignment PIN_L7 -to AMP_CS_TRIP7
set_location_assignment PIN_L8 -to AMP_CS_TRIP4
set_location_assignment PIN_L9 -to DAC_OUT18
set_location_assignment PIN_L10 -to DAC_OUT12
set_location_assignment PIN_L11 -to hd_out0
set_location_assignment PIN_L13 -to DAC_OUT20
set_location_assignment PIN_L14 -to DAC_OUT39
set_location_assignment PIN_L15 -to DAC_OUT36
set_location_assignment PIN_L16 -to DAC_OUT13
set_location_assignment PIN_M1 -to lvds_clk_in_N
set_location_assignment PIN_M2 -to lvds_clk_in_P
set_location_assignment PIN_M6 -to AMP_CS_TRIP6
set_location_assignment PIN_M7 -to AMP_CS_TRIP5
set_location_assignment PIN_M8 -to DAC_OUT11
set_location_assignment PIN_M9 -to v_pg3
set_location_assignment PIN_M10 -to v_pg2
set_location_assignment PIN_M11 -to hd_out3
set_location_assignment PIN_M15 -to C1_CLK
set_location_assignment PIN_M16 -to C2_CLK
set_location_assignment PIN_N2 -to alert_out
set_location_assignment PIN_N3 -to AMP_CS_TRIP2
set_location_assignment PIN_N5 -to AMP_CS_TRIP3
set_location_assignment PIN_N6 -to AMP_CS_TRIP1
set_location_assignment PIN_N8 -to DAC_OUT9
set_location_assignment PIN_N9 -to DAC_OUT34
set_location_assignment PIN_N11 -to DAC_OUT35
set_location_assignment PIN_N12 -to hd_out2
set_location_assignment PIN_N14 -to DAC_OUT33
set_location_assignment PIN_N15 -to DAC_OUT38
set_location_assignment PIN_N16 -to DAC_OUT32
set_location_assignment PIN_P3 -to AMP_CS_TRIP0
set_location_assignment PIN_P6 -to DAC_OUT14
set_location_assignment PIN_P8 -to DAC_OUT10
set_location_assignment PIN_P11 -to hd_out4
set_location_assignment PIN_P14 -to DAC_OUT31
set_location_assignment PIN_P15 -to DAC_OUT37
set_location_assignment PIN_P16 -to sda_fpga
set_location_assignment PIN_R3 -to DAC_OUT15
set_location_assignment PIN_R4 -to DAC_OUT3
set_location_assignment PIN_R5 -to DAC_OUT1
set_location_assignment PIN_R6 -to DAC_OUT5
set_location_assignment PIN_R7 -to DAC_OUT8
set_location_assignment PIN_R10 -to WF_SEL1
set_location_assignment PIN_R11 -to DAC_OUT24
set_location_assignment PIN_R12 -to DAC_OUT21
set_location_assignment PIN_R13 -to DAC_OUT26
set_location_assignment PIN_R14 -to DAC_OUT29
set_location_assignment PIN_R16 -to DAC_OUT30
set_location_assignment PIN_T3 -to DAC_OUT4
set_location_assignment PIN_T4 -to DAC_OUT2
set_location_assignment PIN_T5 -to DAC_OUT0
set_location_assignment PIN_T6 -to DAC_OUT6
set_location_assignment PIN_T7 -to DAC_OUT7
set_location_assignment PIN_T10 -to DAC_OUT23
set_location_assignment PIN_T11 -to DAC_OUT22
set_location_assignment PIN_T12 -to WF_SEL2
set_location_assignment PIN_T13 -to DAC_OUT25
set_location_assignment PIN_T14 -to DAC_OUT27
set_location_assignment PIN_T15 -to DAC_OUT28

View file

@ -0,0 +1,53 @@
package require ::quartus::project
package require ::quartus::flow
# -----------------------------
# Project parameters
# -----------------------------
set project_name "simple_fpga_project"
set revision_name "simple_fpga_project"
set top_entity "top"
# FPGA definition
set family_name "Cyclone 10 LP"
set device_name "10CL010YU256C8G"
# Paths
set script_dir [file dirname [info script]]
set root_dir [file normalize [file join $script_dir ".."]]
set rtl_file [file normalize [file join $root_dir "rtl" "top.vhd"]]
set pin_qsf_file [file normalize [file join $root_dir "constraints" "pins.qsf"]]
# -----------------------------
# Create/open project
# -----------------------------
if {[project_exists $project_name]} {
puts "Project already exists. Opening project: $project_name"
project_open $project_name -revision $revision_name
} else {
puts "Creating new project: $project_name"
project_new $project_name -revision $revision_name
}
# -----------------------------
# Base assignments
# -----------------------------
set_global_assignment -name FAMILY $family_name
set_global_assignment -name DEVICE $device_name
set_global_assignment -name TOP_LEVEL_ENTITY $top_entity
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL
set_global_assignment -name VHDL_FILE $rtl_file
# Import pin assignments generated from CSV
if {[file exists $pin_qsf_file]} {
puts "Loading pin assignments from $pin_qsf_file"
source $pin_qsf_file
} else {
puts "Warning: pin assignment file not found: $pin_qsf_file"
}
export_assignments
project_close
puts "Quartus project generation complete."

59
quartus/project_build.sh Normal file
View file

@ -0,0 +1,59 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
BUILD_DIR="${ROOT_DIR}/build"
TCL_SCRIPT="${SCRIPT_DIR}/create_project.tcl"
PROJECT_NAME="simple_fpga_project"
clean() {
echo "Cleaning build artifacts..."
rm -rf "${BUILD_DIR}"
rm -rf "${ROOT_DIR}/db"
rm -rf "${ROOT_DIR}/incremental_db"
rm -rf "${ROOT_DIR}/output_files"
# Remove Quartus project files if they exist in root
rm -f "${ROOT_DIR}/${PROJECT_NAME}.qpf"
rm -f "${ROOT_DIR}/${PROJECT_NAME}.qsf"
echo "Clean complete."
}
build() {
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
if ! command -v quartus_sh >/dev/null 2>&1; then
echo "Error: quartus_sh not found in PATH"
exit 1
fi
echo "Generating/updating Quartus project..."
quartus_sh -t "${TCL_SCRIPT}"
echo "Project created/updated successfully."
}
# -----------------------------
# Command handling
# -----------------------------
case "${1:-build}" in
clean)
clean
;;
rebuild)
clean
build
;;
build)
build
;;
*)
echo "Usage: $0 [build|clean|rebuild]"
exit 1
;;
esac

260
rtl/top.vhd Normal file
View file

@ -0,0 +1,260 @@
library ieee;
use ieee.std_logic_1164.all;
entity top is
port (
PEI_DOUT5 : out std_logic;
PEI_DIN3 : in std_logic;
PEI_DIN1 : in std_logic;
PEI_DOUT6 : out std_logic;
PEI_DOUT10 : out std_logic;
PEI_CLKOUT : out std_logic;
nTEMP_ALERT : in std_logic;
nled_g : out std_logic;
PEI_DOUT12 : out std_logic;
DAC_OUT76 : out std_logic;
DAC_OUT73 : out std_logic;
DAC_OUT78 : out std_logic;
DAC_OUT71 : out std_logic;
PEI_DIN0 : in std_logic;
PEI_DOUT0 : out std_logic;
PEI_DOUT1 : out std_logic;
PEI_DOUT13 : out std_logic;
PEI_DOUT2 : out std_logic;
PEI_CLKIN : in std_logic;
nled_y : out std_logic;
PEI_DOUT4 : out std_logic;
DAC_OUT79 : out std_logic;
DAC_OUT72 : out std_logic;
DAC_OUT77 : out std_logic;
scl_fpga : inout std_logic;
CFG_WDATA : inout std_logic;
shutdn : inout std_logic;
PEI_DOUT7 : out std_logic;
PEI_DOUT14 : out std_logic;
PEI_DOUT8 : out std_logic;
PEI_DOUT9 : out std_logic;
DAC_OUT70 : out std_logic;
DAC_OUT69 : out std_logic;
DAC_OUT68 : out std_logic;
CFG_nCS : inout std_logic;
PEI_DIN2 : in std_logic;
PEI_DOUT11 : out std_logic;
PEI_DOUT3 : out std_logic;
PEI_DOUT15 : out std_logic;
nled_r : out std_logic;
DAC_OUT67 : out std_logic;
DAC_OUT60 : out std_logic;
DAC_OUT65 : out std_logic;
DAC_OUT66 : out std_logic;
STM8_ALERT_IN1 : in std_logic;
v_en0 : out std_logic;
PEI_SER_IN : in std_logic;
PEI_SER_OUT : out std_logic;
DAC_OUT74 : out std_logic;
DAC_OUT75 : out std_logic;
DAC_OUT61 : out std_logic;
clk25_in : in std_logic;
CFG_nSTATUS : in std_logic;
v_en3 : out std_logic;
DEBUG_OUT2 : out std_logic;
DAC_OUT62 : out std_logic;
DAC_OUT63 : out std_logic;
DAC_OUT64 : out std_logic;
heater_en0 : out std_logic;
DEBUG_OUT3 : out std_logic;
v_en1 : out std_logic;
v_en2 : out std_logic;
CFG_DCLK : inout std_logic;
CFG_RDATA : in std_logic;
TCK : in std_logic;
TDI : in std_logic;
CFG_nCONFIG : inout std_logic;
CFG_CONFIG_DONE : in std_logic;
lvds_d_out0_N : out std_logic;
lvds_d_out0_P : out std_logic;
TDO : out std_logic;
TMS : in std_logic;
DEBUG_OUT1 : out std_logic;
hd_out8 : out std_logic;
hd_in0 : in std_logic;
DEBUG_OUT5 : out std_logic;
DEBUG_OUT4 : out std_logic;
STM8_ALERT_IN0 : in std_logic;
lvds_d_in0_P : in std_logic;
DAC_OUT17 : out std_logic;
WF_SEL0 : inout std_logic;
hd_out1 : out std_logic;
DAC_OUT19 : out std_logic;
DAC_OUT16 : out std_logic;
lvds_d_in1_N : in std_logic;
lvds_d_in1_P : in std_logic;
lvds_d_in0_N : in std_logic;
AMP_CS_TRIP7 : in std_logic;
AMP_CS_TRIP4 : in std_logic;
DAC_OUT18 : out std_logic;
DAC_OUT12 : out std_logic;
hd_out0 : out std_logic;
DAC_OUT20 : out std_logic;
DAC_OUT39 : out std_logic;
DAC_OUT36 : out std_logic;
DAC_OUT13 : out std_logic;
lvds_clk_in_N : in std_logic;
lvds_clk_in_P : in std_logic;
AMP_CS_TRIP6 : in std_logic;
AMP_CS_TRIP5 : in std_logic;
DAC_OUT11 : out std_logic;
v_pg3 : in std_logic;
v_pg2 : in std_logic;
hd_out3 : out std_logic;
C1_CLK : inout std_logic;
C2_CLK : inout std_logic;
alert_out : out std_logic;
AMP_CS_TRIP2 : in std_logic;
AMP_CS_TRIP3 : in std_logic;
AMP_CS_TRIP1 : in std_logic;
DAC_OUT9 : out std_logic;
DAC_OUT34 : out std_logic;
DAC_OUT35 : out std_logic;
hd_out2 : out std_logic;
DAC_OUT33 : out std_logic;
DAC_OUT38 : out std_logic;
DAC_OUT32 : out std_logic;
AMP_CS_TRIP0 : in std_logic;
DAC_OUT14 : out std_logic;
DAC_OUT10 : out std_logic;
hd_out4 : out std_logic;
DAC_OUT31 : out std_logic;
DAC_OUT37 : out std_logic;
sda_fpga : inout std_logic;
DAC_OUT15 : out std_logic;
DAC_OUT3 : out std_logic;
DAC_OUT1 : out std_logic;
DAC_OUT5 : out std_logic;
DAC_OUT8 : out std_logic;
WF_SEL1 : inout std_logic;
DAC_OUT24 : out std_logic;
DAC_OUT21 : out std_logic;
DAC_OUT26 : out std_logic;
DAC_OUT29 : out std_logic;
DAC_OUT30 : out std_logic;
DAC_OUT4 : out std_logic;
DAC_OUT2 : out std_logic;
DAC_OUT0 : out std_logic;
DAC_OUT6 : out std_logic;
DAC_OUT7 : out std_logic;
DAC_OUT23 : out std_logic;
DAC_OUT22 : out std_logic;
WF_SEL2 : inout std_logic;
DAC_OUT25 : out std_logic;
DAC_OUT27 : out std_logic;
DAC_OUT28 : out std_logic
);
end entity top;
architecture rtl of top is
begin
-- Placeholder architecture generated from pinout.csv.
-- Update port directions if your interface definition requires it.
PEI_DOUT5 <= '0';
PEI_DOUT6 <= '0';
PEI_DOUT10 <= '0';
PEI_CLKOUT <= '0';
nled_g <= '0';
PEI_DOUT12 <= '0';
DAC_OUT76 <= '0';
DAC_OUT73 <= '0';
DAC_OUT78 <= '0';
DAC_OUT71 <= '0';
PEI_DOUT0 <= '0';
PEI_DOUT1 <= '0';
PEI_DOUT13 <= '0';
PEI_DOUT2 <= '0';
nled_y <= '0';
PEI_DOUT4 <= '0';
DAC_OUT79 <= '0';
DAC_OUT72 <= '0';
DAC_OUT77 <= '0';
PEI_DOUT7 <= '0';
PEI_DOUT14 <= '0';
PEI_DOUT8 <= '0';
PEI_DOUT9 <= '0';
DAC_OUT70 <= '0';
DAC_OUT69 <= '0';
DAC_OUT68 <= '0';
PEI_DOUT11 <= '0';
PEI_DOUT3 <= '0';
PEI_DOUT15 <= '0';
nled_r <= '0';
DAC_OUT67 <= '0';
DAC_OUT60 <= '0';
DAC_OUT65 <= '0';
DAC_OUT66 <= '0';
v_en0 <= '0';
PEI_SER_OUT <= '0';
DAC_OUT74 <= '0';
DAC_OUT75 <= '0';
DAC_OUT61 <= '0';
v_en3 <= '0';
DEBUG_OUT2 <= '0';
DAC_OUT62 <= '0';
DAC_OUT63 <= '0';
DAC_OUT64 <= '0';
heater_en0 <= '0';
DEBUG_OUT3 <= '0';
v_en1 <= '0';
v_en2 <= '0';
lvds_d_out0_N <= '0';
lvds_d_out0_P <= '0';
TDO <= '0';
DEBUG_OUT1 <= '0';
hd_out8 <= '0';
DEBUG_OUT5 <= '0';
DEBUG_OUT4 <= '0';
DAC_OUT17 <= '0';
hd_out1 <= '0';
DAC_OUT19 <= '0';
DAC_OUT16 <= '0';
DAC_OUT18 <= '0';
DAC_OUT12 <= '0';
hd_out0 <= '0';
DAC_OUT20 <= '0';
DAC_OUT39 <= '0';
DAC_OUT36 <= '0';
DAC_OUT13 <= '0';
DAC_OUT11 <= '0';
hd_out3 <= '0';
alert_out <= '0';
DAC_OUT9 <= '0';
DAC_OUT34 <= '0';
DAC_OUT35 <= '0';
hd_out2 <= '0';
DAC_OUT33 <= '0';
DAC_OUT38 <= '0';
DAC_OUT32 <= '0';
DAC_OUT14 <= '0';
DAC_OUT10 <= '0';
hd_out4 <= '0';
DAC_OUT31 <= '0';
DAC_OUT37 <= '0';
DAC_OUT15 <= '0';
DAC_OUT3 <= '0';
DAC_OUT1 <= '0';
DAC_OUT5 <= '0';
DAC_OUT8 <= '0';
DAC_OUT24 <= '0';
DAC_OUT21 <= '0';
DAC_OUT26 <= '0';
DAC_OUT29 <= '0';
DAC_OUT30 <= '0';
DAC_OUT4 <= '0';
DAC_OUT2 <= '0';
DAC_OUT0 <= '0';
DAC_OUT6 <= '0';
DAC_OUT7 <= '0';
DAC_OUT23 <= '0';
DAC_OUT22 <= '0';
DAC_OUT25 <= '0';
DAC_OUT27 <= '0';
DAC_OUT28 <= '0';
end architecture rtl;