Skip to content

Commit

Permalink
Add coverage for tagged waveform parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ginty committed Jun 26, 2024
1 parent 0aef3ba commit 3fc1570
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion rust/origen_metal/src/stil/stil.pest
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ sub_waveform = { label? ~ "Duration" ~ time_expr ~ "{" ~ event* ~ "}" }
waveforms = { "Waveforms" ~ "{" ~ waveform* ~ "}" }
waveform = { sigref_expr ~ "{" ~ inherit_waveform* ~ (tagged_wfc_definition | wfc_definition)* ~ "}" }
inherit_waveform = { "InheritWaveform" ~ name ~ EOS }
wfc_definition = { wfc_list ~ "{" ~ inherit_waveform_wfc* ~ event* ~ "}" }
// Allow the final event to optionally have no semicolon at the end, for compatibility with historical AMD
// waveform defs which don't have a semicolon for waveforms that only contain a single event
wfc_definition = { wfc_list ~ "{" ~ inherit_waveform_wfc* ~ event* ~ event_with_no_semicolon? ~ "}" }
tagged_wfc_definition = { tag ~ wfc_list ~ "{" ~ inherit_waveform_wfc* ~ event* ~ event_with_no_semicolon? ~ "}" }
wfc_list = @{ wfc_char+ }
wfc_char = { ASCII_ALPHANUMERIC }
Expand Down
12 changes: 11 additions & 1 deletion test_apps/python_app/vendor/stil/example2.stil
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ SignalGroups quality {
Timing {
WaveformTable defaults {
Waveforms {
allpins { xX { TMARK: 't_anchor' Z } }
allpins {
xX { TMARK: 't_anchor' Z }
<tag1> 0 {'0ns' D; }
<tag1> 1 {'0ns' U }
L {'0ns' L; }
H {'0ns' H }
<tag2> p {'0ns' U; '5ns' D; }
<tag3> P {'0ns' D; '5ns' U }
t {'0ns' U; '5ns' D; }
T {'0ns' D; '5ns' U }
}
}
}
WaveformTable wft1 {
Expand Down

0 comments on commit 3fc1570

Please sign in to comment.