Skip to content

Commit

Permalink
fix: values update
Browse files Browse the repository at this point in the history
  • Loading branch information
Elizabeth-0 committed Nov 5, 2024
1 parent cbc00cc commit c3237a1
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,24 @@ async def test_comprehensive_functionality(dut):
# Test Frequency Selection (indirectly via `uo_out` observation)
await send_uart_byte(dut, 0b00000001) # Frequency byte, expect a unique pattern on `uo_out`
await ClockCycles(dut.clk, 500)
initial_uo_out = dut.uo_out.value.integer

# Ensure `uo_out` does not contain 'x' or 'z' before accessing it
initial_uo_out = dut.uo_out.value
if "x" in str(initial_uo_out) or "z" in str(initial_uo_out):
dut._log.warning("uo_out contains unknown ('x') or high-impedance ('z') states after frequency selection command.")
await ClockCycles(dut.clk, 500)

initial_uo_out_int = dut.uo_out.value.integer
await ClockCycles(dut.clk, 1000)
new_uo_out = dut.uo_out.value.integer
assert initial_uo_out != new_uo_out, "Expected frequency effect on uo_out"
new_uo_out_int = dut.uo_out.value.integer

assert initial_uo_out_int != new_uo_out_int, "Expected frequency effect on uo_out"

# Test Waveform Selection (indirectly via `uo_out` pattern observation)
await send_uart_byte(dut, 0b01000010) # Waveform byte, expect square wave pattern
await ClockCycles(dut.clk, 500)
wave_pattern_observed = any(dut.uo_out.value.integer != initial_uo_out for _ in range(10))

wave_pattern_observed = any(dut.uo_out.value.integer != initial_uo_out_int for _ in range(10))
assert wave_pattern_observed, "Expected waveform pattern on uo_out"

# Test ADSR Modulation (observe non-zero `uo_out` upper bits)
Expand Down

0 comments on commit c3237a1

Please sign in to comment.