Merge pull request #15 from oscargus/vhdl

Add support for VHDL std_ulogic
This commit is contained in:
Frans Skarman 2023-09-26 11:05:21 +00:00 committed by GitHub
commit 22eaf8da15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View file

@ -96,7 +96,11 @@ pub(super) fn parse_events<'a, R: std::io::Read>(
Err(
BinaryParserErrTypes::XValue
| BinaryParserErrTypes::ZValue
| BinaryParserErrTypes::UValue,
| BinaryParserErrTypes::UValue
| BinaryParserErrTypes::WValue
| BinaryParserErrTypes::HValue
| BinaryParserErrTypes::DashValue
| BinaryParserErrTypes::LValue,
) => {
store_as_string = true;
value_string = binary_value.to_string();
@ -408,7 +412,7 @@ pub(super) fn parse_events<'a, R: std::io::Read>(
}
// // other one bit cases
"x" | "X" | "z" | "Z" | "u" | "U" => {
"x" | "X" | "z" | "Z" | "u" | "U" | "h" | "H" | "l" | "L" | "w" | "W" | "-" => {
let val = word.to_string();
// lokup signal idx
let hash = &word[1..];

View file

@ -7,6 +7,10 @@ pub(super) enum BinaryParserErrTypes {
XValue,
ZValue,
UValue,
HValue,
LValue,
DashValue,
WValue,
OtherValue(char),
TooLong,
}
@ -39,6 +43,10 @@ fn base2_str_to_byte(word: &[u8]) -> Result<u8, BinaryParserErrTypes> {
b'x' | b'X' => return Err(BinaryParserErrTypes::XValue),
b'z' | b'Z' => return Err(BinaryParserErrTypes::ZValue),
b'u' | b'U' => return Err(BinaryParserErrTypes::UValue),
b'l' | b'L' => return Err(BinaryParserErrTypes::LValue),
b'h' | b'H' => return Err(BinaryParserErrTypes::HValue),
b'w' | b'W' => return Err(BinaryParserErrTypes::WValue),
b'-' => return Err(BinaryParserErrTypes::DashValue),
_ => return Err(BinaryParserErrTypes::OtherValue(*chr as char)),
}
}