Add support for VHDL std_ulogic #15

Merged
oscargus merged 1 commit from vhdl into main 2023-09-26 11:05:22 +00:00
2 changed files with 14 additions and 2 deletions
Showing only changes of commit a7537206e2 - Show all commits

View file

@ -96,7 +96,11 @@ pub(super) fn parse_events<'a, R: std::io::Read>(
Err( Err(
BinaryParserErrTypes::XValue BinaryParserErrTypes::XValue
| BinaryParserErrTypes::ZValue | BinaryParserErrTypes::ZValue
| BinaryParserErrTypes::UValue, | BinaryParserErrTypes::UValue
| BinaryParserErrTypes::WValue
| BinaryParserErrTypes::HValue
| BinaryParserErrTypes::DashValue
| BinaryParserErrTypes::LValue,
) => { ) => {
store_as_string = true; store_as_string = true;
value_string = binary_value.to_string(); value_string = binary_value.to_string();
@ -408,7 +412,7 @@ pub(super) fn parse_events<'a, R: std::io::Read>(
} }
// // other one bit cases // // 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(); let val = word.to_string();
// lokup signal idx // lokup signal idx
let hash = &word[1..]; let hash = &word[1..];

View file

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