[Open-graphics] Interfacing a Simulation from C Code
Attila Kinali
attila at kinali.ch
Fri Sep 1 11:56:38 EDT 2006
On Thu, 31 Aug 2006 20:35:38 +0200
Petter Urkedal <petter.urkedal at nordita.dk> wrote:
> On 2006-08-30, Attila Kinali wrote:
> > If i'm not mistaken, pci looks after initialization like a memory
> > region to the CPU. That could be easily simulated with very little
> > code, if memory access could be intercepted.
>
> The Boehm GC way to check dirty bits can be found in os_dep.c in their
> collector (http://www.hpl.hp.com/personal/Hans_Boehm/gc/). Here is a
> relevant comment from the source (it's (C) HP under a liberal license):
Thanks, i will have a look at that.
> Then follow a lot of code for different platforms. Since a simulation
> is not time critical, maybe we could get away with keeping a backup page
> and compare the master to the backup.
IIRC we have 256MB of memory. Keeping 2*256MB in memory and comparing
it in each step would be too slow and to memory consuming.
> > I have to read the pci code in the kernel to say more, but that will
> > take a little time.
>
> I can judge exactly how difficult this is, so let me be careful not to
> steal time. It would be a dream to test any PCI-based design using real
> driver code, but let our immanent need be the priority.
I thought a little bit about it and came to the conclusion that
we should not simulate the pci interface together with the
driver. For one thing it becomes a huge system to simulate
(ok, the graphics core is much larger). And for another
we would need to first translate accesses to oga first into
pci accesses, just to translate them back again. It would
be simpler just to take the raw accesses the driver makes
and translate them into logical accesses to the card directly.
Another advantage would be, that we could plug in the
c model relatively easy instead of the verilog code to
compare whether the card behaves as we designed and have
a faster code to do application level testing of the model.
The PCI interface would then need to be simulated seperately
of course.
Attila Kinali
--
心をこめて聞け心をこめて話せ
More information about the Open-graphics
mailing list