Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lattice tools update 2024.2 #1563

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,7 @@ _build
library/**/.lock
library/**/interfaces/*.sv
.backstage_yaml
.setting.ini
ipcfg
_bld
radiantc.*
60 changes: 21 additions & 39 deletions docs/user_guide/build_hdl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
**<project_name>_system_pb.tcl** script or follow the error messages in the
**<project_name>_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
Expand Down Expand Up @@ -786,17 +763,17 @@ This contains the most relevant information that you need to provide.

~/hdl
$ls -ltr <ADI_carrier_proj_dir>
$ls -ltr <ADI_carrier_proj_dir>/<project_name>
$ls -ltr <ADI_carrier_proj_dir>/<project_name>/<project_name>
$tail <ADI_carrier_proj_dir>/<project_name>_propel_builder.log
$tail <ADI_carrier_proj_dir>/<project_name>_radiant.log
$ls -ltr <ADI_carrier_proj_dir>/_bld/<project_name>
$ls -ltr <ADI_carrier_proj_dir>/_bld/<project_name>/<project_name>
$tail <ADI_carrier_proj_dir>/_bld/<project_name>_propel_builder.log
$tail <ADI_carrier_proj_dir>/_bld/<project_name>_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 **<ADI_carrier_proj_dir>/** or in the
**<ADI_carrier_proj_dir>/<project_name>**.
**<ADI_carrier_proj_dir>/_bld/<project_name>**.
The **sge** folder contains the **bsp** folder (Base Support
Package) and the SoC configuration files.

Expand Down Expand Up @@ -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
*<ADI_carrier_proj_dir>/<project_name>/<project_name>/lib* folder and the
*<ADI_carrier_proj_dir>/_bld/<project_name>/<project_name>/lib* folder and the
**default block design wrapper** that is the
*<ADI_carrier_proj_dir>/<project_name>/<project_name>/<project_name>.v*.
*<ADI_carrier_proj_dir>/_bld/<project_name>/<project_name>/<project_name>.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
**<ADI_carrier_proj_dir>/<project_name>/impl_1** folder if the project was
**<ADI_carrier_proj_dir>/_bld/<project_name>/impl_1** folder if the project was
successfully built.

Supported targets of ``make`` command
Expand Down Expand Up @@ -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:

Expand Down
2 changes: 2 additions & 0 deletions projects/common/lfcpnx/lfcpnx_system_constr.pdc
Original file line number Diff line number Diff line change
Expand Up @@ -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]}]
Expand Down
59 changes: 34 additions & 25 deletions projects/common/lfcpnx/lfcpnx_system_pb.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -57,17 +66,17 @@ 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,
gui_clk_os_byp: false,
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,
Expand All @@ -91,17 +100,17 @@ 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,
ID_WIDTH: 1,
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,
Expand Down Expand Up @@ -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" \
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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"
}
20 changes: 10 additions & 10 deletions projects/scripts/adi_project_lattice.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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 "" \
Expand Down Expand Up @@ -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 "" \
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
}

###############################################################################
Expand Down Expand Up @@ -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" \
Expand Down Expand Up @@ -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)

Expand Down
Loading
Loading