qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] ARM QOM conversion / class hierarchy


From: Michael Roth
Subject: Re: [Qemu-devel] ARM QOM conversion / class hierarchy
Date: Tue, 20 Mar 2012 14:04:11 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Mar 20, 2012 at 04:32:31PM +0000, Peter Maydell wrote:
> On 20 March 2012 16:31, Michael Roth <address@hidden> wrote:
> > Rather than key off an ID you could also just break
> > implementation-specific functionality out into a set of interfaces you
> > implement/override as part of the objects' initialization. Same ends, and
> > still fits the model pretty nicely, assuming the functionality is all
> > derivable from the common base-class.
> 
> I'm not sure what you have in mind here -- could you explain
> in a little more detail, please?

Essentially what Paul suggested, minimal subclassing to encapsulate the
major architectural characteristics of a cpu, but also making use of the fact
that we *do* have multiple inheritance for QOM interfaces to do finer-grained
modeling of specific features. SIMD/NEON/DSP, for instance, could be proper
QOM interfaces that models from multiple families/architectures implement.

Ultimately, as Paul said, it just boils down to implicit subclasses in place of
enumerating features for use by common routines. So..it doesn't buy you
much really, except maybe maintaining devices out of tree. But it's a way to
do what you were suggesting with option #2 while avoiding not being "OO-like",
since it's a more formal way to modify a class' behavior. But maybe that's
a non-issue to begin with.

> 
> thanks
> -- PMM
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]