UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor pavelan
Visitor
255 Views
Registered: ‎06-10-2019

Running XSCT (Xilinx Software Command-Line Tool) from C# app

Jump to solution

Hello,
I'm building an automation for mass production.
The initial programming is suppose to be initiate by SDK batch commands, using the XSCT.

When I try to create a process of "C:\Xilinx\SDK\2016.4\bin\xsct.bat" (that runs batch mode of SDK)
I recive the initial information of 
p1.JPG"

but not the actual console of "xsct%" line that waits for an input.
It's like when I'm running the process it actually run another process that I can't communicate with it.

Here is the sample code of simple process initiating :

        public void CreateSDKProcess() //TODO:Create SDK Process and IO interface
        {
            Process sdkProcess = new Process();
            StringBuilder stringBuilder = new StringBuilder();

            sdkProcess.StartInfo.UseShellExecute = false;
            sdkProcess.StartInfo.FileName = @"C:\Xilinx\SDK\2016.4\bin\xsct.bat";
            sdkProcess.StartInfo.RedirectStandardOutput = true;
            sdkProcess.StartInfo.RedirectStandardInput = true;
            sdkProcess.StartInfo.CreateNoWindow = true;
            sdkProcess.OutputDataReceived += new DataReceivedEventHandler((sender, e) =>
             {
                 if (!String.IsNullOrEmpty(e.Data))
                 {
                     stringBuilder.Append(e.Data);                 
                 }
             });
            
            sdkProcess.Start();


Is there any way I can integrate XSCT with C#?

Thank you.

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
149 Views
Registered: ‎09-12-2007

Re: Running XSCT (Xilinx Software Command-Line Tool) from C# app

Jump to solution

Is your goal to create an SDK project everytime? If this is for testing then, you shoukd use the HSI to create the projects and debug. The HSI is projectless; meaning it will not create a an eclipse based project that can be opened in the GUI. However, if you dont wantr to have a project that can be opened in the GUI then I would recommend doing everything in HSI.

 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841693/HSI+debugging+and+optimization+techniques

0 Kudos
4 Replies
Moderator
Moderator
191 Views
Registered: ‎10-06-2016

Re: Running XSCT (Xilinx Software Command-Line Tool) from C# app

Jump to solution

Hi @pavelan 

I think you hit the right spot, xsct.bat batch command under the hoods calls to a different process (rdi_xsct) that ultimatelly provides the interactive shell, so I would say that it might not be feasible to implement your approach. Anyway usually the way that XSCT is integrated in a higher level build system (CI tool...) is through using XSCT to run your TCL scripts, so instead of having the interactive CLI it is used to execute your script.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
Visitor pavelan
Visitor
179 Views
Registered: ‎06-10-2019

Re: Running XSCT (Xilinx Software Command-Line Tool) from C# app

Jump to solution

- "xsct.bat batch command under the hoods calls to a different process (rdi_xsct) "

Yes indeed, every time I run xsct.bat it calls an instance of rdi_xsct.
And rdi_xsct in turn calls hw_server and communicate with it trough TCF protocol.
The server even notifies that he expect the communication through 127.0.0.1:3121
If I launch rdi_xsct directly it's complains that there is tcl85.dll is missing.
I can add the tcl85.dll from the XILINX SDK, but I doubt that it's going to work.
I can communicate directly with the server, but there is no API available for direct communication with XILINX implementation of TCF protocol.
Nor any other open source software parser for the communication with hw_server.

Is there any way to run the console in interactive way? Aside from writing a tcl script file for every command I wish to send and run it as argument with a process?

For example, before I start to flash in parallel 4 FPGA modules with 4 JTAGs DCL-10, I would wish to know what JTAG modules actually connected to the PC, so I could assign every each of DCL10's a different file.
In the xsct% console I write "jtag targets", and it's prints me all the JTAGs and their serial number to the xsct% console, that I can choose from.

Write it to tcl file and pass it to xsct.bat process? Where do I get the reply? From the xsct's stdout console itself?

 

0 Kudos
Moderator
Moderator
163 Views
Registered: ‎10-06-2016

Re: Running XSCT (Xilinx Software Command-Line Tool) from C# app

Jump to solution

Hi @pavelan 

If you goal with the interactive console is to controll use the debugger to connect and inspect the target you can use xsdbserver. Basically the server just provides a TCP port where you can send any XSDB command (i.e. targets) and gets back to you with the output string, so the only thing you need is just to parse the serial output.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
Moderator
Moderator
150 Views
Registered: ‎09-12-2007

Re: Running XSCT (Xilinx Software Command-Line Tool) from C# app

Jump to solution

Is your goal to create an SDK project everytime? If this is for testing then, you shoukd use the HSI to create the projects and debug. The HSI is projectless; meaning it will not create a an eclipse based project that can be opened in the GUI. However, if you dont wantr to have a project that can be opened in the GUI then I would recommend doing everything in HSI.

 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841693/HSI+debugging+and+optimization+techniques

0 Kudos