-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XLS] Finish the IR parser's handling of predicated state reads
Previously dropped the predicate operand, due to an incomplete implementation. Now properly uses an optional keyword argument for this operand. PiperOrigin-RevId: 719458997
- Loading branch information
1 parent
3466ae5
commit 572e484
Showing
6 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -868,6 +868,7 @@ cc_test( | |
":ir", | ||
":ir_parser", | ||
":op", | ||
":state_element", | ||
":type", | ||
":value", | ||
"//xls/common:casts", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
xls/ir/testdata/ir_parser_round_trip_test_ParseProcWithPredicatedStateRead.ir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package test | ||
|
||
chan ch(bits[32], id=0, kind=streaming, ops=send_receive, flow_control=none, strictness=proven_mutually_exclusive, metadata="""""") | ||
|
||
proc my_proc(my_token: token, my_state: bits[32], my_predicate: bits[1], init={token, 42, 1}) { | ||
my_predicate: bits[1] = state_read(state_element=my_predicate, id=18) | ||
my_token: token = state_read(state_element=my_token, id=9) | ||
my_state: bits[32] = state_read(state_element=my_state, predicate=my_predicate, id=10) | ||
send.1: token = send(my_token, my_state, channel=ch, id=1) | ||
literal.2: bits[1] = literal(value=1, id=2) | ||
receive.3: (token, bits[32]) = receive(send.1, predicate=literal.2, channel=ch, id=3) | ||
tuple_index.4: token = tuple_index(receive.3, index=0, id=4) | ||
next_value.5: () = next_value(param=my_token, value=tuple_index.4, id=5) | ||
next_value.6: () = next_value(param=my_state, value=my_state, id=6) | ||
next_value.7: () = next_value(param=my_predicate, value=my_predicate, id=7) | ||
} |