- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I want to override a few variables (NUMBIGBUFS, MAXBIGPKTS, etc) contained in the ipport.h file of the NicheStack-enabled bsp without actually modifying the file itself. Does SBT give me any tools for doing this? Thanks!Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not that I'm a software person but are those variables or C macros (all caps and their location in an include file makes them look like macros)? C macros look something like this "#define <some macro name> <optionally some macro value>". If those are macros you should be able to overwrite them using the -D flag in the project settings. You can learn more by searching the gcc documentation about the -D flag.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
if that's the definition of C Macros, they are then macros. I tried with -D already but it doesn't seem to work. But perhaps my tcl line was wrong... I did something like: set_setting hal.make.bsp_cflags_defined_symbols -DTSE_MY_SYSTEM,-DMAXBIGPKTS=1000,-DNUMBIGBUFS=250 When doing a printf from main() I still get the old values. Not that I'm a software person too, but should't I first undefine those Macros first? In the description of cflags_defined_symbols it says that the effect is the same with# define... I tried using hal.make.bsp_cflags_undefined_symbols "-u DMAXBIGPKTS", "-u DNUMBIGBUFS" but still not working...- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found a slightly different syntax here: http://www.altera.com/support/kdb/solutions/rd11122009_293.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If by "slightly different" you refer to those the "--set " directive, that would be actually the same but called from a .sh script. When the list of settings is included in a .tcl script the set is not required.
NIOS2_BSP_ARGS="--script settings.tcl hal my_bsp"
Anyways, I figgured out that the syntax for multiple defined symbols is set_setting hal.make.bsp_cflags_defined_symbols "-DTSE_MY_SYSTEM -DNUMBIGBUFS=250 -DMAXBIGPKTS=500"
so parameters between quotes and separated by space not comma.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oops ya, I didn't notice those commas. That's the same syntax that compilers like gcc uses for overwriting C macros.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page