Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: patrick.gilbert.abb on November 06, 2017, 10:40:04 PM

Title: TE0720 : How do we add library into the std TE scripting HSI
Post by: patrick.gilbert.abb on November 06, 2017, 10:40:04 PM
Hi,
I adapt the test_board reference project to compile my own application with the TTE scripting system,
I automatically build my .bit and on the HSI compilation the system need to get the m library to link the math.h functions.
The "m" library need to be into the "Linker-libraries" setting.  How can I add this parameter into TE standard scripting param.

Second question is there any wiki page defining this scripting system?

Thank you.
Title: Re: TE0720 : How do we add library into the std TE scripting HSI
Post by: JH on November 07, 2017, 11:19:16 AM
Hi,

we have some basic description on:

But not directly for all script functions.
HSI script functions are included into "\scripts\script_hsi.tcl"
We use "sw_lib\apps_list.csv" for some parameter.
Start of external programs (HSI,Bootgen,...) are included into "\scripts\script_external.tcl"

But I think you can generate your own app as C template with correct libraries and setting (the can be included as repo to HSI or SDK),
You can put them into: \sw_lib\sw_apps and add entry into "sw_lib\apps_list.csv"
The easiest way is to copy a Xilinx template from SDK and modify. But you must try out, there is no Xilinx documentation available.
Xilinx template location  "C:\Xilinx\SDK\<Version>\data\embeddedsw\lib\sw_apps"

br
John



Title: Re: TE0720 : How do we add library into the std TE scripting HSI
Post by: patrick.gilbert.abb on November 07, 2017, 07:58:09 PM
thank you for the fast answer...
By searching a lot I finally found in C:\Xilinx\SDK\2016.3\data\embeddedsw\lib\sw_apps\zynqmp_fsbl\data\zynqmp_fsbl.tcl
a fonction called just before running the SDK compilation: proc swapp_generate {} {
So I copy this .tcl into my application rename it to my application and adapt the script to my needs
Thank you.

proc swapp_generate {} {
    # Lines to add the "m" library to support math.h

    # get the compiler flags, if set already
    set def_flags [common::get_property APP_LINKER_FLAGS [hsi::current_sw_design]]
    set new_flags "$def_flags -lm"
    # Update compiler flags
    common::set_property -name {APP_LINKER_FLAGS} -value $new_flags -objects [hsi::current_sw_design]

}