The Full Slice: What a Cut Costs and Where to Put It
A slice buys clock speed and charges for it in three coins: cycles, flip-flops and, if you choose badly, half your throughput.
You Will Be Able To
- Describe a full slice, and say why it still moves one beat in every cycle.
- Count what slices cost a transfer in latency, and a design in flip-flops.
- Choose where to cut a path of several hops so that every piece fits the clock period.
- Lesson
- S4.16
- Time
- 26 min
- Runs on
- Your browser
- Check
- 5 questions
A team adds a small slice to the path between a DMA block and memory. Timing passes, and so does every test. A month later the copy of a large buffer takes twice as long as planned. Nothing is broken: the slice they chose can carry a beat only in every second cycle.
Before You Start
You need the forward slice and the backward slice from Register Slices. That page also gave the two paths of a channel, the spare register, and one cycle of latency for each slice.
| Question | |
|---|---|
| 1 | What is inside a full slice, and how many beats can it hold? |
| 2 | How does a full slice keep one beat per cycle, when a single register cannot? |
| 3 | What do slices add to the latency of a read? |
| 4 | How do you choose where to cut a path of several hops? |
| 5 | Which paths of a chip should have no slice at all? |
The Idea: Cut Both Paths, Then Count the Cost
A forward slice cuts the forward path and lets ready through. A backward slice cuts ready and lets the beat through. Put one after the other and no signal crosses as logic. That pair is a full slice.
A full slice holds up to two beats: one in its main register, one in its spare register. Because of the second place, it can take a new beat in every cycle and give one in every cycle. Its throughput, the number of beats per cycle, is still one.
A cheaper circuit also cuts both paths: one register that says "ready" only while it is empty. It needs a cycle to fill and a cycle to empty. So it carries one beat in every second cycle. This page calls it a half-rate slice.
Every slice has a price. It adds a cycle of latency to each beat that crosses it. It adds flip-flops. The work of the architect is to place as few as will make every path fit the clock period.
New Words
| Word | Meaning |
|---|---|
| Full slice | A slice that cuts both paths of a channel. It holds two beats and moves one beat per cycle. |
| Half-rate slice | One register that is ready only while empty. It cuts both paths and moves one beat in two cycles. |
| Throughput | The number of beats a channel moves per clock cycle, when both ends are willing. |
| Segment | The part of a path between two cuts, or between a cut and an end of the path. |
One Picture: Two Registers
- Processor
- Control / FSM
- Bus
- Memory
- Normal running
The receiver is ready. At every edge the main register passes one beat on and loads the next. One beat in, one beat out.
- The receiver stops
The main register keeps its beat. The sender does not know yet, and hands over one more. The spare register takes it.
- Both registers full
Now the slice holds two beats. Its ready to the sender falls. That ready comes from a flip-flop, and so does everything the receiver sees.
- The receiver goes on
It takes the beat of the main register. The waiting beat moves across. One edge later the sender may hand over again.
Read the diagram as text
- Sender: sees a ready that comes from a flip-flop
- Spare register: empty in normal running
- Main register: every beat passes through it
- Receiver: sees a valid and a payload that come from flip-flops
- Sender → Main register: beat
- Sender → Spare register: beat, when main is stuck
- Spare register → Main register: the waiting beat
- Main register → Receiver: beat
A full slice is a backward slice followed by a forward slice. No wire crosses it as logic, in either direction.
The spare register is empty nearly all the time. It earns its place in the one cycle after the receiver stops.
The Smallest Example, Worked by Hand: Where to Cut
A read address travels from a manager to a memory through four hops. The clock period is 7 ns. The delays of the hops are in the table.
| Hop | 1 | 2 | 3 | 4 | Sum |
|---|---|---|---|---|---|
| Delay, in ns | 3 | 2 | 4 | 3 | 12 |
The whole path takes 12 ns, and the period is 7 ns. So it fails. One cut gives two segments. There are three places for it.
| Cut after hop | First segment | Second segment | Longest | Fits 7 ns? |
|---|---|---|---|---|
| 1 | 3 | 2 + 4 + 3 = 9 | 9 | no |
| 2 | 3 + 2 = 5 | 4 + 3 = 7 | 7 | yes |
| 3 | 3 + 2 + 4 = 9 | 3 | 9 | no |
Only the cut after hop 2 works. It is the place that makes the longest segment as short as it can be. Now the cost. The read address takes one cycle more. If the reply comes back along the same hops, its channel needs a cut too. Request and reply together then take two cycles more.
The Rules
Rule 1: A full slice lets no signal cross it as logic.
Valid, the payload and ready all leave it from flip-flops.
Rule 2: A full slice moves one beat per cycle.
It can, because it has two places. One register that cuts both paths moves one beat in two cycles.
Rule 3: Each slice adds one cycle to each beat that crosses it.
A request and its reply use two channels. Together they cross the slices of both.
Rule 4: A slice costs one register of payload width, and a full slice two.
Wide channels, such as read data, are the expensive ones to cut.
Rule 5: Cut so that the longest segment is as short as possible.
A cut near one end leaves the other segment almost as long as before.
Rule 6: Leave the fastest route of the chip without a slice.
A processor waits for every access to its memory. A slow device does not notice one more cycle.
Sources for These Rules
Arm AMBA AXI Protocol Specification, document IHI 0022, issue L, section A2.5. Any number of register stages may sit on the valid and ready paths. Channels may differ in their number of stages, and each stage costs a cycle of latency. The same section describes a direct connection from a processor to fast memory, with slices on the longer paths to slower devices.
How a full slice and a half-rate slice are built, and rules 4 and 5, are common practice. The specification does not describe them.
Now Run It
The lab at the end of this page has a full slice in the middle of the channel. The sender has six beats. The receiver is not ready at e4.
e1 up: valid=1 data=a1 ready=1 | down: valid=0 data=xx ready=1 | handed over a1, taken --
e2 up: valid=1 data=a2 ready=1 | down: valid=1 data=a1 ready=1 | handed over a2, taken a1
e3 up: valid=1 data=a3 ready=1 | down: valid=1 data=a2 ready=1 | handed over a3, taken a2
e4 up: valid=1 data=a4 ready=1 | down: valid=1 data=a3 ready=0 | handed over a4, taken --
e5 up: valid=1 data=a5 ready=0 | down: valid=1 data=a3 ready=1 | handed over --, taken a3
e6 up: valid=1 data=a5 ready=1 | down: valid=1 data=a4 ready=1 | handed over a5, taken a4
e7 up: valid=1 data=a6 ready=1 | down: valid=1 data=a5 ready=1 | handed over a6, taken a5
e8 up: valid=0 data=a7 ready=1 | down: valid=1 data=a6 ready=1 | handed over --, taken a6
e9 up: valid=0 data=a7 ready=1 | down: valid=0 data=a7 ready=1 | handed over --, taken --
e10 up: valid=0 data=a7 ready=1 | down: valid=0 data=a7 ready=1 | handed over --, taken --
handed over 6, taken 6: a1 a2 a3 a4 a5 a6
last beat taken at e8Rule 3 at work: a1 is handed over at e1 and taken at e2. The picture at work: at e4 the receiver stops, and the sender still hands over a4, which goes to the spare register. At e5 the sender sees ready at 0.
Rule 2 needs a receiver that never stops. The next table has three runs of six beats each.
| In the middle of the channel | Last line of the lab | Edges per beat |
|---|---|---|
| wires only | last beat taken at e6 | 1 |
| a full slice | last beat taken at e7 | 1 |
| a half-rate slice | last beat taken at e12 | 2 |
Recorded from the lab. Change full_slice to half_slice in the lab to get the third run.
The full slice ends one edge later than the wires: that is its latency, paid once. The half-rate slice ends at e12. It pays one extra edge for every beat.
Now the paths. The last page measured a design of two hops with a synthesis tool. Here is the full table.
| Between the two hops | Longest path, in logic levels | Flip-flops |
|---|---|---|
| nothing | 15 | 136 |
| a forward slice | 9 | 153 |
| a backward slice | 19 | 153 |
| a full slice | 10 | 170 |
Measured with Yosys 0.70+290, generic gates. The numbers belong to this small design and this tool.
Rule 4 at work: each register of the slice costs 17 flip-flops here, and the full slice costs 34. The full slice brings the longest path from 15 levels to 10.
The forward slice alone reached 9. So in this design the full slice buys no extra speed, and costs 17 more flip-flops. Its gain is of another kind: no path crosses it at all. The two sides can be timed, placed and changed without regard to each other.
These labs leave things out. The design has two hops, so there is one place to cut. Logic levels ignore wire length. A real timing report gives delays in time, as the hand example does.
Why It Is Built This Way
| Design choice | The alternative | What the choice buys, and costs |
|---|---|---|
| A full slice with two registers | A half-rate slice with one | One beat per cycle, so a burst keeps its speed. Twice the flip-flops. |
| A different number of slices in each channel | The same number in all channels | Only the failing paths are cut, and only they pay latency. Each channel must be checked by itself. |
| No slice between processor and memory | Slices on every port, for an easy layout | The most frequent access stays as fast as it can be. That route must be kept short on the chip. |
A half-rate slice is not a mistake in itself. A register bank that is written once per second loses nothing by it. The choice needs a number: how many beats per cycle must this channel carry?
The Trap: A Slice That Passes Every Test
Back to the team from the top of the page. Their tests sent one beat, checked it, and sent the next. A half-rate slice passes all of that. Every beat arrives once, in order.
e1 up: valid=1 data=a1 ready=1 | down: valid=0 data=xx ready=1 | handed over a1, taken --
e2 up: valid=1 data=a2 ready=0 | down: valid=1 data=a1 ready=1 | handed over --, taken a1
e3 up: valid=1 data=a2 ready=1 | down: valid=0 data=a1 ready=1 | handed over a2, taken --
e4 up: valid=1 data=a3 ready=0 | down: valid=1 data=a2 ready=1 | handed over --, taken a2Look at the sender's ready: 1, 0, 1, 0. The slice refuses a beat in every second cycle. A burst of six beats takes twelve edges in place of seven.
No checker of the protocol objects, because waiting is legal. Only a measurement of throughput shows it. So test a slice with a sender that always has a beat and a receiver that is always ready. Then count the edges.
At Scale
This section looks ahead. The hand example has one path and three places to cut. A chip has thousands of paths.
A slice as a setting
Interconnect blocks are often delivered with a setting for each port and channel: no slice, forward, backward or full. Choosing them is a task of timing closure.
Latency is a budget
Each slice adds to the wait of every manager that crosses it. The next lesson, on quality of service, turns such waits into limits.
Where the delays come from
The Static Timing track shows how a path is checked against the clock period, starting with Setup and Hold.
Wide channels
A read data channel of a large chip can be hundreds of bits wide. A full slice on it costs twice that in flip-flops, for each port.
Try It
Run the lab. Find the edge at which the slice holds two beats.
Set READY to all ones. Compare the last line with the table of three runs.
Change full_slice to half_slice in the line that places the piece. Count the edges for six beats.
With full_slice, make the receiver stop for three edges in a row. Say why two places are still enough.
e1 up: valid=1 data=a1 ready=1 | down: valid=0 data=xx ready=1 | handed over a1, taken -- e2 up: valid=1 data=a2 ready=1 | down: valid=1 data=a1 ready=1 | handed over a2, taken a1 e3 up: valid=1 data=a3 ready=1 | down: valid=1 data=a2 ready=1 | handed over a3, taken a2 e4 up: valid=1 data=a4 ready=1 | down: valid=1 data=a3 ready=0 | handed over a4, taken -- e5 up: valid=1 data=a5 ready=0 | down: valid=1 data=a3 ready=1 | handed over --, taken a3 e6 up: valid=1 data=a5 ready=1 | down: valid=1 data=a4 ready=1 | handed over a5, taken a4 e7 up: valid=1 data=a6 ready=1 | down: valid=1 data=a5 ready=1 | handed over a6, taken a5 e8 up: valid=0 data=a7 ready=1 | down: valid=1 data=a6 ready=1 | handed over --, taken a6 e9 up: valid=0 data=a7 ready=1 | down: valid=0 data=a7 ready=1 | handed over --, taken -- e10 up: valid=0 data=a7 ready=1 | down: valid=0 data=a7 ready=1 | handed over --, taken -- handed over 6, taken 6: a1 a2 a3 a4 a5 a6 last beat taken at e8Check Yourself
Common Mistakes
Wrong Cut both paths with one register that is ready only while empty.
It moves one beat in two cycles.
Fix Use a full slice with two places where throughput matters.
Wrong Count the latency of a slice once for a read.
The request and the reply use different channels, and each may be cut.
Fix Add the slices of both channels on the route.
Wrong Place the cut next to the block that the timing report names.
The other segment may still be too long.
Fix Choose the cut that makes the longest segment shortest.
Remember
- A full slice is a backward slice followed by a forward slice. No signal crosses it as logic.
- It holds two beats, and so it still moves one beat per cycle.
- A half-rate slice has one register and moves one beat in two cycles.
- Each slice adds one cycle per beat; a read pays on the request channel and on the reply channel.
- Cut where the longest segment becomes shortest, and leave the fastest route uncut.