Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bugfix/stil_annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaj committed Jan 17, 2025
2 parents 7fe7d04 + 79675ad commit 6a35a76
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
10 changes: 10 additions & 0 deletions rust/origen_metal/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rust/origen_metal/src/stil/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ pub enum STIL {
DefaultState(stil::State),
Base(stil::Base, String),
Alignment(stil::Alignment),
ScanIn(u32),
ScanOut(u32),
ScanIn(Option<u32>),
ScanOut(Option<u32>),
DataBitCount(u32),
SignalGroups(Option<String>),
SignalGroup(String),
Expand Down
18 changes: 16 additions & 2 deletions rust/origen_metal/src/stil/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,22 @@ pub fn to_ast(mut pair: Pair<Rule>, source_file: Option<&str>) -> Result<AST<STI
Rule::alignment => {
ast.push(node!(STIL::Alignment, inner_strs(pair)[0].parse().unwrap()))
}
Rule::scan_in => ast.push(node!(STIL::ScanIn, inner_strs(pair)[0].parse().unwrap())),
Rule::scan_out => ast.push(node!(STIL::ScanOut, inner_strs(pair)[0].parse().unwrap())),
Rule::scan_in => {
let vals = inner_strs(pair);
ast.push(if vals.len() == 0 {
node!(STIL::ScanIn, None)
} else {
node!(STIL::ScanIn, Some(vals[0].parse().unwrap()))
})
}
Rule::scan_out => {
let vals = inner_strs(pair);
ast.push(if vals.len() == 0 {
node!(STIL::ScanOut, None)
} else {
node!(STIL::ScanOut, Some(vals[0].parse().unwrap()))
})
}
Rule::data_bit_count => ast.push(node!(
STIL::DataBitCount,
inner_strs(pair)[0].parse().unwrap()
Expand Down
4 changes: 2 additions & 2 deletions rust/origen_metal/src/stil/stil.pest
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ base_val = { ("Hex" | "Dec") }

alignment = { "Alignment" ~ alignment_val ~ EOS }
alignment_val = { ("MSB" | "LSB") }
scan_in = { "ScanIn" ~ integer ~ EOS }
scan_out = { "ScanOut" ~ integer ~ EOS }
scan_in = { "ScanIn" ~ integer? ~ EOS }
scan_out = { "ScanOut" ~ integer? ~ EOS }
data_bit_count = { "DataBitCount" ~ integer ~ EOS }
waveform_character_list = @{ waveform_character+ }
waveform_character = { ASCII_ALPHANUMERIC }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ SignalGroups {

MULTIGROUP0 = 'group0 + group1 + group2';
MULTIGROUP1 = 'group3 + group4 + group5 + group6' ;
ScanIO_1 = 'PIN0' {ScanOut;}
ScanIO_2 = 'PIN1' {ScanOut 2;}
AllPins = 'group0 + group1 + group2 + group3 + group4 + group5 + group6 + group7 + group8 + group9 + group10 + group11 + group12';

}

0 comments on commit 6a35a76

Please sign in to comment.