qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 5/6] scripts/decodetree: Implement named field support


From: Richard Henderson
Subject: Re: [PATCH 5/6] scripts/decodetree: Implement named field support
Date: Tue, 23 May 2023 11:17:52 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 5/23/23 05:04, Peter Maydell wrote:
Implement support for named fields, i.e.  where one field is defined
in terms of another, rather than directly in terms of bits extracted
from the instruction.

The new method referenced_fields() on all the Field classes returns a
list of fields that this field references.  This just passes through,
except for the new NamedField class.

We can then use referenced_fields() to:
  * construct a list of 'dangling references' for a format or
    pattern, which is the fields that the format/pattern uses but
    doesn't define itself
  * do a topological sort, so that we output "field = value"
    assignments in an order that means that we assign a field before
    we reference it in a subsequent assignment
  * check when we output the code for a pattern whether we need to
    fill in the format fields before or after the pattern fields, and
    do other error checking

Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
---
  scripts/decodetree.py | 145 ++++++++++++++++++++++++++++++++++++++++--
  1 file changed, 139 insertions(+), 6 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

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