Skip to content

Commit

Permalink
fixed bug where compiler generates OR guards instead of AND
Browse files Browse the repository at this point in the history
  • Loading branch information
parthsarkar17 committed Dec 17, 2024
1 parent 1f00f4b commit 470506d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion calyx-backend/src/verilog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,20 @@ impl<'a> std::fmt::Display for VerilogPortRef<'a> {

fn unflattened_guard(guard: &ir::Guard<Nothing>) -> String {
match guard {
Guard::Or(left, right) | Guard::And(left, right) => {
Guard::Or(left, right) => {
format!(
"({}) | ({})",
unflattened_guard(left),
unflattened_guard(right)
)
}
Guard::And(left, right) => {
format!(
"({}) & ({})",
unflattened_guard(left),
unflattened_guard(right)
)
}
Guard::CompOp(comp, left, right) => {
let op = match comp {
ir::PortComp::Eq => "==",
Expand Down

0 comments on commit 470506d

Please sign in to comment.