V3.4.2 The Board Side of Sixteen Pads

MediumImplement25 minIcarus · browser samples / server checksReview the topic

Write the board side of the chip's IO pads: who drives each pad, the pull-down, and the wire from IO6 to IO7. Count every fight between the chip and the board.

Hardware context: The board's devices as models on the pads of ap_soc v1.5: UART, GPIO, SPI flash, JTAG. Resolving the pads between the chip and the board.

Every pad has two possible drivers: the chip, through its output enable, and the board. A bench's pad model decides what the pad carries. It must also notice when both drive at different levels. On a real board that is two outputs shorted together. A model that quietly picks a winner turns it into a pass.

soc_tb's own board never fights the chip: it lets go of every pad whose output enable is on. This board also has hard drivers, such as a button or a jumper, so it must count fights.

Write the resolution of pad_board and its two counters. The tasks drive, let_go and pulse are given.

Signals in the Timeline

SignalWidthRole
scenario4input of each check
Full specification
Pad icarries
The chip drives (oe[i] = 1) and the board drives a different levelx: a fight
The chip drivesout[i]
The board drivesits level
Nobody drives pad 7, and the chip drives pad 6out[6]: the board wires IO6 to IO7, as on the soc_tb board
Nobody drives0: the board's pull-down

fights counts the moments a fight begins on a pad. changes[i] counts every change of pad i after time 0, to or from x included.

Examples

Example 1

The Chip Drives IO6; the Board's Wire Carries It to IO7 (Times Recorded on ap_soc)
Input
20 ns; chip oe=40 out=40; 10 ns; sample; 2000 ns; chip oe=40 out=0; 20 ns
Output
pads_at_end = 0x0, pads_in_middle = 0xc0, fights = 0, changes_io0 = 0, changes_io6 = 2, changes_io7 = 2, changes_io9 = 0, changes_io11 = 0

On ap_soc the chip raised IO6 and the board's wire raised IO7 with it; 2010 ns later both fell. The model must give the same: one change each on IO6 and IO7, both ways.

Example 2

The Board Drives, Lets Go, and Pulses a Pad
Input
drive(9, 1); 30 ns; sample; let_go(9); 20 ns; pulse(9, 40); 20 ns
Output
pads_at_end = 0x0, pads_in_middle = 0x200, fights = 0, changes_io0 = 0, changes_io6 = 0, changes_io7 = 0, changes_io9 = 4, changes_io11 = 0

The board drives IO9 high, lets go (the pull-down takes it to 0), then pulses it: four changes, no fight.

Example 3

A Fight on IO11, Then the Board Gives Way
Input
chip oe=800 out=0; drive(11, 1); 20 ns; sample; let_go(11); 20 ns; drive(11, 0); 20 ns
Output
pads_at_end = 0x0, pads_in_middle = 0x0, fights = 1, changes_io0 = 0, changes_io6 = 0, changes_io7 = 0, changes_io9 = 0, changes_io11 = 2

The chip drives IO11 low while the board drives it high: one fight. The pad reads x until the board lets go.

Constraints and Contract

  • Keep the module name, the ports, fights, changes and the three tasks.
  • Before each case the bench lets go of every pad and sets the counters to 0.

Hints

Hint 1

Compute the fight bits first: oe, hard and a difference of levels.

Hint 2

The wire from IO6 counts only when nobody drives IO7.

Hint 3

Compare with !== to see a change to or from x.

What the grader checks: Eight scripts of chip drives and board tasks. Each reports the pads at the end and at one marked moment; a pad at x reads as 0. It also reports the fights and the changes of five pads. The first case uses the times IO6 rose and fell in a recorded run of ap_soc v1.5.

8 checks on Icarus · browser samples / server checks. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain public samples only. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 3 problems on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

The Chip Drives IO6; the Board's Wire Carries It to IO7 (Times Recorded on ap_soc)

Input
20 ns; chip oe=40 out=40; 10 ns; sample; 2000 ns; chip oe=40 out=0; 20 ns
Expected output
pads_at_end = 0x0, pads_in_middle = 0xc0, fights = 0, changes_io0 = 0, changes_io6 = 2, changes_io7 = 2, changes_io9 = 0, changes_io11 = 0

On ap_soc the chip raised IO6 and the board's wire raised IO7 with it; 2010 ns later both fell. The model must give the same: one change each on IO6 and IO7, both ways.

Run samples executes all 3 public checks. Check all tests runs 8 checks on the server.

Icarus · browser samples / server checks