Add FPGA project workspace layout
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# Vivado-generated project state. The committed source of truth is
|
||||
# create_project.tcl — everything below (including the .xpr itself, which
|
||||
# embeds machine-specific paths) is regenerated by running that script.
|
||||
|
||||
# The project file itself — regenerated from create_project.tcl
|
||||
*.xpr
|
||||
|
||||
# Project-wide generated directories (named after the .xpr basename)
|
||||
*.cache/
|
||||
*.hw/
|
||||
*.sim/
|
||||
*.runs/
|
||||
*.ip_user_files/
|
||||
*.gen/
|
||||
*.srcs/
|
||||
|
||||
# Vivado scratch / temp
|
||||
.Xil/
|
||||
xsim.dir/
|
||||
|
||||
# Logs, journals, autosave backups
|
||||
*.jou
|
||||
*.log
|
||||
*.str
|
||||
*.backup.*
|
||||
*.wdb
|
||||
*.pb
|
||||
vivado*.jou
|
||||
vivado*.log
|
||||
|
||||
# Webtalk telemetry
|
||||
webtalk*.jou
|
||||
webtalk*.log
|
||||
usage_statistics_webtalk.*
|
||||
@@ -0,0 +1,19 @@
|
||||
# FPGA/vivado/
|
||||
|
||||
The Vivado project workspace. The committed source of truth is
|
||||
`create_project.tcl`; the project file (`FPGA-Core.xpr`) and all of Vivado's
|
||||
generated state (`*.runs/`, `*.cache/`, `*.hw/`, `*.sim/`, `*.ip_user_files/`,
|
||||
`*.gen/`, `*.srcs/`) are git-ignored — `.xpr` files embed machine-specific
|
||||
paths and are regenerated locally.
|
||||
|
||||
RTL and testbench files are added to the project as **references** to
|
||||
`../rtl/...` / `../tb/...` so the actual source of truth stays in version
|
||||
control, not inside the project file.
|
||||
|
||||
To generate the project, run from the repo root:
|
||||
|
||||
```sh
|
||||
vivado -mode batch -source FPGA/vivado/create_project.tcl
|
||||
```
|
||||
|
||||
Then open the resulting `FPGA/vivado/FPGA-Core.xpr` in the Vivado GUI.
|
||||
@@ -0,0 +1,43 @@
|
||||
# create_project.tcl — generate FPGA/vivado/FPGA-Core.xpr
|
||||
#
|
||||
# Usage (from the repo root):
|
||||
# vivado -mode batch -source FPGA/vivado/create_project.tcl
|
||||
#
|
||||
# Or from inside FPGA/vivado/:
|
||||
# vivado -mode batch -source create_project.tcl
|
||||
#
|
||||
# Then open the resulting .xpr in the Vivado GUI. To regenerate from scratch,
|
||||
# delete FPGA-Core.xpr and its sibling *.cache / *.runs / *.hw / *.sim /
|
||||
# *.ip_user_files / *.gen directories, then re-run.
|
||||
|
||||
set script_dir [file normalize [file dirname [info script]]]
|
||||
set fpga_dir [file normalize "$script_dir/.."]
|
||||
set proj_name "FPGA-Core"
|
||||
set part "xc7a100tcsg324-1"
|
||||
|
||||
if {[file exists "$script_dir/$proj_name.xpr"]} {
|
||||
puts "Project already exists: $script_dir/$proj_name.xpr"
|
||||
puts "Delete it (and its sibling *.cache, *.runs, ... dirs) first."
|
||||
return
|
||||
}
|
||||
|
||||
create_project $proj_name $script_dir -part $part
|
||||
|
||||
set_property target_language Verilog [current_project]
|
||||
set_property simulator_language Mixed [current_project]
|
||||
|
||||
# RTL and testbenches are added as references (not copied) so the source of
|
||||
# truth stays in git, not inside the .xpr. Passing a directory makes Vivado
|
||||
# recursively pick up all HDL files under it.
|
||||
add_files "$fpga_dir/rtl"
|
||||
add_files -fileset sim_1 "$fpga_dir/tb"
|
||||
|
||||
set xdc_files [glob -nocomplain "$fpga_dir/constraints/*.xdc"]
|
||||
if {[llength $xdc_files] > 0} {
|
||||
add_files -fileset constrs_1 $xdc_files
|
||||
}
|
||||
|
||||
update_compile_order -fileset sources_1
|
||||
update_compile_order -fileset sim_1
|
||||
|
||||
puts "Created $script_dir/$proj_name.xpr"
|
||||
Reference in New Issue
Block a user