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: 
Visitor tnm
Visitor
9,750 Views
Registered: ‎02-07-2016

Let Sysgen generate netlist from "headless" command line

Dear community,

 

I am trying to automate the netlist generation of my Simulink model with System Generator blocks using the command line in "headless" mode (Matlab arguments: --nojvm --nodesktop)

 

I am using the xlGenerateButton command in a Matlab script to trig the generation, however I get the following error:

 

WES: Headless System Value is true. Exception will be throuwn
Error using xlGenerateButton>setupWaitBox (line 681)
Java exception occurred:
java.awt.HeadlessException
    at java.awt.GraphicsEnvironment.checkHeadless(Unknown Source)
    at java.awt.Window.<init>(Unknown Source)
    at java.awt.Frame.<init>(Unknown Source)
    at javax.swing.JFrame.<init>(Unknown Source)
    at com.xilinx.sysgen.guitools.xlWaitBox.makeGUI(xlWaitBox.java:665)
    at com.xilinx.sysgen.guitools.xlWaitBox.start(xlWaitBox.java:418)
    at com.xilinx.sysgen.guitools.xlWaitBoxObjectInterface.showGUI(xlWaitBoxObjectInterface.java:102)

Error in xlGenerateButton (line 104)

 

Is there someone who know how to avoid the usage of graphical windows for the netlist generation?

 

In case it matters, I use Matlab R2013b together with ISE 14.7 on a 64 bit Linux kernel.

 

Kind regards Torben

0 Kudos
2 Replies
Observer timor.knudsen
Observer
662 Views
Registered: ‎06-20-2016

Re: Let Sysgen generate netlist from "headless" command line

Hello Torben, I have exactly the same problem, and a similar setup. After running into this problem, I tried to run sysgen with xvfb-run to emulate a display. Unfortunately, MATLAB crashes with a floating point exception, presumably because xvfb returns a monitor refresh rate of 0. Did you find a solution at the time? Thanks!
0 Kudos
Observer timor.knudsen
Observer
624 Views
Registered: ‎06-20-2016

Re: Let Sysgen generate netlist from "headless" command line

Ok, so I found a solution that kind of works.
My previous idea with xvfb is also very valid, but MATLAB crashes as the xrandr refresh rate is returned as 0. This was a known bug in Qt (probably this one https://codereview.qt-project.org/#/c/140411/) and fixed in 2015. Looks like MATLAB ist still using the buggy version.

 

One alternative is to use a vnc server to provide the graphical display required by Xilinx System Generator. I decided for tigervnc, and my script looks like this:

 

#!/bin/bash
vncserver :98 -SecurityType:None -noxstartup -useold
export DISPLAY=:98
sysgen -r "run('script.m')"
ERROR_CODE=$?
vncserver -kill :98
exit $ERROR_CODE

 

This script is integrated in our continous integration process (that's why sysgen error code is stored and forwarded to the caller). It works ok.

 

There obviously is the security issue that any local user can now access the VNC server when running, but it's not a concern in our build environment. Actually this "feature" can be used to debug failed CI runs.

 

Hope this helps others out there...