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
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Block | Levels |
|---|---|
| Instruction memory | 12 |
| Decoder, with the immediate | 8 |
| Register file, read | 6 |
| ALU | 30 |
| Branch compare | 9 |
| A 32-bit adder: the target, and the PC plus 4 | 25 |
| Data memory | 15 |
| Load unit | 3 |
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.
| Entry | Your decision |
|---|---|
| WORD_TO_OPERANDS | How many levels after the clock edge are the operands and the control signals of an instruction ready? |
| ADD_PATH | How long is the path of an add, to the input of the register file? |
| LOAD_PATH | How long is the path of a load? |
| STORE_PATH | How long is the path of a store, to the address input of the data memory? |
| COMPARE_PATH | How long is the path of a branch through the branch compare? |
| TARGET_PATH | How long is the path of a branch through the target adder? |
| BRANCH_PATH | How long is the path of a branch, then? |
| CRITICAL_KIND | Which kind of instruction has the critical path? |
| MIN_PERIOD | What is the shortest clock period? |
| MIN_PERIOD_NO_LOADS | What would the shortest period be for a core that never runs a load? |
| PERIOD_FASTER_COMPARE | The branch compare is rebuilt with 2 levels. What is the shortest period now? |
| PERIOD_ALU_20 | The ALU is rebuilt with 20 levels, and the compare is as at first. What is the shortest period now? |
| PERIOD_ALU_5 | An ALU of 5 levels, if it could be built: what is the shortest period? |
| CRITICAL_KIND_ALU_5 | Which kind of instruction has the critical path with that ALU? |
| MIN_PERIOD_FOR_K | The 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