This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Re: Conditional CDL
On Mon, 2003-03-24 at 09:46, Bart Veer wrote:
> >>>>> "Gary" == Gary Thomas <gary at mlbassoc dot com> writes:
>
> Gary> I want to add a new platform which is just a tiny bit
> Gary> different from an existing one.
>
> So you are trying to support both platforms with a single platform HAL
> package?
>
Yes. The platforms only differ by the processor which is installed,
and thanks to the wisdom of Motorola, that implies a slightly different
set of peripherals :-(
> Gary> The problem I'm facing is that (this is in the PowerPC HAL)
> Gary> we use CDL interfaces to indicate some properties about
> Gary> platforms to the various variant and architectural layers.
> Gary> In this case, the two platforms expose different interfaces,
> Gary> but that's really the only difference.
>
> Gary> Concrete info:
> Gary> platform A:
> Gary> implements property_X
> Gary> implements property_Y
>
> Gary> platform B:
> Gary> implements property_Z
> Gary> implements property_Y
>
> Gary> The only way I know to do this would be to have a phony
> Gary> cdl_component which has mututally exclusive cdl_options
> Gary> nested within. I don't see any way to make the "implements"
> Gary> statement conditional (at the statement level, only at the
> Gary> component/option level).
>
> Gary> Similarly, there are the set of "define proc" statements
> Gary> which pass information to RedBoot (like the platform name).
> Gary> I'd like these to be conditional as well.
>
> Gary> Any good ideas on how I can do this (cleanly)?
>
> "implements" properties belong to a node in the hierarchy, so you will
> need separate options for the two platforms. Something like:
>
> cdl_option platform_A {
> default_value 0
> implements property_X
> implements property_Y
> requires !platform_B
> define_proc {
> ...
> }
> }
>
> cdl_option platform_B {
> default_value 0
> implements property_Z
> implements property_Y
> requires !platform_A
> define_proc {
> ...
> }
> }
>
> Then have two target entries in ecos.db with appropriate "enable"
> lines. Probably one additional line in the platform HAL package:
>
> cdl_package <whatever> {
> requires platform_A | platform_B
> }
>
> just to make sure that the user does not disable both platforms. There
> is no need for a dummy component, these two options could go directly
> below the package.
>
This is about what I thought. I recall having trouble before with
having the define_proc nested, but I'll try it again and see how it
goes.
> I think that is the cleanest that can be achieved at the moment. I
> have thought about an enhanced version of implements, of the form:
>
> implements_if <expr> <interface>
>
> but I am not sure this would be sufficiently useful generally, and
> there would be some problems parsing the property.
>
I'm not sure how useful this would be in general (outside this case).
> For the 2.1 timeframe I would like to extend CDL with cdl_target nodes
> which behave largely like options, i.e. they can have requires
> properties and the like, but which are also recognised by the admin
> tool and result in appropriate entries in a generated ecos.db.
One thing I've yearned for would be an easier way to conditionalize
the define_proc statements. For example, I'd like a way to express
the platform clock speed (selected by other CDL) in the lines that
are used by RedBoot, so you could get a platform description like
PowerPC 850 (48MHz)
or the like. Is there any good way to do this?
Thanks for your time.
--
------------------------------------------------------------
Gary Thomas |
MLB Associates | Consulting for the
+1 (970) 229-1963 | Embedded world
http://www.mlbassoc.com/ |
email: <gary at mlbassoc dot com> |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------