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!

Showing results for 
Search instead for 
Did you mean: 
Observer umair0722
Registered: ‎04-22-2013

Vivado hls tool not updating the changes in header file


I am new to vivado hls, I am using vivdo 2013.1. I started with a basic example from ug902 pg109-110 section "AXI4 Master Interface". here it is

#include "ap_cint.h"
#include "example.h"

void example (volatile DT *m) {
	// Define the RTL interfaces
	#pragma HLS interface ap_ctrl_none port=return
	#pragma HLS interface ap_bus port=m
	// Define the pcore interface as an AXI4 master
	#pragma HLS resource core=AXI4M variable=m
	DT buff[N], tmp;
	int i, j;
	memcpy(buff, m, N * sizeof(DT));
	for (i = 0, j = N - 1; i < j; i++, j--) {
		tmp = buff[i];
		buff[i] = buff[j];
		buff[j] = tmp;
	memcpy(m, buff, N * sizeof(DT));
/* example_test.c
int main () {
    DT temp[N];
    int i;
    FILE *fp;
    for (i = 0; i < N ; i++ )
        temp[i] = i;
    // Execute the function
    for (i = 0; i < N ; i++ )
        fprintf(fp, "%i : %d\n", i, temp[i]);
        printf("%i : %d\n", i, temp[i]);
    return 0;

The value of N is defined in example.h file which resides in the same directory as this src file. I wrote a simple c code for testing the above function, it fills an array, calls this function and prints the result. Till now everything works fine and i get the desired result.


But when I change the value of N in example.h  it is not updated when i see the result. Interestingly when i hover over N the MACRO EXPANSION shows the new value.

(Project Settings > General > "Parse All Header" Files option is checked)


Can you tell why is the value of N from header file is not updated and how should it be done?





0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
Registered: ‎08-17-2011

Re: Vivado hls tool not updating the changes in header file

Hello Umair,


I think the answer goes along this line..:
I think you're talking about the C-simulation and in this situation the VHLS tool is based on makefiles.

The inputs files for the dependancies are the ones setup in the project - usually that's only the C files, not the header files.
If you modify the header file that changes N, then the c-sim will not see it as the dependancies do not include the header file.


Solutions (solution 1 should be more effiecient):

1- include the header file to your project - notice you will get a warning from the tools but you can ignore it.

2- you can also use the check box option "clean" in the setting window when you start the c-simulation, this doesn't have the same effect but should still qualily work.


I hope this helps.

- Hervé

* New Dedicated Vivado HLS forums* http://forums.xilinx.com/t5/High-Level-Synthesis-HLS/bd-p/hls
* Readme/Guidance* http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

* Please mark the Answer as "Accept as solution" if information provided is helpful.
* Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Observer umair0722
Registered: ‎04-22-2013

Re: Vivado hls tool not updating the changes in header file

Thanks Herve for the reply. Solution 1 did not work for me. The tool did not even gave warning when I added .h file to the sources. Solution 2 did work.


One more thing moving forward. I am exporting an example (your toy example here) design as pcore. I wanted to ask which driver files should be used with this pcore as there are two options

1- solution1/impl/drivers/example_v1_00_a/src ; here are 5 files (i need four of them for standalone development)

2- solution1/impl/pcores/example_v1_00_a/include ; 3 files here


I have integrated this example pcore with my PS using XPS and exported the HW design in SDK.Now, if i am using option 1 I cannot find some required variables eg XPAR_XEXAMPLE_NUM_INSTANCES, XExample_ConfigTable and xx_DEVICE_ID.

Ideally they should be present in xparameters.h ?

can you suggest why they are not generated or how should they be generated/created?



0 Kudos