Skip to content

Commit

Permalink
Remove latch from bus_rx_flow logic
Browse files Browse the repository at this point in the history
Internal-tag: [#71746]
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
  • Loading branch information
mkurc-ant committed Jan 17, 2025
1 parent 061932c commit 0709f92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/ctrl/bus_rx_flow.sv
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ module bus_rx_flow (
end

always_comb begin : update_output_data_value
if (~rst_ni) begin
rx_data_o = '0;
end else if (rx_req_bit) begin
if (rx_req_bit) begin
rx_data_o = {{7{1'b0}}, rx_bit};
end else if (rx_req_byte_i) begin
end else begin
rx_data_o = {rx_data[6:0], sda_i};
end
end
Expand Down
2 changes: 1 addition & 1 deletion verification/cocotb/block/bus_rx_flow/test_bus_rx_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ async def setup_test(dut):
await ClockCycles(dut.clk_i, 10)

assert dut.rx_done_o.value == 0
assert dut.rx_data_o.value == 0
assert dut.rx_idle_o.value == 1


Expand All @@ -74,6 +73,7 @@ async def test_multiple_bit_reads(dut):
result = await First(scl_negedge, done_posedge)

if result == done_posedge:
await RisingEdge(dut.clk_i)
assert dut.rx_data_o.value == d
dut.rx_req_bit_i.value = 0
dut._log.debug(f"Bit correct, rx_data_o: {dut.rx_data_o.value}, expected: {d}")
Expand Down

0 comments on commit 0709f92

Please sign in to comment.