Keep the peripheral selected for the whole write while the next address is already on the fast bus.
Hardware context: ap_soc AHB-to-APB branch. Peripheral integration
Implement the route controller for a two-device APB branch. An upstream decoder supplies offer and the target bit gpio. The datapath holds the payload separately.
Each sample shows outputs after a rising edge. Inputs describe the cycle ending at that edge. Samples form one continuous run.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
sample | 12 | input of each check |
Full specification
Synchronous active-low reset cancels any transfer and drops all outputs. While idle, accept an offer on the rising edge. gpio selects GPIO when high and UART otherwise.
After acceptance, spend one full cycle in setup, then enter access. Select only the saved device in both phases. Raise enable only during access.
Ignore new offers during setup and stalled access. Hold access while pready is low. At a ready access edge accept a new offer directly into setup or return to idle.
Examples
Example 1
Cancel the Port- Input
reset_n=0, offer=0, gpio=0, pready=0
- Output
uart_sel = 0, gpio_sel = 0, enable = 0
All peripheral outputs fall.
Example 2
Start a UART Write- Input
reset_n=1, offer=1, gpio=0, pready=0
- Output
uart_sel = 1, gpio_sel = 0, enable = 0
The selected target sees its setup cycle.
Example 3
Change the Offered Target- Input
reset_n=1, offer=0, gpio=1, pready=1
- Output
uart_sel = 1, gpio_sel = 0, enable = 1
The existing write advances to access on UART.
Constraints and Contract
- Drive uart_sel, gpio_sel and enable between edges from the saved transfer. Treat offer as a candidate, including during waits.
Hints
Hint 1
Draw a row for the cycle before the edge.
Hint 2
Mark the edges where a new destination can take effect.
Hint 3
Try changing gpio during a long access.
What the grader checks: Two decoded targets on one clock, including replacement and reset in flight.
289 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 2 problems on this path