Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12597 Discussions

plz help me with this problem(build C2H project)....

Altera_Forum
Honored Contributor II
1,136 Views

Hi all, 

I'm new here. 

recently,i was trying to test the C2H Compiler. But after i build the target project, i met an error as follows: 

 

 

<----------------------------------------------------------------> 

 

--- Quote Start ---  

 

Compiling hello_world.c... 

../hello_world.c:20:3: warning: no newline at end of file 

<----------------------------------------------------------------> 

The Nios II C2H Compiler is generating accelerator_hello_world_0_sum_elements.v... 

/cygdrive/f/Quartus_11.0/nios2eds/components/altera_avalon_c_hardware_accelerator/c2h-generate/....................... 

Progress: Loading system from fileD:/altera-FPGA/nios2_board_example/nios_ch_test/nios2.sopc... 

Progress: (reading unnamed) 

Progress: (reading nios2) 

Progress: (adding clk [clock_source 11.0]) 

Progress: (parameterizing module clk) 

Progress: (adding cpu_0 [altera_nios2 11.0]) 

Progress: (parameterizing module cpu_0) 

Progress: (adding sdram_0 [altera_avalon_new_sdram_controller 11.0]) 

Progress: (parameterizing module sdram_0) 

Progress: (adding epcs_flash_controller_0 [altera_avalon_epcs_flash_controller 11.0]) 

Progress: (parameterizing module epcs_flash_controller_0) 

Progress: (adding jtag_uart_0 [altera_avalon_jtag_uart 11.0]) 

Progress: (parameterizing module jtag_uart_0) 

......................... 

Info: Reading index F:/Quartus_11.0/quartus/sopc_builder/bin/root_components.ipx 

Info: F:/Quartus_11.0/quartus/sopc_builder/bin/root_components.ipx: Loading now from components.ipx 

Info: Reading index F:/Quartus_11.0/quartus/sopc_builder/bin/ip_component_categories.ipx 

Info: F:/Quartus_11.0/quartus/sopc_builder/bin/ip_component_categories.ipx described 0 plugins, 0 paths, in 0.00 seconds 

Info: F:/Quartus_11.0/quartus/sopc_builder/bin/ip_component_categories.ipx matched 1 files in 0.00 seconds 

Info: Reading index F:/Quartus_11.0/ip/altera/altera_components.ipx 

Info: F:/Quartus_11.0/ip/altera/altera_components.ipx described 441 plugins, 0 paths, in 0.25 seconds 

Progress: Loading component/sls_avalon_usb20hr_hw.tcl 

Info: no sopc package requested, assuming package require -exact sopc 9.0 

Info: F:/Quartus_11.0/ip/**/* matched 358 files in 0.36 seconds 

............. 

<-------------------------------------------------------> 

error: can't create file d:/altera-fpga/nios2_board_example/nios_ch_test/nios2.ptf 

error: system generation failed. 

make: *** [c2h_hdl-t] error 254 

Build completed in 57.671 seconds 

 

--- Quote End ---  

 

<-------------------------------------------------------------> 

 

I don't know how to solve this problem, can u help me? 

 

BTW: some info maybe u need 

<-------------------------------------------------------> 

1. PC OS: XP 

2. Quartus II 11.0 + Nios II IDE 11.0 

3. Build software and generate SOPC Builder System 

4. Use hardware accelerator in place of software implementation. Flush data cahe.... 

<--------------------------------------------------------> 

# include <stdio.h> int sum_elements(int *list, int len) { /*the function which i want to convert from ANSI C to HDL*/ int i; int sum = 0; for(i = 0; i < len; i++) sum += *list++; return sum; } int main() { int ia = {1, 2, 3, 4, 5}; int sum = sum_elements(ia, 5); printf("%d", sum); }  

<-----------------------------------------------------------> 

 

many many thx~~~~~
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
323 Views

can anybody help me?

0 Kudos
Altera_Forum
Honored Contributor II
323 Views

I'm suspecting a file/directory permission problem. The error is saying that it cannot write the system .ptf file to your file system (i.e. it dropped the accelerator into your design but can't save your system before generating it). 

 

It might also be the hyphon (-) in your directory path causing problems. Try turning that into an underscore (_) instead and see if that fixes the problem.
0 Kudos
Altera_Forum
Honored Contributor II
323 Views

 

--- Quote Start ---  

I'm suspecting a file/directory permission problem. The error is saying that it cannot write the system .ptf file to your file system (i.e. it dropped the accelerator into your design but can't save your system before generating it). 

 

It might also be the hyphon (-) in your directory path causing problems. Try turning that into an underscore (_) instead and see if that fixes the problem. 

--- Quote End ---  

 

<--------------------------------------------------------------------> 

thanks for your reply, i have changed my file/directory and there is no hyphon(-)in my directory path..but still failed. It was strange that i met a new error as follows: 

 

 

--- Quote Start ---  

Progress: Loading system from fileD:/c2h/nios.sopc... 

Exception in thread "main" java.lang.NullPointerException 

at com.altera.sopceditor.util.EditorUtils.setQuartusProjectInfo(EditorUtils.java:2089) 

at com.altera.c2h.C2HGenerate.createEnsemble(C2HGenerate.java:138) 

at com.altera.sopceditor.app.EnsembleApp.start(EnsembleApp.java:171) 

at com.altera.c2h.C2HGenerate.main(C2HGenerate.java:79) 

make: *** [c2h_hdl-t] Error 1 

Build completed in 22.344 seconds 

 

--- Quote End ---  

 

<-----------------------------------------------------------------------> 

Meanwhile, i noticed that there is a similar error in  

"Nios II Embedded Design Suite Release Notes and Errata" like this: 

 

--- Quote Start ---  

 

Exception in thread "main" java.lang.OutOfMemoryError: Java  

heap space  

make: *** [c2h_hdl-t] Error 1  

 

--- Quote End ---  

 

 

i faint...it really drives me crazy.....what should i do?:(
0 Kudos
Altera_Forum
Honored Contributor II
323 Views

Try accelerating a really simple function, sometimes the error codes out of C2H are not very helpful. The simpliest function you can accelerate would be something like: 

 

int foo()  

{  

return 1; 

}
0 Kudos
Reply