WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2007-Jun-21 11:44:45

jyhng
Member
Registered: 2007-Jan-25
Posts: 37

Generate Libraries and Drivers

Hi,

In the XPS program, there's a button called Generate Libraries and Drivers, which seems to generate all the files in ppc405_0.  In a project in which I add my own pcore from Sysgen, I find that there is a .h file located under [root dir]/drivers/[my pcore]_opbw/src/[my pcore]_gateways.h.  But XPS places multiple copies of the .h file when I generate the bitstream, in [root dir]/ppc405_0/include, and ppc405_0/libsrc/[my pcore]_opbw/src.  In this case, which .h is the one that will be used by my main .c file, located under [root dir]/src? 

Also, once it is library files are generated once, if i make changes to the .h file under drivers, pushing the Generate Libraries and Drivers will not do anything, as the XPS returns the message "make: Nothing to be done for 'libs'".

Thanks

Offline

 

#2 2007-Jun-21 11:57:50

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: Generate Libraries and Drivers

I believe you should not modify the files in the /ppc405_0 directory. Those are temporary files that are copied there during the Generate Libraries and Drivers step. They are copied from your [XPS project]/drivers/[your driver] directory. If you modify that file and Clean Software (last option in XPS's Software menu), then XPS should recognize the change and copy in the new file to the ppc405 directory for compilation.

Offline

 

#3 2007-Jun-21 12:46:21

jyhng
Member
Registered: 2007-Jan-25
Posts: 37

Re: Generate Libraries and Drivers

In my current project, I have a [Tx].h and [Tx].c under [root dir]drivers/[Tx]_opbw/src, which I added and edit actively.  There is also a [TxMain] .c file under [root dir]/src, but this file doesn't use the .h in drivers/[Tx]_opbw/src, but instead uses one of the other two.  However, when I try to push the Generate Libraries and Drivers button, it doesn't copy and files from drivers/ into ppc405_0/ automatically.  I can delete the files in ppc405_0/ to force it to copy the files, but is there an easier way?  Or should I not use the files under drivers/ but instead use those in ppc405_0/libsrc?

Thanks

Offline

 

#4 2007-Jun-21 13:15:34

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Generate Libraries and Drivers

Chris is right about the ppc405_* directories- you should never edit code there or put code there manually. These folders get wiped clean and repopulated by the tools every time the software project is cleaned and rebuilt.

If you have code in your drivers/Tx_opbw/src that isn't being copied automatically, it's probably a problem with the driver's Makefile. The Makefile created by sysgen2opb only contains a directive to handle header files, since this is all sysgen2opb creates for the driver. If you customize the driver to include both headers and C code, you need to modify the Makefile so the tools know to compile the driver, not just include it. Look at the radio controller's Makefile for an example. Specifically, you'll need to add a section like this to your Makefile:

Code:

OUTS = *.o

libs:
	echo "Compiling radio_controller"
	$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES)
	$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OUTS}
	make clean

Offline

 

Board footer