S2.6.2 Find the Long Path

MediumImplement22 minIcarus Verilog · serverReview the topic

A single-cycle datapath has eight block delays. Add up the path of each kind of instruction, name the critical path, and say which speed-up helps.

Hardware context: The single-cycle datapath of ap_rv32_sc with a delay behind each block, in levels of gates measured by Yosys on the real blocks, and the logic-depth report of the whole core. Reading a timing report and deciding where to spend effort on speed

A team builds the single-cycle datapath of the lesson with its own blocks. The table gives the delay of each block in levels of gates. Multiplexers count as nothing. The clock period must be one level longer than the longest path, as in the lab of the lesson.

This worksheet uses named constants. The first three entries show how to record your decisions.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
The delay of each block
The decoder and the register read work side by side. So do the branch compare and the target adder.
BlockLevels
Instruction memory12
Decoder, with the immediate8
Register file, read6
ALU30
Branch compare9
A 32-bit adder: the target, and the PC plus 425
Data memory15
Load unit3

Enter every value in decimal, in levels. Some entries ask for a kind of instruction. There, enter 1 for arithmetic, 2 for a load, 3 for a store, or 4 for a branch.

EntryYour decision
WORD_TO_OPERANDSHow many levels after the clock edge are the operands and the control signals of an instruction ready?
ADD_PATHHow long is the path of an add, to the input of the register file?
LOAD_PATHHow long is the path of a load?
STORE_PATHHow long is the path of a store, to the address input of the data memory?
COMPARE_PATHHow long is the path of a branch through the branch compare?
TARGET_PATHHow long is the path of a branch through the target adder?
BRANCH_PATHHow long is the path of a branch, then?
CRITICAL_KINDWhich kind of instruction has the critical path?
MIN_PERIODWhat is the shortest clock period?
MIN_PERIOD_NO_LOADSWhat would the shortest period be for a core that never runs a load?
PERIOD_FASTER_COMPAREThe branch compare is rebuilt with 2 levels. What is the shortest period now?
PERIOD_ALU_20The ALU is rebuilt with 20 levels, and the compare is as at first. What is the shortest period now?
PERIOD_ALU_5An ALU of 5 levels, if it could be built: what is the shortest period?
CRITICAL_KIND_ALU_5Which kind of instruction has the critical path with that ALU?
MIN_PERIOD_FOR_KThe data memory has K levels, and every other block is as in the table. Give the shortest clock period, as an expression in K.

Examples

Example 1

WORD TO OPERANDS
Input
How many levels after the clock edge are the operands and the control signals of an instruction ready?
Output
matches = 1

The instruction memory, 12, then the slower of decoder and register read: 8.

Example 2

ADD PATH
Input
How long is the path of an add, to the input of the register file?
Output
matches = 1

The first part, 20, and the ALU, 30.

Example 3

LOAD PATH
Input
How long is the path of a load?
Output
matches = 1

The path of an add, then the data memory, 15, and the load unit, 3.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For MIN_PERIOD_FOR_K, enter a constant expression using K. Only this entry changes with the parameter. The supported integer range is 15 through 100, inclusive.

Hints

Hint 1

For each kind of instruction, list the blocks that its value passes, in order.

Hint 2

Where two blocks work at the same time, take only the slower one.

Hint 3

When a block gets faster, work out every path again. The critical path may be another one now.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

15 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

Report a problem with this page

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

WORD TO OPERANDS

Input
How many levels after the clock edge are the operands and the control signals of an instruction ready?
Expected output
matches = 1

The instruction memory, 12, then the slower of decoder and register read: 8.

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

Icarus Verilog · server