Turn three devices’ pull-low intentions into the ideal SDA and SCL levels, and flag an incompatible high driver.
Hardware context: Open-drain I2C controllers and register targets. Preserve ninth-bit ownership, stretching, arbitration, combined reads and bounded recovery.
Turn three devices’ pull-low intentions into the ideal SDA and SCL levels, and flag an incompatible high driver.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
scl | 1 | stimulus, the same for every design |
sda | 1 | stimulus, the same for every design |
csl | 1 | stimulus, the same for every design |
cdl | 1 | stimulus, the same for every design |
tsl | 1 | stimulus, the same for every design |
tdl | 1 | stimulus, the same for every design |
c2sl | 1 | stimulus, the same for every design |
c2dl | 1 | stimulus, the same for every design |
high_drive | 1 | stimulus, the same for every design |
Full specification
sda_high is one exactly when all three SDA low intentions are zero; scl_high follows the same rule for SCL. A zero low intention means release, never an actively driven high.
contention is one exactly when high_drive overlaps at least one SDA low intention. It stays zero for a high driver alone; that driver still violates open-drain design, but there is no opposing low driver in that instant.
Outputs update combinationally. The fixture samples settled driver views during real shared-bench traffic, including stretching and a second controller. sda_high is the ideal low-dominant result; contention identifies cases where an actual four-state simulator may resolve x. RC rise time is outside this model.
Examples
Example 1
Idle Pull-Ups- Input
Idle pull-ups
- Output
driver_view_errors = 0
Any device pulling low holds the ideal line low. Count contention only while a high driver and a low driver oppose each other.
Example 2
Register Read- Input
Register read
- Output
driver_view_errors = 0
Any device pulling low holds the ideal line low. Count contention only while a high driver and a low driver oppose each other.
Example 3
Target Extends SCL LOW- Input
Target extends SCL LOW
- Output
driver_view_errors = 0
Any device pulling low holds the ideal line low. Count contention only while a high driver and a low driver oppose each other.
Constraints and Contract
- Implement combinational i2c_driver_view. sda_lows and scl_lows each contain the three devices’ active-high pull-low intentions. high_drive reports a faulty push-pull SDA driver.
Hints
Hint 1
Write down which device owns each wire at the observation edge.
Hint 2
Separate framing and data state; decide what a new frame resets.
Hint 3
Check the shortest legal transfer and the boundary where a counter wraps.
What the grader checks: The fixture drives real pins through the shared serial library. Results check the specified digital contract. Electrical rise time, analog noise and hardware CDC signoff are outside this simulation.
6 checks on Icarus Verilog · browser. Run the examples first, then check the full regression. The suite is local and inspectable. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 1 steps and the final capstone