| It probably works now because the size of a logical_address and 
physical_address is 64 bits, hence using them as arguments to printf() 
is probably adding 64 bits into its argument stream. %x only consumes 32 
bits, so when it is used twice it first consumes the lower-half of the 
logical address, then the upper (all-zero) half is consumed by the %x to 
print the "physical address". 
%llx will consume 64.
Its a bit hairy to use printf() for certain combinations of data type 
and format string. 
vararg.h-style coding is some of the most subtle C-code around... hence 
we suggest performing traces in the C++-section of ruby, such as 
SimicsProcessor.C, where it is possible to use cout instead. 
Regards,
Dan
Dave Z. wrote:
 
Thanks for your quick reply, Phil!
I've changed the printf statement in ruby_operate, and everything 
shows up fine. 
Instead of
printf("logical address %x physical address %x\n", mem_trans->s.logical_address, mem_trans->s.physical_address);
I do the following:
printf("logical address %x\n", mem_trans->s.logical_address);
printf("physical address %x\n", mem_trans->s.physical_address);
I don't understand why, but it works.
Dave
----- Original Message ----
From: Philip Garcia <pcgarcia@xxxxxxxx>
To: Gems Users <gems-users@xxxxxxxxxxx>
Sent: Tuesday, January 23, 2007 11:38:48 AM
Subject: Re: [Gems-users] physical_address 0
Are you sure your memory map routine is working properly?  It could be 
an invalid return, but I don't really know that much about mmap under 
solaris.  Does trying to access the ram cause the user app to seg 
fault (regardless of what the read/write does)?  Also, I'm assuming 
the kernel is set to allocate the full 8KB?  Try requesting a full 
8KB, it really doesn't make things better or memory efficient to only 
request 1KB, as the full 8KB is needed and has to be allocated 
somewhere (the kernel can't control permissions on a finer grain than 
the page size).   See if that helps at all, and if not I'd try having 
the kernel driver memmap some memory known to be valid, and/or have it 
try to directly read and write to the i/o memory (such as a specific 
read or write that happens on an mmap call for debugging purposes).
Phil
On Jan 23, 2007, at 11:36 AM, Dave Z. wrote:
 This is under Solaris 10. The machine I'm using is sarek (simics 
2.2.19). s.physical_address is always 0 in ruby_operate, 
SimicsDriver, and SimicsProcessor when trying to access the memory 
mapped area.
The memory address space is 4G in Ruby and Simics. The kernel memory 
I'm allocating is one page (8K), but I'm mmapping only 1K. 
All the accesses to the memory mapped region (no matter what the 
offset is) point to 0. I've asked on the simics forum, but they 
couldn't reproduce the same problem. I don't understand... Thanks for 
your help. 
Dave
----- Original Message ----
From: Philip Garcia <pcgarcia@xxxxxxxx <mailto:pcgarcia@xxxxxxxx>>
To: Gems Users <gems-users@xxxxxxxxxxx <mailto:gems-users@xxxxxxxxxxx>>
Sent: Saturday, January 20, 2007 10:12:07 AM
Subject: Re: [Gems-users] physical_address 0
Is this under solaris or linux?  Also, is this followed by a trap to 
the tlb miss handler?  How big is the memory address space?  
Actually, if the mmap for address 0xfffa000 pointed to 0x0 then 
accessing 0xfffa00a should goto address 0xa.  If this isn't the case, 
something isn't working right (although I've never used the memop 
operator myself.   I'd ask on the simics.net forum if anyone has seen 
this problem, might be some weird simics thing. 
phil
On Jan 20, 2007, at 11:18 AM, Dave Z. wrote:
 Yes, Simics is actually passing Ruby a physical address of 0. I have 
some kernel memory mmap'ed into my application. "ptr" points to the 
mmap'ed memory space, and I know the logical address of ptr. When I 
do ptr[offset] = value or value = ptr[offset], the physical 
addresses for the memory requests are always 0.
Thanks,
Dave
----- Original Message ----
From: Dan Gibson <degibson@xxxxxxxx <mailto:degibson@xxxxxxxx>>
To: Gems Users <gems-users@xxxxxxxxxxx <mailto:gems-users@xxxxxxxxxxx>>
Sent: Friday, January 19, 2007 2:35:14 PM
Subject: Re: [Gems-users] physical_address 0
I thought you were calling SIM_logical_to_physical to determine the 
physical address. Do you mean that Simics is actually passing Ruby a 
physical address of zero? If so, what is the ASI, and what type of 
access (eg store, atomic, etc.) is it? 
Regards,
Dan
Dave Z. wrote:
 
But there is no SIM_logical_to_physical in SimicsProcessor::makeRequest. If I understand correctly, the order of function calls is ruby_operate (ruby.c), _possible_cache_miss (commands.C), makeRequest (SimicsDriver.C), makeRequest (SimicsProcessor.C). The physical address is always 0 for certain logical
 addresses.
Thanks,
Dave
----- Original Message ----
From: Dan Gibson <degibson@xxxxxxxx>
To: Gems Users <gems-users@xxxxxxxxxxx>
Sent: Thursday, January 18, 2007 8:16:58 PM
Subject: Re: [Gems-users] physical_address 0
You might want to check
that SIM_logical_to_physical isn't raising any 
exceptions. Have a look at SIM_last_exception(). 
Regards,
Dan
Dave Z. wrote:
 
Hi,
I have a quick question about mem_trans object in SimicsProcessor::makeRequest. Is it something expected to have mem_trans->s.physical_address=0? I've printed the physical addresses of some logical addresses and they are all 0. Here is what I do:
if
 (mem_trans->s.logical_address == XXX)
   printf("logical address %x physical address %x\n", mem_trans->s.logical_address, mem_trans->s.physical_address);
Thanks,
Dave
____________________________________________________________________________________
Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097
_______________________________________________
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.
____________________________________________________________________________________ 
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 
_______________________________________________
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 <mailto: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/" 
<https://lists.cs.wisc.edu/archive/gems-users/%22>; to your search. 
------------------------------------------------------------------------
Any questions? Get answers on any topic at Yahoo! Answers 
<http://answers.yahoo.com/;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx>. 
Try it now. 
_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx <mailto: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 <mailto: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/" 
<https://lists.cs.wisc.edu/archive/gems-users/%22>; to your search. 
------------------------------------------------------------------------
Get your own web address. 
<http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL>
Have a HUGE year through Yahoo! Small Business. 
<%20http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL> 
_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx <mailto: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/" 
<https://lists.cs.wisc.edu/archive/gems-users/%22>; to your search. 
------------------------------------------------------------------------
Cheap Talk? Check out 
<http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com> 
Yahoo! Messenger's low PC-to-Phone call rates. 
------------------------------------------------------------------------
_______________________________________________
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.
 
--
http://www.cs.wisc.edu/~gibson [esc]:wq!
 |