plcopen 0.22.0
载入中...
搜索中...
未找到
tasking.h
浏览该文件的文档.
1#pragma once
2
3#include <algorithm>
4#include <cstddef>
5#include <cstdint>
6#include <limits>
7#include <string>
8#include <string_view>
9#include <utility>
10#include <vector>
11
12#include "st/diag.h"
13#include "st/lexer.h"
14
15namespace plcopen::core::st
16{
17
18enum class TaskKind : std::uint8_t
19{
22};
23
25{
26 std::string name;
27 std::string lower;
28 std::string task;
29 std::string program;
30 std::uint16_t declaration_order = 0;
31 std::uint32_t source_offset = 0;
32};
33
35{
36 std::string name;
37 std::string lower;
39 std::string event;
40 std::uint64_t interval_ticks = 0;
41 std::uint64_t phase_ticks = 0;
42 std::int32_t priority = 0;
43 std::int64_t instruction_budget = 0;
44 std::uint16_t declaration_order = 0;
45 std::uint32_t source_offset = 0;
46 std::vector<std::uint16_t> mappings;
47};
48
50{
51 std::string name;
52 std::string lower;
53 std::string target;
54 std::uint32_t source_offset = 0;
55 std::vector<TaskInfo> tasks;
56 std::vector<ProgramMappingInfo> mappings;
57};
58
60{
61 std::string name;
62 std::string lower;
63 std::uint64_t base_tick_ns = 1000000;
64 std::uint32_t source_offset = 0;
65 std::vector<ResourceInfo> resources;
66};
67
69{
70 std::uint16_t resources = 0;
71 std::uint32_t tasks = 0;
72 std::uint32_t program_mappings = 0;
74 std::uint64_t image_copy_bytes = 0;
75 std::uint64_t required_runtime_bytes = 0;
76};
77
79{
80 const char *resource = nullptr;
81 const char *event = nullptr;
82 bool level = false;
83};
84
85enum class TaskState : std::uint8_t
86{
87 idle = 0,
91};
92
100
101inline constexpr std::uint32_t invalid_artifact_index =
102 std::numeric_limits<std::uint32_t>::max();
103
104enum class TaskFaultElementKind : std::uint8_t
105{
106 none = 0,
109};
110
112{
115 std::uint64_t release_count = 0;
116 std::uint64_t completed_count = 0;
117 std::uint64_t missed_release_count = 0;
118 std::uint64_t fault_count = 0;
119 std::int64_t remaining_budget = 0;
120 // Stable indices into the immutable Program artifact. Names are resolved
121 // from that artifact and therefore cannot be truncated in cycle storage.
127 std::uint32_t fault_instruction = 0;
128};
129
130enum class ResourceFault : std::uint8_t
131{
132 none = 0,
134};
135
142
143// These records are the common load-storage ABI used by tasking_report() and
144// ConfigurationRuntime. They contain no owning or dynamically-sized fields.
146{
148 std::uint64_t release_tick = 0;
149 std::uint64_t eligible_tick = 0;
150 std::uint16_t mapping_cursor = 0;
151 bool transaction_active = false;
152 bool last_event_level = false;
154 bool pending_reset = false;
155 bool pending_restart = false;
156};
157
164
166{
167
168inline char lower_ascii(char value)
169{
170 return value >= 'A' && value <= 'Z'
171 ? static_cast<char>(value - 'A' + 'a')
172 : value;
173}
174
175inline std::string lower_copy(std::string_view value)
176{
177 std::string result(value);
178 for(char &c : result) c = lower_ascii(c);
179 return result;
180}
181
182inline bool same_name(std::string_view lower, const char *value)
183{
184 if(value == nullptr || lower.empty()) return false;
185 std::size_t at = 0;
186 while(at < lower.size() && value[at] != '\0' &&
187 lower[at] == lower_ascii(value[at])) ++at;
188 return at == lower.size() && value[at] == '\0';
189}
190
191inline bool token_is(const Token &token, std::string_view lower)
192{
193 return !token.text.empty() && detail::ascii_iequals(token.text, lower);
194}
195
196inline std::size_t token_offset(std::string_view source, const Token &token)
197{
198 if(token.text.empty()) return source.size();
199 const char *begin = source.data();
200 const char *data = token.text.data();
201 return data >= begin && data <= begin + source.size()
202 ? static_cast<std::size_t>(data - begin)
203 : source.size();
204}
205
206inline bool source_contains_token(std::string_view source,
207 std::string_view lower)
208{
209 Lexer lexer(source);
210 for(Token token = lexer.next(); token.kind != TokenKind::end_of_input;
211 token = lexer.next()) {
212 if(token_is(token, lower)) return true;
213 }
214 return false;
215}
216
217inline bool source_contains_call(std::string_view source,
218 std::string_view lower,
219 std::size_t &offset)
220{
221 Lexer lexer(source);
222 for(Token token = lexer.next(); token.kind != TokenKind::end_of_input;
223 token = lexer.next()) {
224 if(!token_is(token, lower)) continue;
225 const Token next = lexer.next();
226 if(next.kind != TokenKind::lparen) continue;
227 offset = token_offset(source, token);
228 return true;
229 }
230 return false;
231}
232
233inline bool has_program_declaration(std::string_view source)
234{
235 Lexer lexer(source);
236 bool in_configuration = false;
237 for(Token token = lexer.next(); token.kind != TokenKind::end_of_input;
238 token = lexer.next()) {
239 if(token_is(token, "configuration")) {
240 in_configuration = true;
241 } else if(token_is(token, "end_configuration")) {
242 in_configuration = false;
243 } else if(!in_configuration && token.kind == TokenKind::kw_program) {
244 return true;
245 }
246 }
247 return false;
248}
249
250inline std::string mask_configuration_blocks(std::string_view source)
251{
252 std::string masked(source);
253 Lexer lexer(source);
254 bool in_configuration = false;
255 std::size_t begin = source.size();
256 for(Token token = lexer.next(); token.kind != TokenKind::end_of_input;
257 token = lexer.next()) {
258 if(!in_configuration && token_is(token, "configuration")) {
259 in_configuration = true;
260 begin = token_offset(source, token);
261 } else if(in_configuration && token_is(token, "end_configuration")) {
262 const std::size_t end = token_offset(source, token) +
263 token.text.size();
264 for(std::size_t at = begin; at < end; ++at)
265 if(masked[at] != '\n' && masked[at] != '\r') masked[at] = ' ';
266 in_configuration = false;
267 }
268 }
269 if(in_configuration) {
270 for(std::size_t at = begin; at < masked.size(); ++at)
271 if(masked[at] != '\n' && masked[at] != '\r') masked[at] = ' ';
272 }
273 return masked;
274}
275
277{
278 std::uint64_t base_tick_ns = 1000000;
279 std::uint16_t max_configurations = 16;
280 std::uint16_t max_resources = 16;
281 std::uint16_t max_tasks = 64;
282 std::uint16_t max_program_mappings = 64;
283 std::uint16_t max_diagnostics = 256;
284};
285
287{
288public:
289 DiagnosticSink(std::vector<Diagnostic> &diagnostics,
290 std::size_t capacity)
291 : diagnostics_(diagnostics), capacity_(capacity)
292 {
293 }
294
295 void add(DiagCode code, const Token &token)
296 {
297 if(capacity_ == 0) return;
298 if(diagnostics_.size() >= capacity_) {
299 Diagnostic &last = diagnostics_.back();
300 last.line = token.line;
301 last.column = token.column;
303 last.message = to_string(last.code);
304 return;
305 }
306 Diagnostic diagnostic;
307 diagnostic.line = token.line;
308 diagnostic.column = token.column;
309 diagnostic.code = code;
310 diagnostic.message = to_string(code);
311 diagnostics_.push_back(std::move(diagnostic));
312 }
313
314private:
315 std::vector<Diagnostic> &diagnostics_;
316 std::size_t capacity_;
317};
318
319inline Token source_token(std::string_view source, std::size_t offset)
320{
321 Token token;
322 token.line = 1;
323 token.column = 1;
324 const std::size_t limit = std::min(offset, source.size());
325 for(std::size_t at = 0; at < limit; ++at) {
326 if(source[at] == '\n') {
327 ++token.line;
328 token.column = 1;
329 } else {
330 ++token.column;
331 }
332 }
333 return token;
334}
335
336inline void add_diagnostic(std::vector<Diagnostic> &diagnostics,
337 std::size_t capacity, DiagCode code,
338 std::string_view source, std::size_t offset)
339{
340 DiagnosticSink sink(diagnostics, capacity);
341 sink.add(code, source_token(source, offset));
342}
343
345{
346public:
347 explicit TokenCursor(std::string_view source)
348 : source_(source), lexer_(source), current_(lexer_.next())
349 {
350 }
351
352 const Token &current() const noexcept { return current_; }
353 bool at_end() const noexcept
354 {
355 return current_.kind == TokenKind::end_of_input;
356 }
357 bool at(std::string_view lower) const
358 {
359 return token_is(current_, lower);
360 }
361 std::size_t offset() const { return token_offset(source_, current_); }
362 void bump() { current_ = lexer_.next(); }
363
364private:
365 std::string_view source_;
366 Lexer lexer_;
367 Token current_;
368};
369
370inline bool identifier(const Token &token)
371{
372 return token.kind == TokenKind::identifier;
373}
374
375inline bool duplicate_name(const std::string &lower,
376 const std::vector<TaskInfo> &values)
377{
378 for(const TaskInfo &value : values)
379 if(value.lower == lower) return true;
380 return false;
381}
382
383inline bool duplicate_name(const std::string &lower,
384 const std::vector<ResourceInfo> &values)
385{
386 for(const ResourceInfo &value : values)
387 if(value.lower == lower) return true;
388 return false;
389}
390
391inline bool duplicate_name(const std::string &lower,
392 const std::vector<ProgramMappingInfo> &values)
393{
394 for(const ProgramMappingInfo &value : values)
395 if(value.lower == lower) return true;
396 return false;
397}
398
399inline int find_task(const ResourceInfo &resource, std::string_view lower)
400{
401 for(std::size_t index = 0; index < resource.tasks.size(); ++index)
402 if(resource.tasks[index].lower == lower)
403 return static_cast<int>(index);
404 return -1;
405}
406
407inline bool expect(TokenCursor &cursor, std::string_view word,
408 DiagnosticSink &sink)
409{
410 if(cursor.at(word)) {
411 cursor.bump();
412 return true;
413 }
415 return false;
416}
417
418inline bool read_name(TokenCursor &cursor, std::string &name,
419 DiagnosticSink &sink)
420{
421 if(!identifier(cursor.current())) {
423 return false;
424 }
425 name.assign(cursor.current().text);
426 cursor.bump();
427 return true;
428}
429
430inline bool read_signed_integer(TokenCursor &cursor, std::int64_t &value)
431{
432 bool negative = false;
433 if(cursor.current().kind == TokenKind::minus ||
434 cursor.current().kind == TokenKind::plus) {
435 negative = cursor.current().kind == TokenKind::minus;
436 cursor.bump();
437 }
438 if(cursor.current().kind != TokenKind::int_literal ||
439 cursor.current().based ||
440 cursor.current().unsigned_value >
441 static_cast<std::uint64_t>(std::numeric_limits<std::int64_t>::max())) {
442 return false;
443 }
444 value = static_cast<std::int64_t>(cursor.current().unsigned_value);
445 if(negative) value = -value;
446 cursor.bump();
447 return true;
448}
449
450inline bool parse_task(TokenCursor &cursor, std::string_view source,
451 const ParseLimits &limits, ResourceInfo &resource,
452 DiagnosticSink &sink)
453{
454 const Token start = cursor.current();
455 cursor.bump();
457 task.source_offset = static_cast<std::uint32_t>(token_offset(source, start));
458 bool ok = read_name(cursor, task.name, sink);
459 task.lower = lower_copy(task.name);
460 if(!task.lower.empty() && duplicate_name(task.lower, resource.tasks)) {
462 ok = false;
463 }
464 if(!expect(cursor, "(", sink)) return false;
465
466 enum : unsigned
467 {
468 interval_bit = 1U << 0,
469 phase_bit = 1U << 1,
470 event_bit = 1U << 2,
471 priority_bit = 1U << 3,
472 budget_bit = 1U << 4,
473 };
474 unsigned seen = 0;
475 std::int64_t interval_ns = 0;
476 std::int64_t phase_ns = 0;
477 bool have_interval = false;
478 bool have_phase = false;
479 bool have_event = false;
480 bool have_priority = false;
481 bool have_budget = false;
482
483 while(!cursor.at_end() && !cursor.at(")")) {
484 const Token key_token = cursor.current();
485 if(!identifier(key_token)) {
486 sink.add(DiagCode::parse_expected_token, key_token);
487 ok = false;
488 cursor.bump();
489 continue;
490 }
491 const std::string key = lower_copy(key_token.text);
492 cursor.bump();
493 if(!expect(cursor, ":=", sink)) return false;
494 unsigned bit = 0;
495 if(key == "interval") bit = interval_bit;
496 else if(key == "phase") bit = phase_bit;
497 else if(key == "event") bit = event_bit;
498 else if(key == "priority") bit = priority_bit;
499 else if(key == "budget") bit = budget_bit;
500 else {
501 sink.add(DiagCode::sema_invalid_argument, key_token);
502 ok = false;
503 }
504 if(bit != 0 && (seen & bit) != 0) {
505 sink.add(DiagCode::sema_duplicate_argument, key_token);
506 ok = false;
507 }
508 seen |= bit;
509
510 if(bit == interval_bit || bit == phase_bit) {
511 if(cursor.current().kind != TokenKind::time_literal) {
513 ok = false;
514 cursor.bump();
515 } else {
516 if(bit == interval_bit) {
517 interval_ns = cursor.current().signed_value;
518 have_interval = true;
519 } else {
520 phase_ns = cursor.current().signed_value;
521 have_phase = true;
522 }
523 cursor.bump();
524 }
525 } else if(bit == event_bit) {
526 std::string event;
527 if(read_name(cursor, event, sink)) {
528 task.event = lower_copy(event);
529 have_event = true;
530 } else {
531 ok = false;
532 }
533 } else if(bit == priority_bit || bit == budget_bit) {
534 std::int64_t parsed = 0;
535 if(!read_signed_integer(cursor, parsed)) {
537 ok = false;
538 if(!cursor.at_end()) cursor.bump();
539 } else if(bit == priority_bit) {
540 have_priority = true;
541 if(parsed < 0 || parsed > std::numeric_limits<std::int32_t>::max())
542 task.priority = -1;
543 else
544 task.priority = static_cast<std::int32_t>(parsed);
545 } else {
546 have_budget = parsed > 0;
547 task.instruction_budget = parsed;
548 }
549 } else {
550 if(!cursor.at_end()) cursor.bump();
551 }
552
553 if(cursor.at(",")) {
554 cursor.bump();
555 if(cursor.at(")")) {
557 ok = false;
558 }
559 } else if(!cursor.at(")")) {
561 ok = false;
562 while(!cursor.at_end() && !cursor.at(",") && !cursor.at(")"))
563 cursor.bump();
564 if(cursor.at(",")) cursor.bump();
565 }
566 }
567 if(!expect(cursor, ")", sink) || !expect(cursor, ";", sink)) return false;
568
569 if(have_interval == have_event ||
570 (have_interval &&
571 (interval_ns <= 0 || limits.base_tick_ns == 0 ||
572 static_cast<std::uint64_t>(interval_ns) % limits.base_tick_ns != 0))) {
574 ok = false;
575 }
576 if(have_interval) {
578 if(interval_ns > 0 && limits.base_tick_ns != 0)
579 task.interval_ticks =
580 static_cast<std::uint64_t>(interval_ns) / limits.base_tick_ns;
581 if(!have_phase) phase_ns = 0;
582 if(phase_ns < 0 || interval_ns <= 0 || phase_ns >= interval_ns ||
583 limits.base_tick_ns == 0 ||
584 static_cast<std::uint64_t>(phase_ns) % limits.base_tick_ns != 0) {
586 ok = false;
587 } else {
588 task.phase_ticks =
589 static_cast<std::uint64_t>(phase_ns) / limits.base_tick_ns;
590 }
591 } else if(have_event) {
592 task.kind = TaskKind::event;
593 if(have_phase) {
595 ok = false;
596 }
597 }
598 if(!have_priority || task.priority < 0) {
600 ok = false;
601 }
602 if(!have_budget) {
604 ok = false;
605 }
606 if(resource.tasks.size() >= limits.max_tasks) {
607 sink.add(DiagCode::capacity_tasks, start);
608 return false;
609 }
610 task.declaration_order =
611 static_cast<std::uint16_t>(resource.tasks.size());
612 resource.tasks.push_back(std::move(task));
613 return ok;
614}
615
616inline bool parse_mapping(TokenCursor &cursor, std::string_view source,
617 const ParseLimits &limits, ResourceInfo &resource,
618 DiagnosticSink &sink)
619{
620 const Token start = cursor.current();
621 cursor.bump();
622 ProgramMappingInfo mapping;
623 mapping.source_offset =
624 static_cast<std::uint32_t>(token_offset(source, start));
625 bool ok = read_name(cursor, mapping.name, sink);
626 mapping.lower = lower_copy(mapping.name);
627 if(!mapping.lower.empty() &&
628 duplicate_name(mapping.lower, resource.mappings)) {
630 ok = false;
631 }
632 if(!expect(cursor, "with", sink)) return false;
633 std::string task;
634 ok = read_name(cursor, task, sink) && ok;
635 mapping.task = lower_copy(task);
636 if(!expect(cursor, ":", sink)) return false;
637 std::string program;
638 ok = read_name(cursor, program, sink) && ok;
639 mapping.program = lower_copy(program);
640 if(!expect(cursor, ";", sink)) return false;
641
642 const std::size_t maximum =
643 static_cast<std::size_t>(limits.max_tasks) *
645 if(resource.mappings.size() >= maximum ||
646 resource.mappings.size() >=
647 std::numeric_limits<std::uint16_t>::max()) {
649 return false;
650 }
651 const int task_index = find_task(resource, mapping.task);
652 if(task_index < 0) {
654 ok = false;
655 } else if(resource.tasks[static_cast<std::size_t>(task_index)]
656 .mappings.size() >= limits.max_program_mappings) {
658 return false;
659 }
660 mapping.declaration_order =
661 static_cast<std::uint16_t>(resource.mappings.size());
662 resource.mappings.push_back(std::move(mapping));
663 if(task_index >= 0) {
664 resource.tasks[static_cast<std::size_t>(task_index)]
665 .mappings.push_back(static_cast<std::uint16_t>(
666 resource.mappings.size() - 1));
667 }
668 return ok;
669}
670
671inline bool parse_resource(TokenCursor &cursor, std::string_view source,
672 const ParseLimits &limits,
673 ConfigurationInfo &configuration,
674 DiagnosticSink &sink)
675{
676 const Token start = cursor.current();
677 cursor.bump();
678 ResourceInfo resource;
679 resource.source_offset =
680 static_cast<std::uint32_t>(token_offset(source, start));
681 bool ok = read_name(cursor, resource.name, sink);
682 resource.lower = lower_copy(resource.name);
683 if(!resource.lower.empty() &&
684 duplicate_name(resource.lower, configuration.resources)) {
686 ok = false;
687 }
688 if(!expect(cursor, "on", sink)) return false;
689 ok = read_name(cursor, resource.target, sink) && ok;
690
691 while(!cursor.at_end() && !cursor.at("end_resource")) {
692 if(cursor.at("task")) {
693 ok = parse_task(cursor, source, limits, resource, sink) && ok;
694 } else if(cursor.current().kind == TokenKind::kw_program) {
695 ok = parse_mapping(cursor, source, limits, resource, sink) && ok;
696 } else {
697 sink.add(cursor.current().kind == TokenKind::error
698 ? static_cast<DiagCode>(cursor.current().diag_payload)
700 cursor.current());
701 ok = false;
702 cursor.bump();
703 }
704 }
705 if(!expect(cursor, "end_resource", sink)) return false;
706 if(configuration.resources.size() >= limits.max_resources) {
708 return false;
709 }
710 configuration.resources.push_back(std::move(resource));
711 return ok;
712}
713
714inline bool parse_configurations(std::string_view source,
715 const ParseLimits &limits,
716 std::vector<ConfigurationInfo> &result,
717 std::vector<Diagnostic> &diagnostics)
718{
719 TokenCursor cursor(source);
720 DiagnosticSink sink(diagnostics, limits.max_diagnostics);
721 bool ok = true;
722 while(!cursor.at_end()) {
723 if(!cursor.at("configuration")) {
724 cursor.bump();
725 continue;
726 }
727 const Token start = cursor.current();
728 cursor.bump();
729 ConfigurationInfo configuration;
730 configuration.base_tick_ns = limits.base_tick_ns;
731 configuration.source_offset =
732 static_cast<std::uint32_t>(token_offset(source, start));
733 ok = read_name(cursor, configuration.name, sink) && ok;
734 configuration.lower = lower_copy(configuration.name);
735 for(const ConfigurationInfo &prior : result) {
736 if(prior.lower == configuration.lower) {
738 ok = false;
739 break;
740 }
741 }
742 while(!cursor.at_end() && !cursor.at("end_configuration")) {
743 if(cursor.at("resource")) {
744 ok = parse_resource(cursor, source, limits, configuration,
745 sink) && ok;
746 } else {
747 sink.add(cursor.current().kind == TokenKind::error
748 ? static_cast<DiagCode>(
749 cursor.current().diag_payload)
751 cursor.current());
752 ok = false;
753 cursor.bump();
754 }
755 }
756 if(!expect(cursor, "end_configuration", sink)) return false;
757 if(result.size() >= limits.max_configurations) {
758 sink.add(DiagCode::capacity_exceeded, start);
759 ok = false;
760 continue;
761 }
762 result.push_back(std::move(configuration));
763 }
764 return ok;
765}
766
767inline std::uint64_t saturated_add(std::uint64_t left,
768 std::uint64_t right) noexcept
769{
770 return right > std::numeric_limits<std::uint64_t>::max() - left
771 ? std::numeric_limits<std::uint64_t>::max()
772 : left + right;
773}
774
775inline std::uint64_t align_runtime(std::uint64_t value) noexcept
776{
777 return value > std::numeric_limits<std::uint64_t>::max() - 7U
778 ? std::numeric_limits<std::uint64_t>::max()
779 : (value + 7U) & ~std::uint64_t{7U};
780}
781
782} // namespace tasking_detail
783
784} // namespace plcopen::core::st
void add(DiagCode code, const Token &token)
DiagnosticSink(std::vector< Diagnostic > &diagnostics, std::size_t capacity)
bool at(std::string_view lower) const
bool ascii_iequals(std::string_view text, std::string_view lower_ref)
定义 lexer.h:50
bool read_name(TokenCursor &cursor, std::string &name, DiagnosticSink &sink)
std::size_t token_offset(std::string_view source, const Token &token)
bool parse_task(TokenCursor &cursor, std::string_view source, const ParseLimits &limits, ResourceInfo &resource, DiagnosticSink &sink)
std::uint64_t align_runtime(std::uint64_t value) noexcept
Token source_token(std::string_view source, std::size_t offset)
bool identifier(const Token &token)
bool duplicate_name(const std::string &lower, const std::vector< TaskInfo > &values)
bool source_contains_token(std::string_view source, std::string_view lower)
void add_diagnostic(std::vector< Diagnostic > &diagnostics, std::size_t capacity, DiagCode code, std::string_view source, std::size_t offset)
bool token_is(const Token &token, std::string_view lower)
bool source_contains_call(std::string_view source, std::string_view lower, std::size_t &offset)
int find_task(const ResourceInfo &resource, std::string_view lower)
std::string lower_copy(std::string_view value)
std::string mask_configuration_blocks(std::string_view source)
bool same_name(std::string_view lower, const char *value)
bool parse_configurations(std::string_view source, const ParseLimits &limits, std::vector< ConfigurationInfo > &result, std::vector< Diagnostic > &diagnostics)
bool parse_mapping(TokenCursor &cursor, std::string_view source, const ParseLimits &limits, ResourceInfo &resource, DiagnosticSink &sink)
bool expect(TokenCursor &cursor, std::string_view word, DiagnosticSink &sink)
bool read_signed_integer(TokenCursor &cursor, std::int64_t &value)
bool has_program_declaration(std::string_view source)
std::uint64_t saturated_add(std::uint64_t left, std::uint64_t right) noexcept
bool parse_resource(TokenCursor &cursor, std::string_view source, const ParseLimits &limits, ConfigurationInfo &configuration, DiagnosticSink &sink)
constexpr const char * to_string(ConvKind kind)
定义 conv.h:90
constexpr std::uint32_t invalid_artifact_index
std::vector< ResourceInfo > resources
std::vector< TaskInfo > tasks
std::vector< ProgramMappingInfo > mappings
std::vector< std::uint16_t > mappings
TaskFaultElementKind fault_element_kind
std::uint64_t release_worst_case_instructions
std::string_view text
std::uint16_t diag_payload
std::uint64_t unsigned_value