Re: [Gems-users] undefined reference of SIM_* functions


Date: Tue, 10 Oct 2006 08:31:32 -0500
From: Dan Gibson <degibson@xxxxxxxx>
Subject: Re: [Gems-users] undefined reference of SIM_* functions
Mladen,
The asserts are not mandatory. The returns are mandatory, as you might expect, as function definitions must return values according to their declarations to please the compiler.
We use the asserts to ensure that an error is raised if any of the API functions are actually called when the tester is executing. Since the Simics API functionality isn't provided with the tester, we assert(0) whenever an API call is requested within the tester. We have designed Ruby not to use the Simics API when running with the tester (by keeping Simics API calls in the lower levels of the Ruby hierarchy).

Regards,
Dan

Mladen Nikitovic wrote:
Thank you Dan, that did the trick.

I have a small follow up question - what does the assert(0) and return 0;
statements in the dummy function body actually do? Are they mandatory in
order to satisfy the compilation process?

Thanks again for the quick answer.

Regards,
Mladen

-----Original Message-----
From: gems-users-bounces@xxxxxxxxxxx [mailto:gems-users-bounces@xxxxxxxxxxx]
On Behalf Of Dan Gibson
Sent: den 9 oktober 2006 17:03
To: Gems Users
Subject: Re: [Gems-users] undefined reference of SIM_* functions


Mladen,
Part of the Ruby build process is to build the random tester, which 
links against all of ruby's code to form a standalone executable. The 
SIM_ functions are provided by Simics, and are only callable when 
running Ruby as a Simics module. When linked against the tester, we 
provide dummies of these SIM_ API calls in 
$GEMS/ruby/simics/simics_api_dummy.c. Just add a definition for your 
missing functions there, and everything should compile cleanly.

Regards,
Dan

Mladen Nikitovic wrote:
  
Hi,

I'm adding some functionality to GEMS by extending it with a couple of 
attributes. The attributes are registered, but it seems like some of 
the
SIM_* functions are not available (from processor and event API such as
SIM_processor_break and SIM_cycle count), whereas others are (such as
SIM_current_processor). I'm calling the API functions from command.C, but
    
I
  
get this error although I have a include simics/api.h directive, which
should be enough.

simics/commands.C:228: undefined reference to `SIM_processor_break'

Is there something I'm missing or is there something in ruby command.C 
(or ruby Makefile) that prevents it from using these API functions?

Regards,
Mladen

_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx 
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding 
"site:https://lists.cs.wisc.edu/archive/gems-users/" to your search.


  
    
_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding
"site:https://lists.cs.wisc.edu/archive/gems-users/" to your search.



_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/" to your search.


  
[← Prev in Thread] Current Thread [Next in Thread→]