[Open-graphics] Interfacing a Simulation from C Code
Petter Urkedal
petter.urkedal at nordita.dk
Mon Sep 4 13:06:16 EDT 2006
Attila Kinali wrote:
> 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.
>
Maybe Viktor's idea of hooking into an emulator would be a more
realistic test, and would possibly even be easier to implement. The
emulator would of course be severely slowed down by the hardware
simulation, so this would only supplement the OGD1 for full-system testing.
>
> 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.
>
>
But does testing benefit from shortcuts? If my experience with software
carries over here, I think both unit testing and full-system testing can
expose bugs that either could not reveal by itself. Units tests have
the advantage that they can cover large part of the domain, including
implausible cases. I sometimes run randomised tests overnight, and ever
now and then I hit bugs even after hours of running rather simple code
(like 32 KB). These might not have been found by the large-scale test.
OTOH, a full-system test could reveal misunderstandings about the
interfaces of the individual components. In this case the PCI
controller could produce what is more likely to be realistic signals for
the connected units.
BTW, I consider the HSIP library ready for use after yesterday's commit,
but I'll add some functions to deal with high-impedance signals.
More information about the Open-graphics
mailing list