forked from greatscottgadgets/luna
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gateware: extracted the remaining tests from their modules into the `…
…tests` module tree
- Loading branch information
Showing
8 changed files
with
246 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
from sol_usb.gateware.test import SolGatewareTestCase, sync_test_case | ||
|
||
from sol_usb.gateware.architecture.car import PHYResetController | ||
|
||
class PHYResetControllerTest(SolGatewareTestCase): | ||
FRAGMENT_UNDER_TEST = PHYResetController | ||
|
||
def initialize_signals(self): | ||
yield self.dut.trigger.eq(0) | ||
|
||
@sync_test_case | ||
def test_power_on_reset(self): | ||
|
||
# | ||
# After power-on, the PHY should remain in reset for a while. | ||
# | ||
yield | ||
self.assertEqual((yield self.dut.phy_reset), 1) | ||
|
||
yield from self.advance_cycles(30) | ||
self.assertEqual((yield self.dut.phy_reset), 1) | ||
|
||
yield from self.advance_cycles(60) | ||
self.assertEqual((yield self.dut.phy_reset), 1) | ||
|
||
# | ||
# Then, after the relevant reset time, it should resume being unasserted. | ||
# | ||
yield from self.advance_cycles(31) | ||
self.assertEqual((yield self.dut.phy_reset), 0) | ||
self.assertEqual((yield self.dut.phy_stop), 1) | ||
|
||
yield from self.advance_cycles(120) | ||
self.assertEqual((yield self.dut.phy_stop), 0) |
Oops, something went wrong.