[meta-xilinx] microblazev8 tune problems
Nathan Rossi
nathan at nathanrossi.com
Sat Apr 29 07:22:23 PDT 2017
On 29 April 2017 at 07:14, Mills, William <wmills at ti.com> wrote:
> Hello,
>
> I have been looking at microblaze as an example of how to add a new architecture to OE-core.
> Right now I am on master for bitbake, oe-core, and meta-xilinx.
>
> I have tried multiple MACHINEs but right now I am working with MACHINE=ml605-qemu-microblazeel
> In this combination and others, I could not get the below code to work.
You mean you couldn't trigger it? or it was causing errors?
>
> At first I thought it was because it used the older syntax but I tried changing w/o luck.
> I then explored switching the 3 git repos to morty (bitbake 1.32) or krogoth (bitbake 1.30) and I could not
> find a winning combination.
>
> As shown below I worked around it by just disabling this python fragment as it is not important to what I am doing.
> (And the existing "tune"'s enable both options anyway).
>
> I would be interested to understand what I was doing wrong anyway.
>
> BTW: The comment above the code does not match what the code does IMHO.
So the code is essentially forcing the enabling of 'pattern-compare'
when using the 'reorder' feature but only for cpu version v8.30. There
is no way to make a tune feature depend on another tune feature
(although they can conflict), so this is the reason for the anonymous
function. There are a number of other ways to handle this, ideally it
should generate an error but its quite hard to make it a sanity error
like TUNECONFLICTS.
Normally with OE you would solve this issue by not providing a TUNE
that has the set of invalid features. However for MicroBlaze there are
quite a few tune features, which would require the definition of an
absurd number of AVAILTUNES (~10 features and ~15 versions, expanding
to >1000 possible tunes). So for MicroBlaze the machine must define
its TUNE_FEATURES by overriding the default
TUNE_FEATURES_tune-microblaze value.
The reason for this oddity is due to a cpu bug (or more technically a
cpu config bug) that existed for the v8.30.a version of MicroBlaze.
The bug was that the hardware (by that I mean the synthesized
microblaze core) relied on the pattern compare resources but never
forced the resources to be generated. If I remember correctly it
affected the bswap instructions. It was later fixed in v8.40+.
Regards,
Nathan
>
> Thanks,
> Bill
>
> diff --git a/conf/machine/include/microblaze/feature-microblaze-v8.inc b/conf/machine/include/microblaze/feature-microblaze-v8.inc
> index 46a11cf..0251439 100644
> --- a/conf/machine/include/microblaze/feature-microblaze-v8.inc
> +++ b/conf/machine/include/microblaze/feature-microblaze-v8.inc
> @@ -16,30 +16,30 @@ MBCCARGSVERSION += "${@bb.utils.contains("TUNE_FEATURES", "v8.20", "-mcpu=v8.20.
> MBPKGVERSION .= "${@bb.utils.contains("TUNE_FEATURES", "v8.20", "-v8.20", "" ,d)}"
>
> TUNEVALID[v8.10] = "Use Microblaze version 8.10"
> MBCCARGSVERSION += "${@bb.utils.contains("TUNE_FEATURES", "v8.10", "-mcpu=v8.10.a", "" ,d)}"
> MBPKGVERSION .= "${@bb.utils.contains("TUNE_FEATURES", "v8.10", "-v8.10", "" ,d)}"
>
> TUNEVALID[v8.00] = "Use Microblaze version 8.00"
> MBCCARGSVERSION += "${@bb.utils.contains("TUNE_FEATURES", "v8.00", "-mcpu=v8.00.a", "" ,d)}"
> MBPKGVERSION .= "${@bb.utils.contains("TUNE_FEATURES", "v8.00", "-v8.00", "" ,d)}"
>
> TUNECONFLICTS[v8.00] += "reorder"
> TUNECONFLICTS[v8.10] += "reorder"
> TUNECONFLICTS[v8.20] += "reorder"
>
> # Perform some additional sanity checking
> -python __anonymous () {
> +python dontdo_this__anonymous () {
> import bb
> tune_features = bb.data.getVar('TUNE_FEATURES', d, 1)
> tuneslist = tune_features.split()
>
> #
> # GCC will fail on v8.30 if reorder and pattern-compare are not
> # both in ccflags
> # -mxl-reorder requires -mxl-pattern-compare for -mcpu=v8.30.a
> # Check if either one exists alone and if so, add the other
> #
> if 'v8.30' in tuneslist:
> if 'reorder' in tuneslist and 'pattern-compare' not in tuneslist:
> d.setVar("TUNE_FEATURES", "%s pattern-compare" % tune_features)
> }
> --
> _______________________________________________
> meta-xilinx mailing list
> meta-xilinx at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-xilinx
More information about the meta-xilinx
mailing list