Skip to content

Commit

Permalink
Simulation AST: add reference enum for Var schema.
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Rule (VM/EMT3) <Timothy.Rule@de.bosch.com>
  • Loading branch information
timrulebosch committed Jan 17, 2025
1 parent f4180a2 commit 0052899
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
9 changes: 7 additions & 2 deletions code/go/dse/ast/Simulation.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import ()
const (
SimulationKindSimulation SimulationKind = "Simulation"
)
const (
VarReferenceUses VarReference = "uses"
)

type Model struct {
Arch *string `yaml:"arch,omitempty"`
Expand Down Expand Up @@ -53,9 +56,11 @@ type Uses struct {
Version *string `yaml:"version,omitempty"`
}
type Var struct {
Name string `yaml:"name"`
Value string `yaml:"value"`
Name string `yaml:"name"`
Reference *VarReference `yaml:"reference,omitempty"`
Value string `yaml:"value"`
}
type VarReference string
type Workflow struct {
Name string `yaml:"name"`
Uses *string `yaml:"uses,omitempty"`
Expand Down
18 changes: 18 additions & 0 deletions doc/content/schemas/yaml/Simulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ uses:
vars:
- name: string
value: string
reference: uses
stacks:
- name: string
arch: linux-amd64
stacked: true
env:
- name: string
value: string
reference: uses
models:
- name: string
model: string
Expand All @@ -117,12 +119,14 @@ stacks:
env:
- name: string
value: string
reference: uses
workflows:
- name: string
uses: string
vars:
- name: string
value: string
reference: uses

```

Expand Down Expand Up @@ -238,6 +242,7 @@ Defines an external resource used by the simulation.
```yaml
name: string
value: string
reference: uses

```
Expand All @@ -249,6 +254,13 @@ A variable definition.
|---|---|---|---|
|name|string|true|A variable name.|
|value|string|true|A coresponding variable value.|
|reference|string|false|This value is derived from the specified reference (e.g. a downloaded file) The resouce name is specified in the value.|
#### Enumerated Values
|Property|Value|
|---|---|
|reference|uses|
<h2 id="tocS_Stack">Stack</h2>
Expand All @@ -264,6 +276,7 @@ stacked: true
env:
- name: string
value: string
reference: uses
models:
- name: string
model: string
Expand All @@ -274,12 +287,14 @@ models:
env:
- name: string
value: string
reference: uses
workflows:
- name: string
uses: string
vars:
- name: string
value: string
reference: uses

```

Expand Down Expand Up @@ -312,12 +327,14 @@ channels:
env:
- name: string
value: string
reference: uses
workflows:
- name: string
uses: string
vars:
- name: string
value: string
reference: uses

```

Expand Down Expand Up @@ -345,6 +362,7 @@ uses: string
vars:
- name: string
value: string
reference: uses

```

Expand Down
5 changes: 5 additions & 0 deletions schemas/yaml/Simulation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ components:
value:
type: string
description: A coresponding variable value.
reference:
type: string
description: This value is derived from the specified reference (e.g. a downloaded file) The resouce name is specified in the value.
enum:
- uses
Stack:
type: object
description: A stack definition which composes one or more models as a logical unit of the simulation.
Expand Down

0 comments on commit 0052899

Please sign in to comment.