From 2e8b73d2fc8c0161deb56da86ef1cd2679978607 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Sun, 6 Oct 2024 19:04:48 -0700 Subject: [PATCH] rename fire/fire_data to firing/firing_data --- crates/fayalite/src/util/ready_valid.rs | 46 ++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/crates/fayalite/src/util/ready_valid.rs b/crates/fayalite/src/util/ready_valid.rs index 4fe480d..82d3f1e 100644 --- a/crates/fayalite/src/util/ready_valid.rs +++ b/crates/fayalite/src/util/ready_valid.rs @@ -12,28 +12,28 @@ pub struct ReadyValid { impl ReadyValid { #[hdl] - pub fn fire(expr: Expr) -> Expr { + pub fn firing(expr: Expr) -> Expr { #[hdl] - let fire: Bool = wire(); + let firing: Bool = wire(); #[hdl] match expr.data { - HdlNone => connect(fire, false), - HdlSome(_) => connect(fire, expr.ready), + HdlNone => connect(firing, false), + HdlSome(_) => connect(firing, expr.ready), } - fire + firing } #[hdl] - pub fn fire_data(expr: impl ToExpr) -> Expr> { + pub fn firing_data(expr: impl ToExpr) -> Expr> { let expr = expr.to_expr(); let option_ty = Expr::ty(expr).data; #[hdl] - let fire_data = wire(option_ty); - connect(fire_data, option_ty.HdlNone()); + let firing_data = wire(option_ty); + connect(firing_data, option_ty.HdlNone()); #[hdl] if expr.ready { - connect(fire_data, expr.data); + connect(firing_data, expr.data); } - fire_data + firing_data } #[hdl] pub fn map( @@ -82,11 +82,11 @@ pub fn queue( let write_port = mem.new_write_port(); #[hdl] - let inp_fire: Bool = wire(); - connect(inp_fire, ReadyValid::fire(inp)); + let inp_firing: Bool = wire(); + connect(inp_firing, ReadyValid::firing(inp)); #[hdl] - let out_fire: Bool = wire(); - connect(out_fire, ReadyValid::fire(out)); + let out_firing: Bool = wire(); + connect(out_firing, ReadyValid::firing(out)); #[hdl] let indexes_equal: Bool = wire(); connect(indexes_equal, inp_index_reg.cmp_eq(out_index_reg)); @@ -101,7 +101,7 @@ pub fn queue( connect(read_port.en, true); connect(read_port.clk, cd.clk); connect(write_port.addr, inp_index_reg); - connect(write_port.en, inp_fire); + connect(write_port.en, inp_firing); connect(write_port.clk, cd.clk); connect(write_port.data, HdlOption::unwrap_or(inp.data, ty.uninit())); connect(write_port.mask, splat_mask(ty, true.to_expr())); @@ -126,12 +126,12 @@ pub fn queue( } #[hdl] - if inp_fire.cmp_ne(out_fire) { - connect(maybe_full_reg, inp_fire); + if inp_firing.cmp_ne(out_firing) { + connect(maybe_full_reg, inp_firing); } #[hdl] - if inp_fire { + if inp_firing { #[hdl] if inp_index_reg.cmp_eq(capacity.get() - 1) { connect_any(inp_index_reg, 0_hdl_u0); @@ -141,7 +141,7 @@ pub fn queue( } #[hdl] - if out_fire { + if out_firing { #[hdl] if out_index_reg.cmp_eq(capacity.get() - 1) { connect_any(out_index_reg, 0_hdl_u0); @@ -258,9 +258,9 @@ mod tests { connect(next_expected_count, expected_count_reg); connect(expected_count_reg, next_expected_count); #[hdl] - if ReadyValid::fire(dut.inp) & !ReadyValid::fire(dut.out) { + if ReadyValid::firing(dut.inp) & !ReadyValid::firing(dut.out) { connect_any(next_expected_count, expected_count_reg + 1u8); - } else if !ReadyValid::fire(dut.inp) & ReadyValid::fire(dut.out) { + } else if !ReadyValid::firing(dut.inp) & ReadyValid::firing(dut.out) { connect_any(next_expected_count, expected_count_reg - 1u8); } hdl_assert(cd.clk, expected_count_reg.cmp_eq(dut.count), ""); @@ -289,7 +289,7 @@ mod tests { let stored_inp_data_reg = reg_builder().clock_domain(cd).reset(0u8); #[hdl] - if let HdlSome(data) = ReadyValid::fire_data(dut.inp) { + if let HdlSome(data) = ReadyValid::firing_data(dut.inp) { #[hdl] if inp_index_reg.cmp_lt(index_max) { connect_any(inp_index_reg, inp_index_reg + 1u8); @@ -311,7 +311,7 @@ mod tests { let stored_out_data_reg = reg_builder().clock_domain(cd).reset(0u8); #[hdl] - if let HdlSome(data) = ReadyValid::fire_data(dut.out) { + if let HdlSome(data) = ReadyValid::firing_data(dut.out) { #[hdl] if out_index_reg.cmp_lt(index_max) { connect_any(out_index_reg, out_index_reg + 1u8);