Fix bugs
This commit is contained in:
parent
acbf769db8
commit
fecbce4852
16
README.md
16
README.md
@ -81,15 +81,15 @@ A parser library for System Verilog.
|
||||
|
||||
| Clause | Exist | Pass | Clause | Exist | Pass | Clause | Exist | Pass | Clause | Exist | Pass |
|
||||
| ------ | ----- | ---- | ------ | ----- | ---- | ------ | ----- | ---- | ------ | ----- | ---- |
|
||||
| 3 | x | x | 13 | x | x | 23 | x | | 33 | x | |
|
||||
| 3 | x | x | 13 | x | x | 23 | x | x | 33 | x | x |
|
||||
| 4 | x | x | 14 | x | x | 24 | x | x | 34 | x | |
|
||||
| 5 | x | x | 15 | x | x | 25 | x | | 35 | x | |
|
||||
| 6 | x | x | 16 | x | | 26 | x | | 36 | x | x |
|
||||
| 7 | x | x | 17 | x | | 27 | x | | | | |
|
||||
| 8 | x | x | 18 | x | | 28 | x | x | | | |
|
||||
| 9 | x | x | 19 | x | | 29 | x | | | | |
|
||||
| 10 | x | x | 20 | x | | 30 | x | | | | |
|
||||
| 11 | x | x | 21 | x | | 31 | x | | | | |
|
||||
| 5 | x | x | 15 | x | x | 25 | x | x | 35 | x | x |
|
||||
| 6 | x | x | 16 | x | x | 26 | x | x | 36 | x | x |
|
||||
| 7 | x | x | 17 | x | x | 27 | x | x | | | |
|
||||
| 8 | x | x | 18 | x | x | 28 | x | x | | | |
|
||||
| 9 | x | x | 19 | x | | 29 | x | x | | | |
|
||||
| 10 | x | x | 20 | x | | 30 | x | x | | | |
|
||||
| 11 | x | x | 21 | x | x | 31 | x | x | | | |
|
||||
| 12 | x | x | 22 | | | 32 | x | x | | | |
|
||||
|
||||
## Missing entry of specification
|
||||
|
@ -21,7 +21,7 @@ pub(crate) fn randsequence_statement(s: Span) -> IResult<Span, RandsequenceState
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn production(s: Span) -> IResult<Span, Production> {
|
||||
let (s, a) = opt(data_type_or_void)(s)?;
|
||||
let (s, a) = opt(terminated(data_type_or_void, peek(production_identifier)))(s)?;
|
||||
let (s, b) = production_identifier(s)?;
|
||||
let (s, c) = opt(paren(tf_port_list))(s)?;
|
||||
let (s, d) = symbol(":")(s)?;
|
||||
|
@ -307,11 +307,8 @@ pub(crate) fn property_spec(s: Span) -> IResult<Span, PropertySpec> {
|
||||
pub(crate) fn property_expr(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
alt((
|
||||
alt((
|
||||
property_expr_binary,
|
||||
property_expr_implication_overlapped,
|
||||
property_expr_implication_nonoverlapped,
|
||||
property_expr_followed_by_overlapped,
|
||||
property_expr_followed_by_nonoverlapped,
|
||||
property_expr_binary_property,
|
||||
property_expr_binary_sequence,
|
||||
map(terminated(sequence_expr, peek(not(symbol("(")))), |x| {
|
||||
PropertyExpr::SequenceExpr(Box::new(x))
|
||||
}),
|
||||
@ -387,7 +384,7 @@ pub(crate) fn property_expr_not(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
#[recursive_parser]
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn property_expr_binary(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
pub(crate) fn property_expr_binary_property(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
let (s, a) = property_expr(s)?;
|
||||
let (s, b) = alt((
|
||||
keyword("or"),
|
||||
@ -402,37 +399,20 @@ pub(crate) fn property_expr_binary(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
let (s, c) = property_expr(s)?;
|
||||
Ok((
|
||||
s,
|
||||
PropertyExpr::Binary(Box::new(PropertyExprBinary { nodes: (a, b, c) })),
|
||||
PropertyExpr::BinaryProperty(Box::new(PropertyExprBinaryProperty { nodes: (a, b, c) })),
|
||||
))
|
||||
}
|
||||
|
||||
#[recursive_parser]
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn property_expr_implication_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
pub(crate) fn property_expr_binary_sequence(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
let (s, a) = sequence_expr(s)?;
|
||||
let (s, b) = symbol("|->")(s)?;
|
||||
let (s, b) = alt((symbol("|->"), symbol("|=>"), symbol("#-#"), symbol("#=#")))(s)?;
|
||||
let (s, c) = property_expr(s)?;
|
||||
Ok((
|
||||
s,
|
||||
PropertyExpr::ImplicationOverlapped(Box::new(PropertyExprImplicationOverlapped {
|
||||
nodes: (a, b, c),
|
||||
})),
|
||||
))
|
||||
}
|
||||
|
||||
#[recursive_parser]
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn property_expr_implication_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
let (s, a) = sequence_expr(s)?;
|
||||
let (s, b) = symbol("|=>")(s)?;
|
||||
let (s, c) = property_expr(s)?;
|
||||
Ok((
|
||||
s,
|
||||
PropertyExpr::ImplicationNonoverlapped(Box::new(PropertyExprImplicationNonoverlapped {
|
||||
nodes: (a, b, c),
|
||||
})),
|
||||
PropertyExpr::BinarySequence(Box::new(PropertyExprBinarySequence { nodes: (a, b, c) })),
|
||||
))
|
||||
}
|
||||
|
||||
@ -466,37 +446,6 @@ pub(crate) fn property_expr_case(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
})),
|
||||
))
|
||||
}
|
||||
|
||||
#[recursive_parser]
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn property_expr_followed_by_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
let (s, a) = sequence_expr(s)?;
|
||||
let (s, b) = symbol("#-#")(s)?;
|
||||
let (s, c) = property_expr(s)?;
|
||||
Ok((
|
||||
s,
|
||||
PropertyExpr::FollowedByOverlapped(Box::new(PropertyExprFollowedByOverlapped {
|
||||
nodes: (a, b, c),
|
||||
})),
|
||||
))
|
||||
}
|
||||
|
||||
#[recursive_parser]
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn property_expr_followed_by_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
let (s, a) = sequence_expr(s)?;
|
||||
let (s, b) = symbol("#=#")(s)?;
|
||||
let (s, c) = property_expr(s)?;
|
||||
Ok((
|
||||
s,
|
||||
PropertyExpr::FollowedByNonoverlapped(Box::new(PropertyExprFollowedByNonoverlapped {
|
||||
nodes: (a, b, c),
|
||||
})),
|
||||
))
|
||||
}
|
||||
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn property_expr_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
|
||||
@ -766,10 +715,7 @@ pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
sequence_expr_throughout,
|
||||
terminated(sequence_expr_expression, peek(not(symbol("(")))),
|
||||
sequence_expr_instance,
|
||||
sequence_expr_and,
|
||||
sequence_expr_or,
|
||||
sequence_expr_intersect,
|
||||
sequence_expr_within,
|
||||
sequence_expr_binary,
|
||||
sequence_expr_paren,
|
||||
sequence_expr_first_match,
|
||||
sequence_expr_clocking_event,
|
||||
@ -844,39 +790,18 @@ pub(crate) fn sequence_expr_paren(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
#[recursive_parser]
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn sequence_expr_and(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
pub(crate) fn sequence_expr_binary(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
let (s, a) = sequence_expr(s)?;
|
||||
let (s, b) = keyword("and")(s)?;
|
||||
let (s, b) = alt((
|
||||
keyword("and"),
|
||||
keyword("intersect"),
|
||||
keyword("or"),
|
||||
keyword("within"),
|
||||
))(s)?;
|
||||
let (s, c) = sequence_expr(s)?;
|
||||
Ok((
|
||||
s,
|
||||
SequenceExpr::And(Box::new(SequenceExprAnd { nodes: (a, b, c) })),
|
||||
))
|
||||
}
|
||||
|
||||
#[recursive_parser]
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn sequence_expr_intersect(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
let (s, a) = sequence_expr(s)?;
|
||||
let (s, b) = keyword("intersect")(s)?;
|
||||
let (s, c) = sequence_expr(s)?;
|
||||
Ok((
|
||||
s,
|
||||
SequenceExpr::Intersect(Box::new(SequenceExprIntersect { nodes: (a, b, c) })),
|
||||
))
|
||||
}
|
||||
|
||||
#[recursive_parser]
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn sequence_expr_or(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
let (s, a) = sequence_expr(s)?;
|
||||
let (s, b) = keyword("or")(s)?;
|
||||
let (s, c) = sequence_expr(s)?;
|
||||
Ok((
|
||||
s,
|
||||
SequenceExpr::Or(Box::new(SequenceExprOr { nodes: (a, b, c) })),
|
||||
SequenceExpr::Binary(Box::new(SequenceExprBinary { nodes: (a, b, c) })),
|
||||
))
|
||||
}
|
||||
|
||||
@ -907,19 +832,6 @@ pub(crate) fn sequence_expr_throughout(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
))
|
||||
}
|
||||
|
||||
#[recursive_parser]
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn sequence_expr_within(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
let (s, a) = sequence_expr(s)?;
|
||||
let (s, b) = keyword("within")(s)?;
|
||||
let (s, c) = sequence_expr(s)?;
|
||||
Ok((
|
||||
s,
|
||||
SequenceExpr::Within(Box::new(SequenceExprWithin { nodes: (a, b, c) })),
|
||||
))
|
||||
}
|
||||
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn sequence_expr_clocking_event(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
|
@ -291,8 +291,8 @@ pub(crate) fn bins_or_options(s: Span) -> IResult<Span, BinsOrOptions> {
|
||||
bins_or_options_cover_point,
|
||||
bins_or_options_set_covergroup,
|
||||
bins_or_options_trans_list,
|
||||
bins_or_options_default,
|
||||
bins_or_options_default_sequence,
|
||||
bins_or_options_default,
|
||||
))(s)
|
||||
}
|
||||
|
||||
@ -445,10 +445,10 @@ pub(crate) fn trans_set(s: Span) -> IResult<Span, TransSet> {
|
||||
#[packrat_parser]
|
||||
pub(crate) fn trans_range_list(s: Span) -> IResult<Span, TransRangeList> {
|
||||
alt((
|
||||
map(trans_item, |x| TransRangeList::TransItem(Box::new(x))),
|
||||
trans_range_list_asterisk,
|
||||
trans_range_list_arrow,
|
||||
trans_range_list_equal,
|
||||
map(trans_item, |x| TransRangeList::TransItem(Box::new(x))),
|
||||
))(s)
|
||||
}
|
||||
|
||||
@ -499,10 +499,10 @@ pub(crate) fn trans_item(s: Span) -> IResult<Span, TransItem> {
|
||||
#[packrat_parser]
|
||||
pub(crate) fn repeat_range(s: Span) -> IResult<Span, RepeatRange> {
|
||||
alt((
|
||||
repeat_range_binary,
|
||||
map(covergroup_expression, |x| {
|
||||
RepeatRange::CovergroupExpression(Box::new(x))
|
||||
}),
|
||||
repeat_range_binary,
|
||||
))(s)
|
||||
}
|
||||
|
||||
@ -539,8 +539,9 @@ pub(crate) fn cover_cross(s: Span) -> IResult<Span, CoverCross> {
|
||||
#[packrat_parser]
|
||||
pub(crate) fn list_of_cross_items(s: Span) -> IResult<Span, ListOfCrossItems> {
|
||||
let (s, a) = cross_item(s)?;
|
||||
let (s, b) = list(symbol(","), cross_item)(s)?;
|
||||
Ok((s, ListOfCrossItems { nodes: (a, b) }))
|
||||
let (s, b) = symbol(",")(s)?;
|
||||
let (s, c) = list(symbol(","), cross_item)(s)?;
|
||||
Ok((s, ListOfCrossItems { nodes: (a, b, c) }))
|
||||
}
|
||||
|
||||
#[tracable_parser]
|
||||
@ -568,7 +569,7 @@ pub(crate) fn cross_body(s: Span) -> IResult<Span, CrossBody> {
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn cross_body_non_empty(s: Span) -> IResult<Span, CrossBody> {
|
||||
let (s, a) = brace(many0(pair(cross_body_item, symbol(";"))))(s)?;
|
||||
let (s, a) = brace(many0(cross_body_item))(s)?;
|
||||
Ok((
|
||||
s,
|
||||
CrossBody::NonEmpty(Box::new(CrossBodyNonEmpty { nodes: (a,) })),
|
||||
@ -639,18 +640,18 @@ pub(crate) fn bins_selection(s: Span) -> IResult<Span, BinsSelection> {
|
||||
#[packrat_parser]
|
||||
pub(crate) fn select_expression(s: Span) -> IResult<Span, SelectExpression> {
|
||||
alt((
|
||||
select_expression_and,
|
||||
select_expression_or,
|
||||
select_expression_with,
|
||||
map(select_condition, |x| {
|
||||
SelectExpression::SelectCondition(Box::new(x))
|
||||
}),
|
||||
select_expression_not,
|
||||
select_expression_and,
|
||||
select_expression_or,
|
||||
select_expression_paren,
|
||||
select_expression_with,
|
||||
select_expression_cross_set,
|
||||
map(cross_identifier, |x| {
|
||||
SelectExpression::CrossIdentifier(Box::new(x))
|
||||
}),
|
||||
select_expression_cross_set,
|
||||
))(s)
|
||||
}
|
||||
|
||||
@ -742,10 +743,10 @@ pub(crate) fn select_condition(s: Span) -> IResult<Span, SelectCondition> {
|
||||
#[packrat_parser]
|
||||
pub(crate) fn bins_expression(s: Span) -> IResult<Span, BinsExpression> {
|
||||
alt((
|
||||
bins_expression_cover_point,
|
||||
map(variable_identifier, |x| {
|
||||
BinsExpression::VariableIdentifier(Box::new(x))
|
||||
}),
|
||||
bins_expression_cover_point,
|
||||
))(s)
|
||||
}
|
||||
|
||||
|
@ -203,8 +203,8 @@ pub(crate) fn dpi_import_export_export_task(s: Span) -> IResult<Span, DpiImportE
|
||||
#[packrat_parser]
|
||||
pub(crate) fn dpi_spec_string(s: Span) -> IResult<Span, DpiSpecString> {
|
||||
alt((
|
||||
map(keyword("DPI-C"), |x| DpiSpecString::DpiC(Box::new(x))),
|
||||
map(keyword("DPI"), |x| DpiSpecString::Dpi(Box::new(x))),
|
||||
map(keyword("\"DPI-C\""), |x| DpiSpecString::DpiC(Box::new(x))),
|
||||
map(keyword("\"DPI\""), |x| DpiSpecString::Dpi(Box::new(x))),
|
||||
))(s)
|
||||
}
|
||||
|
||||
|
@ -363,14 +363,14 @@ pub(crate) fn module_path_conditional_expression(
|
||||
#[packrat_parser]
|
||||
pub(crate) fn module_path_expression(s: Span) -> IResult<Span, ModulePathExpression> {
|
||||
alt((
|
||||
map(module_path_primary, |x| {
|
||||
ModulePathExpression::ModulePathPrimary(Box::new(x))
|
||||
}),
|
||||
module_path_expression_unary,
|
||||
module_path_expression_binary,
|
||||
map(module_path_conditional_expression, |x| {
|
||||
ModulePathExpression::ModulePathConditionalExpression(Box::new(x))
|
||||
}),
|
||||
map(module_path_primary, |x| {
|
||||
ModulePathExpression::ModulePathPrimary(Box::new(x))
|
||||
}),
|
||||
module_path_expression_unary,
|
||||
))(s)
|
||||
}
|
||||
|
||||
|
@ -324,11 +324,10 @@ pub(crate) fn bind_directive_scope(s: Span) -> IResult<Span, BindDirective> {
|
||||
let (s, b) = bind_target_scope(s)?;
|
||||
let (s, c) = opt(pair(symbol(":"), bind_target_instance_list))(s)?;
|
||||
let (s, d) = bind_instantiation(s)?;
|
||||
let (s, e) = symbol(";")(s)?;
|
||||
Ok((
|
||||
s,
|
||||
BindDirective::Scope(Box::new(BindDirectiveScope {
|
||||
nodes: (a, b, c, d, e),
|
||||
nodes: (a, b, c, d),
|
||||
})),
|
||||
))
|
||||
}
|
||||
@ -339,12 +338,9 @@ pub(crate) fn bind_directive_instance(s: Span) -> IResult<Span, BindDirective> {
|
||||
let (s, a) = keyword("bind")(s)?;
|
||||
let (s, b) = bind_target_instance(s)?;
|
||||
let (s, c) = bind_instantiation(s)?;
|
||||
let (s, d) = symbol(";")(s)?;
|
||||
Ok((
|
||||
s,
|
||||
BindDirective::Instance(Box::new(BindDirectiveInstance {
|
||||
nodes: (a, b, c, d),
|
||||
})),
|
||||
BindDirective::Instance(Box::new(BindDirectiveInstance { nodes: (a, b, c) })),
|
||||
))
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ pub(crate) fn port_declaration_interface(s: Span) -> IResult<Span, PortDeclarati
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn port(s: Span) -> IResult<Span, Port> {
|
||||
alt((port_non_named, port_named))(s)
|
||||
alt((port_named, port_non_named))(s)
|
||||
}
|
||||
|
||||
#[recursive_parser]
|
||||
@ -205,13 +205,13 @@ pub(crate) fn port_expression(s: Span) -> IResult<Span, PortExpression> {
|
||||
map(port_reference, |x| {
|
||||
PortExpression::PortReference(Box::new(x))
|
||||
}),
|
||||
port_expressio_named,
|
||||
port_expression_named,
|
||||
))(s)
|
||||
}
|
||||
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn port_expressio_named(s: Span) -> IResult<Span, PortExpression> {
|
||||
pub(crate) fn port_expression_named(s: Span) -> IResult<Span, PortExpression> {
|
||||
let (s, a) = brace(list(symbol(","), port_reference))(s)?;
|
||||
Ok((
|
||||
s,
|
||||
|
@ -48,7 +48,7 @@ pub(crate) fn pulsestyle_declaration(s: Span) -> IResult<Span, PulsestyleDeclara
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn showcancelled_declaration(s: Span) -> IResult<Span, ShowcancelledDeclaration> {
|
||||
let (s, a) = alt((keyword("showcalcelled"), keyword("noshowcancelled")))(s)?;
|
||||
let (s, a) = alt((keyword("showcancelled"), keyword("noshowcancelled")))(s)?;
|
||||
let (s, b) = list_of_path_outputs(s)?;
|
||||
let (s, c) = symbol(";")(s)?;
|
||||
Ok((s, ShowcancelledDeclaration { nodes: (a, b, c) }))
|
||||
|
@ -26,13 +26,13 @@ pub(crate) fn specify_output_terminal_descriptor(
|
||||
#[packrat_parser]
|
||||
pub(crate) fn input_identifier(s: Span) -> IResult<Span, InputIdentifier> {
|
||||
alt((
|
||||
input_identifier_interface,
|
||||
map(input_port_identifier, |x| {
|
||||
InputIdentifier::InputPortIdentifier(Box::new(x))
|
||||
}),
|
||||
map(inout_port_identifier, |x| {
|
||||
InputIdentifier::InoutPortIdentifier(Box::new(x))
|
||||
}),
|
||||
input_identifier_interface,
|
||||
))(s)
|
||||
}
|
||||
|
||||
@ -52,13 +52,13 @@ pub(crate) fn input_identifier_interface(s: Span) -> IResult<Span, InputIdentifi
|
||||
#[packrat_parser]
|
||||
pub(crate) fn output_identifier(s: Span) -> IResult<Span, OutputIdentifier> {
|
||||
alt((
|
||||
output_identifier_interface,
|
||||
map(output_port_identifier, |x| {
|
||||
OutputIdentifier::OutputPortIdentifier(Box::new(x))
|
||||
}),
|
||||
map(inout_port_identifier, |x| {
|
||||
OutputIdentifier::InoutPortIdentifier(Box::new(x))
|
||||
}),
|
||||
output_identifier_interface,
|
||||
))(s)
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,8 @@ pub(crate) fn system_timing_check(s: Span) -> IResult<Span, SystemTimingCheck> {
|
||||
map(width_timing_check, |x| {
|
||||
SystemTimingCheck::WidthTimingCheck(Box::new(x))
|
||||
}),
|
||||
map(nocharge_timing_check, |x| {
|
||||
SystemTimingCheck::NochargeTimingCheck(Box::new(x))
|
||||
map(nochange_timing_check, |x| {
|
||||
SystemTimingCheck::NochangeTimingCheck(Box::new(x))
|
||||
}),
|
||||
))(s)
|
||||
}
|
||||
@ -64,7 +64,7 @@ pub(crate) fn setup_timing_check(s: Span) -> IResult<Span, SetupTimingCheck> {
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn hold_timing_check(s: Span) -> IResult<Span, HoldTimingCheck> {
|
||||
let (s, a) = keyword("$setup")(s)?;
|
||||
let (s, a) = keyword("$hold")(s)?;
|
||||
let (s, b) = paren(tuple((
|
||||
referecne_event,
|
||||
symbol(","),
|
||||
@ -275,8 +275,8 @@ pub(crate) fn width_timing_check(s: Span) -> IResult<Span, WidthTimingCheck> {
|
||||
|
||||
#[tracable_parser]
|
||||
#[packrat_parser]
|
||||
pub(crate) fn nocharge_timing_check(s: Span) -> IResult<Span, NochargeTimingCheck> {
|
||||
let (s, a) = keyword("$nocharge")(s)?;
|
||||
pub(crate) fn nochange_timing_check(s: Span) -> IResult<Span, NochangeTimingCheck> {
|
||||
let (s, a) = keyword("$nochange")(s)?;
|
||||
let (s, b) = paren(tuple((
|
||||
referecne_event,
|
||||
symbol(","),
|
||||
@ -288,5 +288,5 @@ pub(crate) fn nocharge_timing_check(s: Span) -> IResult<Span, NochargeTimingChec
|
||||
opt(pair(symbol(","), opt(notifier))),
|
||||
)))(s)?;
|
||||
let (s, c) = symbol(";")(s)?;
|
||||
Ok((s, NochargeTimingCheck { nodes: (a, b, c) }))
|
||||
Ok((s, NochangeTimingCheck { nodes: (a, b, c) }))
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -113,12 +113,12 @@ pub(crate) fn sequential_entry(s: Span) -> IResult<Span, SequentialEntry> {
|
||||
#[packrat_parser]
|
||||
pub(crate) fn seq_input_list(s: Span) -> IResult<Span, SeqInputList> {
|
||||
alt((
|
||||
map(level_input_list, |x| {
|
||||
SeqInputList::LevelInputList(Box::new(x))
|
||||
}),
|
||||
map(edge_input_list, |x| {
|
||||
SeqInputList::EdgeInputList(Box::new(x))
|
||||
}),
|
||||
map(level_input_list, |x| {
|
||||
SeqInputList::LevelInputList(Box::new(x))
|
||||
}),
|
||||
))(s)
|
||||
}
|
||||
|
||||
@ -178,10 +178,10 @@ pub(crate) fn next_state(s: Span) -> IResult<Span, NextState> {
|
||||
#[packrat_parser]
|
||||
pub(crate) fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
|
||||
alt((
|
||||
map(keyword("0"), |x| OutputSymbol { nodes: (x,) }),
|
||||
map(keyword("1"), |x| OutputSymbol { nodes: (x,) }),
|
||||
map(keyword("x"), |x| OutputSymbol { nodes: (x,) }),
|
||||
map(keyword("X"), |x| OutputSymbol { nodes: (x,) }),
|
||||
map(symbol("0"), |x| OutputSymbol { nodes: (x,) }),
|
||||
map(symbol("1"), |x| OutputSymbol { nodes: (x,) }),
|
||||
map(symbol("x"), |x| OutputSymbol { nodes: (x,) }),
|
||||
map(symbol("X"), |x| OutputSymbol { nodes: (x,) }),
|
||||
))(s)
|
||||
}
|
||||
|
||||
@ -189,13 +189,13 @@ pub(crate) fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
|
||||
#[packrat_parser]
|
||||
pub(crate) fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
|
||||
alt((
|
||||
map(keyword("0"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(keyword("1"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(keyword("x"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(keyword("X"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(keyword("?"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(keyword("b"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(keyword("B"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(symbol("0"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(symbol("1"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(symbol("x"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(symbol("X"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(symbol("?"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(symbol("b"), |x| LevelSymbol { nodes: (x,) }),
|
||||
map(symbol("B"), |x| LevelSymbol { nodes: (x,) }),
|
||||
))(s)
|
||||
}
|
||||
|
||||
@ -203,14 +203,14 @@ pub(crate) fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
|
||||
#[packrat_parser]
|
||||
pub(crate) fn edge_symbol(s: Span) -> IResult<Span, EdgeSymbol> {
|
||||
alt((
|
||||
map(keyword("r"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(keyword("R"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(keyword("f"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(keyword("F"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(keyword("p"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(keyword("P"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(keyword("n"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(keyword("N"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(keyword("*"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(symbol("r"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(symbol("R"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(symbol("f"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(symbol("F"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(symbol("p"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(symbol("P"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(symbol("n"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(symbol("N"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
map(symbol("*"), |x| EdgeSymbol { nodes: (x,) }),
|
||||
))(s)
|
||||
}
|
||||
|
@ -163,13 +163,10 @@ pub enum PropertyExpr {
|
||||
Weak(Box<PropertyExprWeak>),
|
||||
Paren(Box<PropertyExprParen>),
|
||||
Not(Box<PropertyExprNot>),
|
||||
Binary(Box<PropertyExprBinary>),
|
||||
ImplicationOverlapped(Box<PropertyExprImplicationOverlapped>),
|
||||
ImplicationNonoverlapped(Box<PropertyExprImplicationNonoverlapped>),
|
||||
BinaryProperty(Box<PropertyExprBinaryProperty>),
|
||||
BinarySequence(Box<PropertyExprBinarySequence>),
|
||||
If(Box<PropertyExprIf>),
|
||||
Case(Box<PropertyExprCase>),
|
||||
FollowedByOverlapped(Box<PropertyExprFollowedByOverlapped>),
|
||||
FollowedByNonoverlapped(Box<PropertyExprFollowedByNonoverlapped>),
|
||||
Nexttime(Box<PropertyExprNexttime>),
|
||||
SNexttime(Box<PropertyExprSNexttime>),
|
||||
Always(Box<PropertyExprAlways>),
|
||||
@ -205,17 +202,12 @@ pub struct PropertyExprNot {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprBinary {
|
||||
pub struct PropertyExprBinaryProperty {
|
||||
pub nodes: (PropertyExpr, Keyword, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprImplicationOverlapped {
|
||||
pub nodes: (SequenceExpr, Symbol, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprImplicationNonoverlapped {
|
||||
pub struct PropertyExprBinarySequence {
|
||||
pub nodes: (SequenceExpr, Symbol, PropertyExpr),
|
||||
}
|
||||
|
||||
@ -240,16 +232,6 @@ pub struct PropertyExprCase {
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprFollowedByOverlapped {
|
||||
pub nodes: (SequenceExpr, Symbol, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprFollowedByNonoverlapped {
|
||||
pub nodes: (SequenceExpr, Symbol, PropertyExpr),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct PropertyExprNexttime {
|
||||
pub nodes: (Keyword, Option<Bracket<ConstantExpression>>, PropertyExpr),
|
||||
@ -386,12 +368,9 @@ pub enum SequenceExpr {
|
||||
Expression(Box<SequenceExprExpression>),
|
||||
Instance(Box<SequenceExprInstance>),
|
||||
Paren(Box<SequenceExprParen>),
|
||||
And(Box<SequenceExprAnd>),
|
||||
Intersect(Box<SequenceExprIntersect>),
|
||||
Or(Box<SequenceExprOr>),
|
||||
Binary(Box<SequenceExprBinary>),
|
||||
FirstMatch(Box<SequenceExprFirstMatch>),
|
||||
Throughout(Box<SequenceExprThroughout>),
|
||||
Within(Box<SequenceExprWithin>),
|
||||
ClockingEvent(Box<SequenceExprClockingEvent>),
|
||||
}
|
||||
|
||||
@ -433,17 +412,7 @@ pub struct SequenceExprParen {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprAnd {
|
||||
pub nodes: (SequenceExpr, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprIntersect {
|
||||
pub nodes: (SequenceExpr, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprOr {
|
||||
pub struct SequenceExprBinary {
|
||||
pub nodes: (SequenceExpr, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
@ -460,11 +429,6 @@ pub struct SequenceExprThroughout {
|
||||
pub nodes: (ExpressionOrDist, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprWithin {
|
||||
pub nodes: (SequenceExpr, Keyword, SequenceExpr),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct SequenceExprClockingEvent {
|
||||
pub nodes: (ClockingEvent, SequenceExpr),
|
||||
|
@ -303,7 +303,7 @@ pub struct CoverCross {
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct ListOfCrossItems {
|
||||
pub nodes: (CrossItem, List<Symbol, CrossItem>),
|
||||
pub nodes: (CrossItem, Symbol, List<Symbol, CrossItem>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
@ -320,7 +320,7 @@ pub enum CrossBody {
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct CrossBodyNonEmpty {
|
||||
pub nodes: (Brace<Vec<(CrossBodyItem, Symbol)>>,),
|
||||
pub nodes: (Brace<Vec<CrossBodyItem>>,),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
|
@ -152,13 +152,12 @@ pub struct BindDirectiveScope {
|
||||
BindTargetScope,
|
||||
Option<(Symbol, BindTargetInstanceList)>,
|
||||
BindInstantiation,
|
||||
Symbol,
|
||||
),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct BindDirectiveInstance {
|
||||
pub nodes: (Keyword, BindTargetInstance, BindInstantiation, Symbol),
|
||||
pub nodes: (Keyword, BindTargetInstance, BindInstantiation),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
|
@ -15,7 +15,7 @@ pub enum SystemTimingCheck {
|
||||
FullskewTimingCheck(Box<FullskewTimingCheck>),
|
||||
PeriodTimingCheck(Box<PeriodTimingCheck>),
|
||||
WidthTimingCheck(Box<WidthTimingCheck>),
|
||||
NochargeTimingCheck(Box<NochargeTimingCheck>),
|
||||
NochangeTimingCheck(Box<NochangeTimingCheck>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
@ -247,7 +247,7 @@ pub struct WidthTimingCheck {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct NochargeTimingCheck {
|
||||
pub struct NochangeTimingCheck {
|
||||
pub nodes: (
|
||||
Keyword,
|
||||
Paren<(
|
||||
|
@ -96,15 +96,15 @@ pub enum NextState {
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct OutputSymbol {
|
||||
pub nodes: (Keyword,),
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct LevelSymbol {
|
||||
pub nodes: (Keyword,),
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Node)]
|
||||
pub struct EdgeSymbol {
|
||||
pub nodes: (Keyword,),
|
||||
pub nodes: (Symbol,),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user