Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
528 Discussions

FPGA "Getting Started" report broken

ndevenish
New Contributor I
784 Views

I'm trying to follow the FPGA optimization and getting started guides. However, the html report generated by the early-image report appears to be coming out broken.

I'm building the fpga_compile example with the 2021.3.0 tag (e.g. https://github.com/oneapi-src/oneAPI-samples/tree/0494db82e947d7bd6bd681057cd6b33ebd842999/DirectPro... ).

 

The compile runs without a hitch, (cd to folder, mkdir _build && cd _build && cmake .. && make) and the fpga_compile.fpga_emu/ folder gets created - but trying to open the report in a browser (Chrome and Firefox tested) get's some variation of this error in the console:

 

 

report_data.js:8 Uncaught SyntaxError: Unexpected token ';'
jquery-3.5.1.min.js:2 Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined
    at FPGAClockFreqSummary.draw (fpgasummary.js:409)
    at generateTablesHTML (main.js:278)
    at buildFPGAReportMainMenu (main.js:226)
    at HTMLDocument.<anonymous> (main.js:796)
    at e (jquery-3.5.1.min.js:2)
    at t (jquery-3.5.1.min.js:2)

 

 and an empty/broken report page:

ndevenish_0-1629814761307.png

I've tried this on a custom build, installed via the apt- instructions on the getting started, and also running on devcloud. It just appears to be broken. Since this is the very beginning of the FPGA flow (early optimisation feedback), what am I doing wrong?

Labels (1)
0 Kudos
5 Replies
ndevenish
New Contributor I
745 Views

So, I've somewhat "Fixed" the issue; at least I've worked out why it fails.

 

The `reports/lib/report_data.js` file is mis-escaped. To be precise, inside the JSON string contents of source files it has both `\\\3` and `\\\\"` - the former being an invalid escape code (\3) and the latter not being escaped, meaning the JSON parsing sees it as a "string end" (and so the next non-json characters fail).

 

So.... I can fix the report by running:

    ```

    sed -i "" 's/\\\\\\3/\\\\\\\\3/g; s/\\\\\\\\\"/\\\\\\\\\\\"/g' reports/lib/report_data.js

    ```

and then the report loads apparently fine (I haven't continued through the analysis yet, but it loads without errors).

 

I have no idea why I'm apparently the only one who has encountered this issue (and on intel's own devcloud installations!).

AnilErinch_A_Intel
706 Views

Hi NIcholas,

It might have been something to do with the servers which is sending traffic to you or can be related to your browser configurations also.

Good to know the issue is fixed and Thanks for sharing your findings with the community.

Thanks and Regards

Anil


ndevenish
New Contributor I
692 Views

It's definitely not server or browser-configuration related.

It's do to with the early-link report automatically including the source code of every file used by the build in the `fileJSON` variable in `report_data.json`. In fact, specifically, in the machine I'm using it's `/opt/intel/oneapi/compiler/2021.3.0/linux/include/sycl/CL/sycl/detail/os_util.hpp`, which has on line 71:

    static constexpr const char *DirSep = "\\";

Which presumably is "escaped" by converting every \ to \\ and checking that " has a preceeding \.

 

 However -

On devcloud, this section of the report is or much more limited  - only the local directory user-source files (dpc_common.h, fpga_compile.cpp, and tbb.h) appear to be included, whereas it looks like all intel system headers are also pulled in on the separate installation.

Is it possible this was turned off on the devcloud deployment? Some environment setting that makes it ignore "system" files? Some local misconfiguration that means it can't tell that the intel SYCL libraries are missing? It's the same version (2021.3) as devcloud.

 

In addition - adding the above line - including the text `"\\"` to fpga_compile.cpp - replicates the problem, because the bad escaping is applied to a file that is included in the devcloud report. So the report generations handling of escape characters is definitely broken. 

ndevenish
New Contributor I
692 Views

In fact, to demonstrate this bug running on the devcloud:

$ echo 'static constexpr const char *DirSep = "\\";' > test.cpp
$ dpcpp -fintelfpga -Xshardware test.cpp  -fsycl-link=early
WARNING: No kernels specified.
$ grep '\\\\"' test.prj/reports/lib/report_data.js
var fileJSON=[{"path":"/home/u78814/tmp/test.cpp", "name":"test.cpp", "has_active_debug_locs":false, "absName":"/home/u78814/tmp/test.cpp", "content":"static constexpr const char *DirSep = \"\\\\";\u000A"}];

Exactly replicates the issue standalone - the line in report_data.js is invalid javascript, because the doublequote in the file is escaped wrongly. This is an actual bug in dpcpp (or aoc, not sure where one ends and one begins)

AnilErinch_A_Intel
588 Views

Hi Nicholas,

Thanks for the detailed analysis on the issue.

The issue has been highlighted and will get back to you soon with the fix or feedback.

Thanks and Regards

Anil


Reply