diff --git a/.gitignore b/.gitignore index de327179875..d1db777cffd 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,7 @@ _build library/**/.lock library/**/interfaces/*.sv .backstage_yaml +.setting.ini +ipcfg +_bld +radiantc.* diff --git a/docs/user_guide/build_hdl.rst b/docs/user_guide/build_hdl.rst index 06a868b2912..73de1727557 100644 --- a/docs/user_guide/build_hdl.rst +++ b/docs/user_guide/build_hdl.rst @@ -723,35 +723,12 @@ Currently, we only have a single early-version base design that builds almost like the other ones. For Lattice, there are separate tools for creating a block design **(Propel Builder)** and building an HDL design **(Radiant)**. -The build for any supported project works with ``make``, same as the others. -First, you have to open the **Propel Builder GUI** and download the necessary -Lattice-provided IPs manually. You can check the **necessary Lattice IPs** and -and their versions in the -**_system_pb.tcl** script or follow the error messages in the -**_propel_builder.log** after running ``make`` and you get -a FAILED message. - -Then, simply go to the carrier folder and run ``make``. For now, you can try +The build for any supported project works by ``make``, same as the others. +Simply go to the carrier folder and run ``make``. For now, you can try to build the only base design we have available for **CertusPro-NX Evaluation Board** by entering the base design directory and running ``make``. -Required Lattice Provided IPs to download for projects/common/lfcpnx -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -==================== ============================= ======= -IP name Display name Version -==================== ============================= ======= -riscv_rtos RISC-V RX 2.3.0 -gpio GPIO 1.6.2 -spi_controller SPI Controller 2.1.0 -i2c_controller I2C Controller 2.0.1 -axi_interconnect AXI4 Interconnect 1.2.2 -axi2ahb_bridge AXI4 to AHB-Lite Bridge 1.1.1 -axi2apb_bridge AXI4 to APB Bridge 1.1.1 -gp_timer Timer-Counter 1.3.0 -==================== ============================= ======= - .. shell:: bash ~/hdl @@ -786,17 +763,17 @@ This contains the most relevant information that you need to provide. ~/hdl $ls -ltr - $ls -ltr / - $ls -ltr // - $tail /_propel_builder.log - $tail /_radiant.log + $ls -ltr /_bld/ + $ls -ltr /_bld// + $tail /_bld/_propel_builder.log + $tail /_bld/_radiant.log Note that if the **Propel Builder** project fails to build, the **$(PROJECT_NAME)_radiant.log** may not exist. If the Propel Builder project was built successfully, the **sge** folder should appear in the **/** or in the -**/**. +**/_bld/**. The **sge** folder contains the **bsp** folder (Base Support Package) and the SoC configuration files. @@ -824,15 +801,15 @@ The **system_pb.tcl** is sourced in **adi_project_pb** procedure. The **system_project.tcl** runs second. This file is used to create and build the **HDL project** (Radiant). Here we use the output of the Propel Builder project as the **configured IPs** that can be found in the -*///lib* folder and the +*/_bld///lib* folder and the **default block design wrapper** that is the -*///.v*. +*/_bld///.v*. We add them to the Radiant project, then add our **system_top.v** wrapper, the **constraint files** and build the project. The output is a **.bit** file that by default will appear in the -**//impl_1** folder if the project was +**/_bld//impl_1** folder if the project was successfully built. Supported targets of ``make`` command @@ -1034,12 +1011,17 @@ on these tools. * - SDK (ARM/FPGA combo) - :red:`Not supported or nonexistent yet.` * - Upgrading/Version changes (non-ADI cores) - - :red:`You have to update the IP versions manually in GUI and copy the config - from the tcl console to the '.tcl' block design file, or update directly - in the '.tcl' block design file. Note that first you have to download the - new version of IPs using the GUI. An ip_upgrade tcl command exists, but - still the IPs have to be downloaded manually, and it only works if the old - IP's name is the same as the new (sometimes it changes by version).` + - :red:`If the project builds that means the dependency IPs are still + available for download. You can Update the IPs manually by checking + the available upgrades for the IPs in Propel Builder GUI at the IP + on Server section, then edit the project scripts to download and + instantiate the new versions of the IPs. the ip_catalog_install + tcl command is for downloading the IP, the adi_ip_instance is for + instantiating the IP. Simply edit the -vlnv sections with + the new versions. Sometimes configuration parameters or the IP name + also can change. In that case you should instantiate the new IP version + in GUI first, copy the vlnv and configuration section from the tcl shell window + to replace the -vlnv and -cfg_value section in the tcl scripts.` .. _build_hdl tool-versions: diff --git a/projects/common/lfcpnx/lfcpnx_system_constr.pdc b/projects/common/lfcpnx/lfcpnx_system_constr.pdc index e2cd5bd88c6..7431c482f8a 100644 --- a/projects/common/lfcpnx/lfcpnx_system_constr.pdc +++ b/projects/common/lfcpnx/lfcpnx_system_constr.pdc @@ -5,6 +5,8 @@ ldc_set_sysconfig {JTAG_PORT=ENABLE MASTER_SPI_PORT=SERIAL DONE_PORT=ENABLE INITN_PORT=ENABLE PROGRAMN_PORT=ENABLE MCCLK_FREQ=112.5 CONFIG_IOSLEW=FAST BOOTMODE=SINGLE CONFIGIO_VOLTAGE_BANK0=1.8 CONFIGIO_VOLTAGE_BANK1=3.3} +set_clock_uncertainty 0.002 [all_clocks] + #gpio LEDs 0-7 ldc_set_location -site {N5} [get_ports {leds_0_to_23[0]}] ldc_set_location -site {N6} [get_ports {leds_0_to_23[1]}] diff --git a/projects/common/lfcpnx/lfcpnx_system_pb.tcl b/projects/common/lfcpnx/lfcpnx_system_pb.tcl index 8e72f67573a..3f27b1d35ef 100644 --- a/projects/common/lfcpnx/lfcpnx_system_pb.tcl +++ b/projects/common/lfcpnx/lfcpnx_system_pb.tcl @@ -18,9 +18,18 @@ set conf_dir $ad_hdl_dir/projects/common/lfcpnx/ipcfg # folder to configure an IP. For that you have to use the -ip_params option. # set ip_download_path ${env(USERPROFILE)}/PropelIPLocal # by default on windows +ip_catalog_install -vlnv {latticesemi.com:ip:riscv_rtos:2.4.0} +ip_catalog_install -vlnv {latticesemi.com:ip:axi_interconnect:2.0.1} +ip_catalog_install -vlnv {latticesemi.com:ip:gpio:1.6.2} +ip_catalog_install -vlnv {latticesemi.com:ip:spi_controller:2.1.0} +ip_catalog_install -vlnv {latticesemi.com:ip:i2c_controller:2.0.1} +ip_catalog_install -vlnv {latticesemi.com:ip:axi2apb_bridge:1.1.1} +ip_catalog_install -vlnv {latticesemi.com:ip:axi2ahb_bridge:1.1.1} +ip_catalog_install -vlnv {latticesemi.com:ip:gp_timer:1.3.1} + ## configure ip components and add to design. ################################# -adi_ip_instance -vlnv {latticesemi.com:ip:cpu0:2.3.0} \ - -meta_vlnv {latticesemi.com:ip:riscv_rtos:2.3.0} \ +adi_ip_instance -vlnv {latticesemi.com:ip:cpu0:2.4.0} \ + -meta_vlnv {latticesemi.com:ip:riscv_rtos:2.4.0} \ -cfg_value { TCM_ENABLE: true, IRQ_NUM: 16, @@ -57,8 +66,8 @@ adi_ip_instance -vlnv {latticesemi.com:ip:i2c0:2.0.1} \ SYS_CLOCK_FREQ: 100 } \ -ip_iname "i2c0_inst" -adi_ip_instance -vlnv {latticesemi.com:module:pll0:1.8.0} \ - -meta_vlnv {latticesemi.com:module:pll:1.8.0} \ +adi_ip_instance -vlnv {latticesemi.com:module:pll0:1.9.0} \ + -meta_vlnv {latticesemi.com:module:pll:1.9.0} \ -cfg_value { gui_refclk_freq: 125.0, gui_clk_os_en: true, @@ -66,8 +75,8 @@ adi_ip_instance -vlnv {latticesemi.com:module:pll0:1.8.0} \ gui_clk_os_freq: 10.0 } \ -ip_iname "pll0_inst" -adi_ip_instance -vlnv {latticesemi.com:ip:axi_interc0:1.2.2} \ - -meta_vlnv {latticesemi.com:ip:axi_interconnect:1.2.2} \ +adi_ip_instance -vlnv {latticesemi.com:ip:axi_interc0:2.0.1} \ + -meta_vlnv {latticesemi.com:ip:axi_interconnect:2.0.1} \ -cfg_value { TOTAL_EXTMAS_CNT: 1, TOTAL_EXTSLV_CNT: 4, @@ -91,8 +100,8 @@ adi_ip_instance -vlnv {latticesemi.com:ip:axi_apb2:1.1.1} \ -meta_vlnv {latticesemi.com:ip:axi2apb_bridge:1.1.1} \ -cfg_value {} \ -ip_iname "axi_apb2_inst" -adi_ip_instance -vlnv {latticesemi.com:ip:sysmem0:2.1.0} \ - -meta_vlnv {latticesemi.com:ip:system_memory:2.1.0} \ +adi_ip_instance -vlnv {latticesemi.com:ip:sysmem0:2.3.0} \ + -meta_vlnv latticesemi.com:ip:system_memory:2.3.0 \ -cfg_value { INTERFACE: AXI4, ADDR_DEPTH: 8192, @@ -100,8 +109,8 @@ adi_ip_instance -vlnv {latticesemi.com:ip:sysmem0:2.1.0} \ REGMODE_S0: true } \ -ip_iname "sysmem0_inst" -adi_ip_instance -vlnv {latticesemi.com:ip:tcm0:1.3.9} \ - -meta_vlnv {latticesemi.com:ip:localbus_tcm:1.3.9} \ +adi_ip_instance -vlnv {latticesemi.com:ip:tcm0:1.5.0} \ + -meta_vlnv {latticesemi.com:ip:localbus_tcm:1.5.0} \ -cfg_value { PORT_COUNT: 2, ADDR_DEPTH_A: 16384, @@ -232,9 +241,9 @@ sbp_connect_interface_net "$project_name/axi_apb2_inst/APB3_M" \ sbp_connect_interface_net "$project_name/cpu0_inst/AXI_M_DATA" \ "$project_name/axi_interc0_inst/AXI_S00" sbp_connect_interface_net "$project_name/cpu0_inst/LOCAL_BUS_M_DATA" \ - "$project_name/tcm0_inst/LOCAL_BUS_IF_S0" + "$project_name/tcm0_inst/LOCAL_BUS_DATA" sbp_connect_interface_net "$project_name/cpu0_inst/LOCAL_BUS_M_INSTR" \ - "$project_name/tcm0_inst/LOCAL_BUS_IF_S1" + "$project_name/tcm0_inst/LOCAL_BUS_INSTR" sbp_connect_interface_net "$project_name/spi0_inst/INTR" \ "$project_name/cpu0_inst/IRQ_S2" sbp_connect_interface_net "$project_name/i2c0_inst/INTR" \ @@ -244,24 +253,24 @@ sbp_connect_interface_net "$project_name/gpio0_inst/INTR" \ sbp_connect_interface_net "$project_name/gpio1_inst/INTR" \ "$project_name/cpu0_inst/IRQ_S5" -sbp_assign_addr_seg -offset 'h10004000 "$project_name/axi_apb2_inst/APB3_M" \ +sbp_assign_addr_seg -offset 'h40004000 "$project_name/axi_apb2_inst/APB3_M" \ "$project_name/gpio1_inst/APB_S0" -sbp_assign_addr_seg -offset 'h10003000 "$project_name/axi_apb1_inst/APB3_M" \ +sbp_assign_addr_seg -offset 'h40003000 "$project_name/axi_apb1_inst/APB3_M" \ "$project_name/gpio0_inst/APB_S0" -sbp_assign_addr_seg -offset 'h10002000 "$project_name/axi_apb0_inst/APB3_M" \ +sbp_assign_addr_seg -offset 'h40002000 "$project_name/axi_apb0_inst/APB3_M" \ "$project_name/i2c0_inst/APB_S0" -sbp_assign_addr_seg -offset 'h10000000 "$project_name/axi_ahb0_inst/AHBL_M" \ +sbp_assign_addr_seg -offset 'h40000000 "$project_name/axi_ahb0_inst/AHBL_M" \ "$project_name/spi0_inst/AHBL_S0" sbp_assign_addr_seg -offset 'h00000000 "$project_name/cpu0_inst/LOCAL_BUS_M_DATA" \ - "$project_name/tcm0_inst/LOCAL_BUS_IF_S0" + "$project_name/tcm0_inst/LOCAL_BUS_DATA" sbp_assign_addr_seg -offset 'h00200000 "$project_name/cpu0_inst/AXI_M_INSTR" \ "$project_name/sysmem0_inst/AXI_S0" sbp_assign_addr_seg -offset 'h00000000 "$project_name/cpu0_inst/LOCAL_BUS_M_INSTR" \ - "$project_name/tcm0_inst/LOCAL_BUS_IF_S1" + "$project_name/tcm0_inst/LOCAL_BUS_INSTR" if {$timer_en == 1} { - adi_ip_update -vlnv {latticesemi.com:ip:axi_interc0:1.2.2} \ - -meta_vlnv {latticesemi.com:ip:axi_interconnect:1.2.2} \ + adi_ip_update $project_name -vlnv {latticesemi.com:ip:axi_interc0:2.0.1} \ + -meta_vlnv {latticesemi.com:ip:axi_interc0:2.0.1} \ -cfg_value { TOTAL_EXTMAS_CNT: 1, TOTAL_EXTSLV_CNT: 5, @@ -270,13 +279,13 @@ if {$timer_en == 1} { } \ -ip_iname "axi_interc0_inst" - adi_ip_instance -vlnv {latticesemi.com:ip:axi_apb3:1.1.0} \ - -meta_vlnv {latticesemi.com:ip:axi2apb_bridge:1.1.0} \ + adi_ip_instance -vlnv {latticesemi.com:ip:axi_apb3:1.1.1} \ + -meta_vlnv {latticesemi.com:ip:axi2apb_bridge:1.1.1} \ -cfg_value {} \ -ip_iname "axi_apb3_inst" - adi_ip_instance -vlnv {latticesemi.com:ip:timer0:1.3.0} \ - -meta_vlnv {latticesemi.com:ip:gp_timer:1.3.0} \ + adi_ip_instance -vlnv {latticesemi.com:ip:timer0:1.3.1} \ + -meta_vlnv {latticesemi.com:ip:gp_timer:1.3.1} \ -cfg_value { t1_cnt_up: count-up, T1_PERIOD_WIDTH: 32, @@ -312,6 +321,6 @@ if {$timer_en == 1} { sbp_connect_interface_net "$project_name/timer0_inst/INTR" \ "$project_name/cpu0_inst/IRQ_S6" - sbp_assign_addr_seg -offset 'h10005000 "$project_name/axi_apb3_inst/APB3_M" \ + sbp_assign_addr_seg -offset 'h40005000 "$project_name/axi_apb3_inst/APB3_M" \ "$project_name/timer0_inst/APB_S0" } diff --git a/projects/scripts/adi_project_lattice.tcl b/projects/scripts/adi_project_lattice.tcl index 345ff639955..7fca312d9a5 100644 --- a/projects/scripts/adi_project_lattice.tcl +++ b/projects/scripts/adi_project_lattice.tcl @@ -44,7 +44,7 @@ proc adi_project {project_name args} { puts "\nadi_project:\n" array set opt [list -dev_select "auto" \ - -ppath "./$project_name" \ + -ppath "./_bld/$project_name" \ -device "" \ -speed "" \ -board "" \ @@ -94,7 +94,7 @@ proc adi_project {project_name args} { proc adi_project_create {project_name args} { puts "\nadi_project_create:\n" - array set opt [list -ppath "./$project_name" \ + array set opt [list -ppath "./_bld/$project_name" \ -device "" \ -performance "" \ -board "" \ @@ -195,8 +195,8 @@ proc adi_project_files_auto {project_name args} { puts "\nadi_project_files_auto:\n" array set opt [list -exts {*.ipx} \ - -spath ./$project_name/$project_name/lib \ - -ppath "./$project_name" \ + -spath ./_bld/$project_name/$project_name/lib \ + -ppath "./_bld/$project_name" \ -sdepth "6" \ -opt_args "" \ {*}$args] @@ -287,7 +287,7 @@ proc adi_project_files_auto {project_name args} { proc adi_project_files {project_name args} { puts "\nadi_project_files:\n" - array set opt [list -ppath "./$project_name" \ + array set opt [list -ppath "./_bld/$project_name" \ -flist "" \ -opt_args "" \ {*}$args] @@ -374,11 +374,11 @@ proc add_update_constraint_file {pfile project_dir ext radiant_project opt_args} # Adds the default project files to the Radiant project ($project_name.rdf) proc adi_project_files_default {project_name} { adi_project_files_auto $project_name -exts {*.ipx} \ - -spath "./$project_name/$project_name/lib" \ - -ppath "./$project_name" \ + -spath "./_bld/$project_name/$project_name/lib" \ + -ppath "./_bld/$project_name" \ -sdepth "6" adi_project_files $project_name \ - -flist [list ./$project_name/$project_name/$project_name.v] + -flist [list ./_bld/$project_name/$project_name/$project_name.v] } ############################################################################### @@ -447,7 +447,7 @@ proc adopt_path {full_path_flist base_to_cut {base_to_add ""}} { proc adi_project_run {project_name args} { puts "\nadi_project_run:\n" - array set opt [list -ppath "./$project_name" \ + array set opt [list -ppath "./_bld/$project_name" \ -mode "export" \ -impl "impl_1" \ -top "system_top" \ @@ -516,7 +516,7 @@ proc adi_project_run_cmd {project_name args} { puts "\nadi_project_run_cmd:\n" set dir [pwd] - array set opt [list -ppath "./$project_name" -cmd_list "" {*}$args] + array set opt [list -ppath "./_bld/$project_name" -cmd_list "" {*}$args] set ppath $opt(-ppath) set cmd_list $opt(-cmd_list) diff --git a/projects/scripts/adi_project_lattice_pb.tcl b/projects/scripts/adi_project_lattice_pb.tcl index 5b838aa4f0a..399ce3bc121 100644 --- a/projects/scripts/adi_project_lattice_pb.tcl +++ b/projects/scripts/adi_project_lattice_pb.tcl @@ -43,17 +43,17 @@ proc adi_project_pb {project_name args} { set preinst_ip_mod_dir ${env(TOOLRTF)} array set opt [list -dev_select "auto" \ - -ppath "." \ + -ppath "./_bld" \ -device "" \ -board "" \ -speed "" \ -language "verilog" \ - -psc "" \ + -psc "${env(TOOLRTF)}/../../templates/MachXO3D_Template01/MachXO3D_Template01.psc" \ -cmd_list {{source ./system_pb.tcl}} \ {*}$args] set dev_select $opt(-dev_select) - set ppath $opt(-ppath) + set ppath [file normalize $opt(-ppath)] set language $opt(-language) set cmd_list $opt(-cmd_list) set psc $opt(-psc) @@ -93,7 +93,7 @@ proc adi_project_pb {project_name args} { proc adi_project_create_pb {project_name args} { puts "\nadi_project_create_pb:\n" - array set opt [list -ppath "." \ + array set opt [list -ppath "./_bld" \ -device "" \ -board "" \ -speed "" \ @@ -102,7 +102,7 @@ proc adi_project_create_pb {project_name args} { -cmd_list "" \ {*}$args] - set ppath $opt(-ppath) + set ppath [file normalize $opt(-ppath)] set device $opt(-device) set board $opt(-board) set speed $opt(-speed) @@ -156,37 +156,19 @@ proc adi_project_create_pb {project_name args} { set preinst_ip_mod_dir ${env(TOOLRTF)} set propel_builder_project_dir "$ppath/$project_name/$project_name" - if {$psc == ""} { - file mkdir $propel_builder_project_dir - - # Creating the necessary .socproject file for being able to open the Radiant - # and Propel SDK from Propel Builder if needed. - set file [open "$ppath/$project_name/.socproject" w] - puts $file [format { - - - - -} $project_name $project_name] - close $file + if {[file exists $ppath] != 1} { + file mkdir $ppath + } - sbp_design new -name $project_name \ - -path $propel_builder_project_dir/$project_name.sbx \ - -device $device \ - -speed $speed \ - -language $language \ - -board $board - } else { - sbp_create_project -name "$project_name" \ - -path $ppath \ - -device $device \ - -speed $speed \ - -language $language \ - -psc $psc - - foreach port [sbp_get_ports *] { - sbp_delete $port -type port - } + sbp_create_project -name "$project_name" \ + -path $ppath \ + -device $device \ + -speed $speed \ + -language $language \ + -psc $psc + + foreach port [sbp_get_ports *] { + sbp_delete $port -type port } sbp_design save @@ -197,25 +179,9 @@ proc adi_project_create_pb {project_name args} { eval $cmd } -# Workaround for keeping the configured IP folders in Propel Builder 2023.2 -# command line version. -# The 'sbp_design save' doesn't saves the temporary .lib folder to lib folder, -# instead deletes if there is anything in lib folder. -# I am copying the content of .lib (the configured IP cores) to lib after save -# to keep the configured IP cores for the Radiant project. -# Also generating the bsp after copying the configured IP cores to lib folder -# because that's also based on the content of lib folder. -# -# Update: - If the psc default template file exists then the save works fine -# and we do not need to generate the bsp separately also. sbp_design save sbp_design generate - if {$psc == ""} { - file copy "$propel_builder_project_dir/.lib/latticesemi.com" \ - "$propel_builder_project_dir/lib" - } - # Generating the bsp. sbp_design pge sge \ -i "$propel_builder_project_dir/$project_name.sbx" \ @@ -335,7 +301,7 @@ proc adi_ip_instance {args} { # \opt[ip_iname] -ip_iname cpu0_inst # \opt[ip_niname] -ip_niname new_name_inst ############################################################################### -proc adi_ip_update {args} { +proc adi_ip_update {project_name args} { array set opt [list -cfg_path "./ipcfg" \ -vlnv "" \ -ip_path "" \ @@ -354,8 +320,6 @@ proc adi_ip_update {args} { adi_ip_config {*}$args - global project_name - if {$ip_niname == ""} { sbp_replace -vlnv $vlnv -name $ip_iname -component $project_name/$ip_iname } else { diff --git a/projects/scripts/project-lattice.mk b/projects/scripts/project-lattice.mk index 619c916b84c..4cf31bfec9a 100644 --- a/projects/scripts/project-lattice.mk +++ b/projects/scripts/project-lattice.mk @@ -6,29 +6,18 @@ ################################################################################ ## Make script for building Lattice projects. ################################## # -# * Make commands: all pb rd rd-force pb-force clean clean-all clean-pb clean-rd. +# * Make commands: all pb rd rd-force pb-force clean clean-all. # # * pb: checks if dependencies exist and builds the Propel Builder project. # (block design) # * rd: checks for dependencies and builds the Radiant Project # based on Propel Builder Project. +# * force: you can build the whole project without +# checking for dependencies. # * pb-force and rd-force: you can build the respective projects without # checking for dependencies. # * clean: deletes the whole project and log files. # * clean-all: deletes all the generated files during build. -# * clean-pb: deletes the Propel Builder project files and directories. -# After this you can rebuild the Propel Builder project separately by -# 'make pb' but only if you created the project without using the '-sbc' -# template file option wich is used in official project creation command, -# because if you create with '-sbc' option the command will not create -# the project becouse the first folder from -# // is not deleted, -# becouse that contains the Radiant project files. Also deletes the log -# file for Propel Builder project. -# * clean-rd: cleans the content of // -# folder ralated to Radiant project except the -# // folder. -# Also deletes the log file for Radiant project. # # * Note: The limitation for Propel Builder project is that it does not exit # with error code no matter if the design was built or failed to, @@ -44,10 +33,10 @@ include $(HDL_PROJECT_PATH)../quiet.mk ifeq ($(OS), Windows_NT) RADIANT := pnmainc - PROPEL_BUILDER := propelbld + PROPEL_BUILDER := propelbld -console else RADIANT := radiantc - PROPEL_BUILDER := propelbldwrap + PROPEL_BUILDER := propelbldwrap -console endif # Common dependencies that all projects have. @@ -58,7 +47,7 @@ M_DEPS += $(HDL_PROJECT_PATH)scripts/adi_project_lattice_pb.tcl M_DEPS += $(HDL_PROJECT_PATH)scripts/adi_project_lattice.tcl M_DEPS += $(HDL_PROJECT_PATH)../scripts/adi_env.tcl M_DEPS += system_top.v -M_DEPS += $(PROJECT_NAME)/$(PROJECT_NAME)/$(PROJECT_NAME).v +M_DEPS += _bld/$(PROJECT_NAME)/$(PROJECT_NAME)/$(PROJECT_NAME).v M_DEPS += $(wildcard *system_constr.pdc) M_DEPS += $(wildcard *system_constr.sdc) @@ -77,13 +66,18 @@ R_DEPS_FILTER += %adi_env.tcl R_DEPS_FILTER += %adi_project_lattice.tcl R_DEPS_FILTER += %system_project.tcl -PB_TARGETS += $(PROJECT_NAME)/$(PROJECT_NAME)/$(PROJECT_NAME).sbx -PB_TARGETS += $(PROJECT_NAME)/$(PROJECT_NAME)/$(PROJECT_NAME).v +PB_TARGETS += _bld/$(PROJECT_NAME)/$(PROJECT_NAME)/$(PROJECT_NAME).sbx +PB_TARGETS += _bld/$(PROJECT_NAME)/$(PROJECT_NAME)/$(PROJECT_NAME).v + +R_TARGETS += _bld/$(PROJECT_NAME)/$(PROJECT_NAME).rdf +R_TARGETS += _bld/$(PROJECT_NAME)/impl_1/$(PROJECT_NAME)_impl_1.bit -R_TARGETS += $(PROJECT_NAME)/$(PROJECT_NAME).rdf -R_TARGETS += $(PROJECT_NAME)/impl_1/$(PROJECT_NAME)_impl_1.bit +CLEAN_TARGET += $(wildcard ./*/) +CLEAN_TARGET += $(wildcard *.log) +CLEAN_TARGET += $(wildcard ./radiantc.*) +CLEAN_TARGET += $(filter-out . .. ./. ./.., $(wildcard .*)) -.PHONY: all pb rd rd-force pb-force clean clean-all clean-pb clean-rd +.PHONY: all pb rd force rd-force pb-force clean clean-all all: pb rd @@ -92,41 +86,25 @@ pb: $(PB_TARGETS) rd: $(R_TARGETS) clean: - -rm -Rf ${PROJECT_NAME} - -rm -f $(wildcard *.log) - -rm -Rf ./ipcfg - -rm -Rf ./sge + $(call clean, \ + $(CLEAN_TARGET), \ + $(HL)$(PROJECT_NAME)$(NC) project) clean-all: - -rm -Rf ${PROJECT_NAME} - -rm -f $(wildcard *.log) - -rm -Rf ./ipcfg - -rm -Rf $(filter-out . .. ./. ./.., $(wildcard .*)) - -rm -Rf ./sge - -clean-pb: - -rm -Rf $(wildcard $(PROJECT_NAME)/$(PROJECT_NAME)/*) - -rm -f $(PROJECT_NAME)/.socproject - -rm -Rf ./ipcfg - -rm -f $(PROJECT_NAME)_propel_builder.log - -rm -Rf ./sge - -clean-rd: - -rm -Rf $(filter-out $(PROJECT_NAME)/$(PROJECT_NAME) \ - $(PROJECT_NAME)/.socproject, \ - $(wildcard $(PROJECT_NAME)/*)) - -rm -Rf $(filter-out $(PROJECT_NAME)/$(PROJECT_NAME) \ - $(PROJECT_NAME)/.socproject \ - $(PROJECT_NAME)/. \ - $(PROJECT_NAME)/.., $(wildcard $(PROJECT_NAME)/.*)) - -rm -f $(PROJECT_NAME)_radiant.log + $(call clean, \ + $(CLEAN_TARGET), \ + $(HL)$(PROJECT_NAME)$(NC) project) $(PB_TARGETS): $(filter-out $(PB_DEPS_FILTER_OUT),$(filter $(PB_DEPS_FILTER), $(M_DEPS))) - -rm -f $(PROJECT_NAME)_propel_builder.log + $(call skip_if_missing, \ + Project, \ + $(PROJECT_NAME), \ + true, \ + rm -Rf $(CLEAN_TARGET) ; \ $(call build, \ $(PROPEL_BUILDER) system_project_pb.tcl, \ $(PROJECT_NAME)_propel_builder.log, \ - $(HL)$(PROJECT_NAME)$(NC) project) + $(HL)$(PROJECT_NAME)$(NC) project)) @for file in $(filter $(R_DEPS_FILTER), $(M_DEPS)); do \ if [ ! -f $$file ]; then \ echo "No [$(HL)$$file$(NC)] found. ... $(RED)FAILED$(NC)"; \ @@ -137,13 +115,15 @@ $(PB_TARGETS): $(filter-out $(PB_DEPS_FILTER_OUT),$(filter $(PB_DEPS_FILTER), $( $(R_TARGETS): $(filter $(R_DEPS_FILTER), $(M_DEPS)) -rm -f $(PROJECT_NAME)_radiant.log - -rm -f $(PROJECT_NAME)/system_constr.pdc - -rm -f $(PROJECT_NAME)/system_constr.sdc + -rm -f _bld/$(PROJECT_NAME)/system_constr.pdc + -rm -f _bld/$(PROJECT_NAME)/system_constr.sdc $(call build, \ $(RADIANT) system_project.tcl, \ $(PROJECT_NAME)_radiant.log, \ $(HL)$(PROJECT_NAME)$(NC) project) +force: pb-force rd-force + pb-force: $(call build, \ $(PROPEL_BUILDER) system_project_pb.tcl, \ @@ -155,4 +135,3 @@ rd-force: $(RADIANT) system_project.tcl, \ $(PROJECT_NAME)_radiant.log, \ $(HL)$(PROJECT_NAME)$(NC) project) - diff --git a/scripts/adi_env.tcl b/scripts/adi_env.tcl index e0bb844a1cd..289ba524127 100644 --- a/scripts/adi_env.tcl +++ b/scripts/adi_env.tcl @@ -35,7 +35,7 @@ if {![info exists REQUIRED_QUARTUS_VERSION]} { } # Define the supported tool version -set required_lattice_version "2023.2" +set required_lattice_version "2024.2" if {[info exists ::env(REQUIRED_LATTICE_VERSION)]} { set required_lattice_version $::env(REQUIRED_LATTICE_VERSION) } elseif {[info exists REQUIRED_LATTICE_VERSION]} {