7 | def StopWatch(tens_led, ones_led, tenths_led, startstop, reset, clock): |

8 | |

9 | """ 3 digit stopwatch with seconds and tenths of a second. |

10 | |

11 | tens_led: 7 segment led for most significant digit of the seconds |

12 | ones_led: 7 segment led for least significant digit of the seconds |

13 | tenths_led: 7 segment led for tenths of a second |

14 | startstop: input that starts or stops the stopwatch on a posedge |

15 | reset: reset input |

16 | clock: 10Hz clock input |

17 | |

18 | """ |

19 | |

20 | tens, ones, tenths = [Signal(intbv(0)[4:]) for i in range(3)] |

21 | |

22 | timecount_inst = TimeCount(tens, ones, tenths, startstop, reset, clock) |

23 | bcd2led_tens = bcd2led(tens_led, tens, clock) |

24 | bcd2led_ones = bcd2led(ones_led, ones, clock) |

25 | bcd2led_tenths = bcd2led(tenths_led, tenths, clock) |

26 | |

27 | return timecount_inst, bcd2led_tens, bcd2led_ones, bcd2led_tenths |