chore: remove debug logging statements and fix clock propagation

This commit is contained in:
Jan-Peter von Hunnius 2026-02-26 20:07:05 +01:00
parent a2f485df5b
commit 6e245b615e
3 changed files with 2 additions and 33 deletions

View file

@ -73,6 +73,7 @@ impl TwoPhaseClock {
let connection_count = pin_guard.get_connected_pins().len(); let connection_count = pin_guard.get_connected_pins().len();
if connection_count > 0 { if connection_count > 0 {
pin_guard.propagate(); pin_guard.propagate();
pin_guard.propagate();
} }
} }
} }

View file

@ -1563,20 +1563,11 @@ mod tests {
std::thread::sleep(Duration::from_millis(2)); std::thread::sleep(Duration::from_millis(2));
assert!(sm.is_latency_elapsed()); assert!(sm.is_latency_elapsed());
// Latency elapsed should transition to DriveData
println!(
"DEBUG: Before LatencyElapsed event, state: {:?}",
sm.get_state()
);
// Ensure state machine is in WaitLatency state before processing LatencyElapsed // Ensure state machine is in WaitLatency state before processing LatencyElapsed
assert_eq!(sm.get_state(), Intel400xUnifiedState::WaitLatency); assert_eq!(sm.get_state(), Intel400xUnifiedState::WaitLatency);
process_event_direct(&mut sm, Intel400xEvent::LatencyElapsed); process_event_direct(&mut sm, Intel400xEvent::LatencyElapsed);
println!(
"DEBUG: After LatencyElapsed event, state: {:?}",
sm.get_state()
);
assert_eq!(sm.get_state(), Intel400xUnifiedState::DriveData); assert_eq!(sm.get_state(), Intel400xUnifiedState::DriveData);
// Note: behavior.state_entry_called is not called with process_event_direct // Note: behavior.state_entry_called is not called with process_event_direct
// assert!(behavior.state_entry_called); // assert!(behavior.state_entry_called);

View file

@ -1179,15 +1179,6 @@ mod tests {
phi1_guard.set_driver(Some("TEST".to_string()), PinValue::High); phi1_guard.set_driver(Some("TEST".to_string()), PinValue::High);
} }
// Debug: Check pin states before update
println!(
"DEBUG: Before update - SYNC: {:?}, CM: {:?}, CI: {:?}, PHI1: {:?}",
sync_pin.lock().unwrap().read(),
cm_pin.lock().unwrap().read(),
ci_pin.lock().unwrap().read(),
phi1_pin.lock().unwrap().read()
);
// Debug: Check conditions that would trigger memory operation // Debug: Check conditions that would trigger memory operation
let sync = rom.read_sync_pin(); let sync = rom.read_sync_pin();
let chip_select = rom.read_cm_rom_pin(); let chip_select = rom.read_cm_rom_pin();
@ -1200,20 +1191,6 @@ mod tests {
sync && chip_select && !io_select sync && chip_select && !io_select
); );
// Debug: Check edge detection
println!("DEBUG: Before update - prev_phi1: {:?}", rom.prev_phi1);
// Debug: Check what read_clock_pins returns
let (read_phi1, _) = rom.read_clock_pins();
println!("DEBUG: read_clock_pins() returns PHI1: {:?}", read_phi1);
// Debug: Check edge detection logic manually
let phi1_rising = read_phi1 == PinValue::High && rom.prev_phi1 == PinValue::Low;
println!(
"DEBUG: Manual edge detection - PHI1: {:?}, prev_phi1: {:?}, rising: {}",
read_phi1, rom.prev_phi1, phi1_rising
);
// Update to process Φ1 rising edge // Update to process Φ1 rising edge
rom.update(); rom.update();