blob: b27da595ffa03c712780f01e45ab59bbcdc85e2d [file]
<!-- Copyright (c) 2010-2026 Arm Limited or its affiliates. All rights reserved. -->
<!-- This document is Non-confidential and licensed under the BSD 3-clause license. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!--FAVICON.ico-->
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-TileImage" content="../img/mstile-144x144.png">
<link rel="icon" href="../img/favicon.ico">
<title>Traits.HasCondition - ARM Machine Readable Schema - 2.8</title>
<!--CSS-->
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/schema.css">
<link rel="stylesheet" type="text/css" href="../css/hljs-github.css">
</head>
<body>
<div class="container">
<div class="row heading">
<div class="col-md-6 pull-left"><a href="../index.html"><img src="../img/arm.svg" class="logo" /></a></div>
<div class="col-md-6 pull-left"><h1>AARCHMRS Schema <small>2.8</small></h1></div>
<!--Show the home button-->
<a href="../index.html"><div class="back-to-home">&nlarr; Home</div></a>
</div>
</div>
<div class="container">
<div class="row">
<h2>
<span class="title-namespace">Traits.</span><span class=" title-type">HasCondition</span>
<!-- if oneOf is set, then type is ignored -->
<span class="type">*</span>
</h2>
<div class="static-markdown"><p><code>HasCondition</code> provides an abstract definition for schemata that provide model conditionality.</p></div>
</div>
<!-- definitions -->
<div class="row">
<h3><span class="type Xof">definition</span></h3>
<table class="table table-hover definitions">
<thead>
<tr>
<th class="col-md-4">Definitions</th>
<th class="col-md-4">Type</th>
<th class="col-md-4">Description</th>
</tr>
</thead>
<tbody>
<tr id="/definitions/condition" class="property">
<th class="col-md-4">
<a href="#/definitions/condition">condition</a>
</th>
<td class="col-md-4">
<a href="../AST/BinaryOp_schema.html#/definitions/expression" class="schema_link">AST.BinaryOp</a>
</td>
<td class="col-md-4">
<div><p>Defines a condition under which the model is present.</p></div>
<div>
See
<a href="../AST/BinaryOp_schema.html#/definitions/expression" class="schema_link">definitions.expression</a> in
<a href="../AST/BinaryOp_schema.html#/definitions/expression" class="schema_link">AST.BinaryOp</a>
for more information.
</div>
<div>
<b>Default</b>
<pre class="schema-json"><code class="language-json">{
&#34;_type&#34;: &#34;AST.Bool&#34;,
&#34;value&#34;: true
}</code></pre>
</div>
<h5>Examples</h5>
<div>
<pre class="schema-json"><code class="language-json">{
&#34;_type&#34;: &#34;AST.BinaryOp&#34;,
&#34;left&#34;: {
&#34;_type&#34;: &#34;AST.Function&#34;,
&#34;arguments&#34;: [
{
&#34;_type&#34;: &#34;AST.Identifier&#34;,
&#34;value&#34;: &#34;FEAT_FOO&#34;
}
],
&#34;name&#34;: &#34;IsFeatureImplemented&#34;
},
&#34;op&#34;: &#34;&amp;&amp;&#34;,
&#34;right&#34;: {
&#34;_type&#34;: &#34;AST.BinaryOp&#34;,
&#34;left&#34;: {
&#34;_type&#34;: &#34;AST.BinaryOp&#34;,
&#34;left&#34;: {
&#34;_type&#34;: &#34;AST.DotAtom&#34;,
&#34;values&#34;: [
{
&#34;_type&#34;: &#34;AST.Identifier&#34;,
&#34;value&#34;: &#34;REG&#34;
},
{
&#34;_type&#34;: &#34;AST.Identifier&#34;,
&#34;value&#34;: &#34;F1&#34;
}
]
},
&#34;op&#34;: &#34;==&#34;,
&#34;right&#34;: {
&#34;_type&#34;: &#34;Values.Value&#34;,
&#34;meaning&#34;: null,
&#34;value&#34;: &#34;&#39;0&#39;&#34;
}
},
&#34;op&#34;: &#34;||&#34;,
&#34;right&#34;: {
&#34;_type&#34;: &#34;AST.BinaryOp&#34;,
&#34;left&#34;: {
&#34;_type&#34;: &#34;AST.DotAtom&#34;,
&#34;values&#34;: [
{
&#34;_type&#34;: &#34;AST.Identifier&#34;,
&#34;value&#34;: &#34;REG&#34;
},
{
&#34;_type&#34;: &#34;AST.Identifier&#34;,
&#34;value&#34;: &#34;F2&#34;
}
]
},
&#34;op&#34;: &#34;==&#34;,
&#34;right&#34;: {
&#34;_type&#34;: &#34;Values.Value&#34;,
&#34;meaning&#34;: null,
&#34;value&#34;: &#34;&#39;0&#39;&#34;
}
}
}
}</code></pre>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<div>
</div>
</div>
<div class="row schema">
<h3>Schema <small><a href="http://json-schema.org/draft-04/schema#">http://json-schema.org/draft-04/schema#</a></small></h3>
<pre class="schema-json"><code class="language-json">{
"info": [
"`HasCondition` provides an abstract definition for schemata that provide model conditionality."
],
"definitions": {
"condition": {
"info": [
"Defines a condition under which the model is present."
],
"default": {
"_type": "AST.Bool",
"value": true
},
"examples": [
{
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.Function",
"arguments": [
{
"_type": "AST.Identifier",
"value": "FEAT_FOO"
}
],
"name": "IsFeatureImplemented"
},
"op": "&&",
"right": {
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.DotAtom",
"values": [
{
"_type": "AST.Identifier",
"value": "REG"
},
{
"_type": "AST.Identifier",
"value": "F1"
}
]
},
"op": "==",
"right": {
"_type": "Values.Value",
"meaning": null,
"value": "'0'"
}
},
"op": "||",
"right": {
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.DotAtom",
"values": [
{
"_type": "AST.Identifier",
"value": "REG"
},
{
"_type": "AST.Identifier",
"value": "F2"
}
]
},
"op": "==",
"right": {
"_type": "Values.Value",
"meaning": null,
"value": "'0'"
}
}
}
}
],
"$ref": "../AST/BinaryOp.json#/definitions/expression"
}
},
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Traits.HasCondition"
}</code></pre>
</div>
</div>
<div class="container">
<div class="footer text-right">
Copyright &copy; 2025 ARM Limited or its affiliates. All rights reserved.
</div>
</div>
<script src="../js/highlight/highlight.js"></script>
<script src="../js/highlight/languages/json.min.js"></script>
<script src="../js/highlight/languages/django.min.js"></script> <!-- JINJA2 -->
<script src="../js/highlight/languages/yaml.min.js"></script>
<script src="../js/highlight/languages/isa.js"></script>
<script type="text/javascript">
window.onload = function() {
hljs.configure({
cssSelector: ".schema-json code, .includes code, pre code",
noHighlightRe: /^(no-?highlight|nohl)$/i,
});
hljs.highlightAll()
};
</script>
</body>
</html>