Add support for clock callout resolutions
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I67f02a2fafaa63a0bafaa1116150da35ef4dece1
diff --git a/analyzer/ras-data/data/ras-data-p10-10.json b/analyzer/ras-data/data/ras-data-p10-10.json
index 8bc89bc..e0303ae 100644
--- a/analyzer/ras-data/data/ras-data-p10-10.json
+++ b/analyzer/ras-data/data/ras-data-p10-10.json
@@ -59,11 +59,11 @@
"pau7": [ { "type": "callout_unit", "name": "pau7", "priority": "MED", "guard": true } ],
"rcs_osc_error_0": [
- { "type": "callout_clock", "position": 0, "priority": "HIGH", "guard": true },
+ { "type": "callout_clock", "name": "OSC_REF_CLOCK_0", "priority": "HIGH", "guard": true },
{ "type": "action", "name": "self_L" }
],
"rcs_osc_error_1": [
- { "type": "callout_clock", "position": 1, "priority": "HIGH", "guard": true },
+ { "type": "callout_clock", "name": "OSC_REF_CLOCK_1", "priority": "HIGH", "guard": true },
{ "type": "action", "name": "self_L" }
],
"pll_unlock_0": [
diff --git a/analyzer/ras-data/data/ras-data-p10-20.json b/analyzer/ras-data/data/ras-data-p10-20.json
index 1295ba5..7ae692b 100644
--- a/analyzer/ras-data/data/ras-data-p10-20.json
+++ b/analyzer/ras-data/data/ras-data-p10-20.json
@@ -59,11 +59,11 @@
"pau7": [ { "type": "callout_unit", "name": "pau7", "priority": "MED", "guard": true } ],
"rcs_osc_error_0": [
- { "type": "callout_clock", "position": 0, "priority": "HIGH", "guard": true },
+ { "type": "callout_clock", "name": "OSC_REF_CLOCK_0", "priority": "HIGH", "guard": true },
{ "type": "action", "name": "self_L" }
],
"rcs_osc_error_1": [
- { "type": "callout_clock", "position": 1, "priority": "HIGH", "guard": true },
+ { "type": "callout_clock", "name": "OSC_REF_CLOCK_1", "priority": "HIGH", "guard": true },
{ "type": "action", "name": "self_L" }
],
"pll_unlock_0": [
diff --git a/analyzer/ras-data/ras-data-definition.md b/analyzer/ras-data/ras-data-definition.md
index 6603494..2538230 100644
--- a/analyzer/ras-data/ras-data-definition.md
+++ b/analyzer/ras-data/ras-data-definition.md
@@ -169,10 +169,17 @@
| Keyword | Description |
|----------|-------------------------------------------------------------------|
| type | value (string): `callout_clock` |
-| position | value (integer): 0 or 1 |
+| name | See `clock type` table below. |
| priority | See `priority` table above. |
| guard | See `guard` table above. |
+Supported clock types:
+
+| Clock Type | Description |
+|-----------------|------------------------------------------------------------|
+| OSC_REF_CLOCK_0 | Oscillator reference clock 0 |
+| OSC_REF_CLOCK_1 | Oscillator reference clock 1 |
+
#### 5.1.7) action type `callout_procedure`
This will request to callout a service procedure.
@@ -180,7 +187,7 @@
| Keyword | Description |
|----------|-------------------------------------------------------------------|
| type | value (string): `callout_procedure` |
-| name | The `procedures` table below. |
+| name | See `procedures` table below. |
| priority | See `priority` table above. |
Supported procedures:
@@ -197,7 +204,7 @@
| Keyword | Description |
|----------|-------------------------------------------------------------------|
| type | value (string): `callout_part` |
-| name | The `parts` table below. |
+| name | See `parts` table below. |
| priority | See `priority` table above. |
Supported parts:
diff --git a/analyzer/ras-data/ras-data-parser.cpp b/analyzer/ras-data/ras-data-parser.cpp
index 559a947..d59c289 100644
--- a/analyzer/ras-data/ras-data-parser.cpp
+++ b/analyzer/ras-data/ras-data-parser.cpp
@@ -185,13 +185,20 @@
}
else if ("callout_clock" == type)
{
- auto position = a.at("position").get<unsigned int>();
+ auto name = a.at("name").get<std::string>();
auto priority = a.at("priority").get<std::string>();
auto guard = a.at("guard").get<bool>();
- // TODO
- trace::inf("callout_clock: position=%u priority=%s guard=%c",
- position, priority.c_str(), guard ? 'T' : 'F');
+ // clang-format off
+ static const std::map<std::string, callout::ClockType> m =
+ {
+ {"OSC_REF_CLOCK_0", callout::ClockType::OSC_REF_CLOCK_0},
+ {"OSC_REF_CLOCK_1", callout::ClockType::OSC_REF_CLOCK_1},
+ };
+ // clang-format on
+
+ o_list->push(std::make_shared<ClockCalloutResolution>(
+ m.at(name), getPriority(priority), guard));
}
else if ("callout_procedure" == type)
{
diff --git a/analyzer/ras-data/schema/ras-data-schema-v01.json b/analyzer/ras-data/schema/ras-data-schema-v01.json
index 05f18cc..9ec7150 100644
--- a/analyzer/ras-data/schema/ras-data-schema-v01.json
+++ b/analyzer/ras-data/schema/ras-data-schema-v01.json
@@ -158,13 +158,13 @@
}
},
"then": {
- "required": [ "priority", "guard", "position" ],
- "not": { "required": [ "name" ] },
+ "required": [ "name", "priority", "guard" ],
"properties": {
- "position": {
- "type": "integer",
- "minimum": 0,
- "maximum": 1
+ "name": {
+ "enum": [
+ "OSC_REF_CLOCK_0",
+ "OSC_REF_CLOCK_1"
+ ]
}
}
}