Tomasulo Reservation Station Entry

Intel

Problem Description

This module implements one reservation station entry from Tomasulo's out-of-order execution algorithm.

When issue pulses and the entry is free, it loads the operation code and both source operands — operands already known are stored as values, while unresolved operands store a 2-bit producer tag.

Every clock the entry snoops the Common Data Bus: when cdb_valid is high and cdb_tag matches a stored pending tag, the value is captured and that operand is marked ready. ready_to_dispatch asserts combinationally the moment entry_busy is high and both rj and rk flags are set.

On flush the entry clears completely; flush has priority over all other inputs including cdb_valid and issue. On asynchronous reset every register returns to zero immediately, without waiting for a clock edge.

Screenshot 2026-03-29 at 12.33.17 PM

Interface Definition

Port

Direction

Width

Description

clk

input

1

Positive-edge triggered clock

reset

input

1

Active-high asynchronous reset — clears all registers instantly

flush

input

1

Level — clears entry (dispatch or misprediction). Highest priority

issue

input

1

Pulse — load new instruction this cycle. Ignored if entry already busy

src1_val

input

8

Value of source operand 1. Valid only when src1_ready=1

src1_ready

input

1

1 = Vj is known now; 0 = waiting on CDB for tag src1_tag

src1_tag

input

2

Producer tag for source 1. Stored when src1_ready=0

src2_val

input

8

Value of source operand 2. Valid only when src2_ready=1

src2_ready

input

1

1 = Vk is known now; 0 = waiting on CDB for tag src2_tag

src2_tag

input

2

Producer tag for source 2. Stored when src2_ready=0

op_in

input

4

Operation code to store in this entry

cdb_valid

input

1

1 = CDB is broadcasting a result this cycle

cdb_tag

input

2

Tag of the result being broadcast on CDB

cdb_val

input

8

Value of the result being broadcast on CDB

entry_busy

output

1

Registered — high while entry holds a valid instruction

ready_to_dispatch

output

1

Combinational — high when busy AND both operands resolved

op

output

4

Stored operation code (registered)

vj

output

8

Resolved value of source operand 1 (registered)

vk

output

8

Resolved value of source operand 2 (registered)

Test Cases

Cycle

issue

src1_ready

src1_tag

src2_ready

cdb_valid

cdb_tag

busy_q

rj_q

rk_q

ready_to_dispatch

What happened?

1

1

1

—

1

0

—

0

0

0

0

issue seen before clock — entry still empty

2

0

—

—

—

0

—

1

1

1

1

both srcs ready — FIRES immediately ✓

3

1

0

10

1

0

—

0

0

0

0

issue with src1 waiting (tag=10)

4

0

—

—

—

0

—

1

0

1

0

entry busy, src1 parked — not ready ✗

5

0

—

—

—

1

10

1

0

1

0

CDB broadcasting tag=10 this cycle

6

0

—

—

—

0

—

1

1

1

1

src1 captured from CDB — FIRES ✓

7

flush=1

—

—

—

0

—

0

0

0

0

flush clears entry completely ✗

8

reset=1 (async)

0

0

0

0

reset mid-wait, instant clear ✗

Verilog

Code Editor Access

Log in to write, run and submit your solution to this interview question. It's free.

Output

Output goes here...