Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rob #6

Open
wants to merge 29 commits into
base: Dawn
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1d76d91
added cdb file and moved rob into verilog folder
RishThakkar Mar 31, 2024
6395b97
removed rob.sv from verilog to avoid merge conflicts
RishThakkar Mar 31, 2024
a03b5fa
pulled free_list from pranav
KPK101 Apr 1, 2024
34a1ffd
update free list
KPK101 Apr 1, 2024
61975a4
update free list
KPK101 Apr 1, 2024
c7bdc65
Update README.md
KPK101 Apr 1, 2024
a21be0b
Update README.md
KPK101 Apr 1, 2024
a74b359
Merge branch 'main' into rishit
RishThakkar Apr 2, 2024
fea8283
CDB update, more additions required
RishThakkar Apr 2, 2024
62a9e18
Update free_list.sv
ritwikgoel Apr 4, 2024
70a97db
Update mapped_vars.MD
KPK101 Apr 8, 2024
8b71f2a
Lord please dont break
ritwikgoel Apr 8, 2024
b815abf
half completed dispatch
patelp1003 Apr 9, 2024
f25e3fc
worked on dispatch logic
patelp1003 Apr 9, 2024
b47e6d3
Merge pull request #3 from KPK101/dispatch
patelp1003 Apr 9, 2024
c04f058
missed one change in dispatch. also adding tb for maptable
patelp1003 Apr 10, 2024
cf939f6
Merge pull request #4 from KPK101/dispatch
patelp1003 Apr 10, 2024
281e832
added fetch
patelp1003 Apr 12, 2024
64879d5
Merge pull request #5 from KPK101/dispatch
patelp1003 Apr 12, 2024
5e996f8
Reformat and test
Apr 12, 2024
71122b5
Standardize module I/O, Implement dispatch, Create skeleton for every…
Apr 12, 2024
aaf3f3c
Merge branch 'main' of github.com:KPK101/Triple-O-R10K into sr3992-su…
Apr 12, 2024
e348a72
Add prf, Implement Ex, Start working on Complete stage.
Apr 18, 2024
07884e3
Implement interrupt logic
Apr 24, 2024
d358abf
Attempt to implement store and pipeline output
Apr 25, 2024
e8eaa0f
adding fixed sys_def
patelp1003 Apr 25, 2024
7e09d8d
Add rob test
Apr 25, 2024
4a68c8f
rob test
Apr 27, 2024
8eb67fa
rob test complete
dawn-yoo Apr 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ GREP = grep -E --color=auto

# TODO: add more modules here
#TESTED_MODULES = mult rob
TESTED_MODULES = rs
TESTED_MODULES = rob
# TODO: add verilog module dependencies here:
# (do not include header files)
# Helper function:
Expand All @@ -174,10 +174,10 @@ MULT_DEPS = verilog/mult_stage.sv
$(call DEPS,mult): $(MULT_DEPS)

# No dependencies for the rob (TODO: add any you create)
ROB_DEPS =
ROB_DEPS = verilog/rob.sv
$(call DEPS,rob): $(ROB_DEPS)

RS_DEPS =
RS_DEPS = verilog/rs.sv
$(call DEPS, rs): $(RS_DEPS)

# This allows you to use the following make targets:
Expand Down Expand Up @@ -309,15 +309,16 @@ HEADERS = verilog/sys_defs.svh \
TESTBENCH = test/pipeline_test.sv \
test/pipeline_print.c \
test/mem.sv \
test/rs_test.sv
test/rs_test.sv \
test/rob_test.sv

# you could simplify this line with $(wildcard verilog/*.sv) - but the manual way is more explicit
SOURCES = verilog/pipeline.sv \
verilog/regfile.sv \
verilog/icache.sv \
verilog/mult.sv \
verilog/mult_stage.sv \
verilog/rs.sv \
verilog/rs.sv

SYNTH_FILES = synth/pipeline.vg

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Triple-O R10K

An out of order processor based on R10K

The modules currently functional are:

`Reservation Station`

`Reorder Buffer`

`Free List`

`MAP Table`
2 changes: 1 addition & 1 deletion documentation/mapped_vars.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# define PHYS_REG_SZ (32 + `ROB_SZ)
## define PHYS_REG_SZ (32 + `ROB_SZ)
Physical Register for the support of register renaming.

65 changes: 0 additions & 65 deletions rob.sv

This file was deleted.

86 changes: 86 additions & 0 deletions test/map_table_test.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
`timescale 1ns / 1ps
`include "verilog/sys_defs.svh"
`include "verilog/ISA.svh"

module map_table_tb;

// Define testbench signals based on the map_table module's interface
reg clock;
reg reset;
reg CDB_enable;
TAG T, T1, T2, CDB;
logic write_en;
reg [4:0] reg_1, reg_2, dest_reg;
TAG new_tag, T_old;

// Instantiate the map_table
map_table dut (
.clock(clock),
.reset(reset),
.read_idx_1(reg_1),
.read_idx_2(reg_2),
.read_out_1(T1),
.read_out_2(T2),

.write_en(write_en),
.write_idx(dest_reg),
.write_tag(new_tag),
.write_out(T_old)
);

// Clock generation
initial begin
clock = 0;
forever #5 clock = ~clock;
/*assert property(@(posedge clock)
if(command_inp == READ)
T1 && T1_out

);*/
end


// Test stimulus
initial begin
// Initialize inputs

$display("STARTING TESTBENCH!");

reset = 1;
$display("@@@ Time:%4.0f clock:%b reset:%b T1:%b T2:%b reg_1:%b reg_2:%b write_en:%b dest_reg:%b new_tag:%b T_old:%b", $time, clock, reset, T1, T2,reg_1, reg_2, write_en, dest_reg, new_tag, T_old);

$monitor("@@@ Time:%4.0f clock:%b reset:%b T1:%b T2:%b reg_1:%b reg_2:%b write_en:%b dest_reg:%b new_tag:%b T_old:%b", $time, clock, reset, T1, T2,reg_1, reg_2, write_en, dest_reg, new_tag, T_old);
// Release reset
#10;
reset = 0;
CDB_enable = 0;
// Test read functionality of tags
#10;
reg_1 = 1;
reg_2 = 2;

#10;
reg_1 = 10;
reg_2 = 12;

#10;
write_en = 1;
dest_reg = 2;
new_tag.tag = 5;
new_tag.valid = 1;
new_tag.valid = 0;

// Continue simulation for a while to observe behavior
#10;
$display("\nENDING TESTBENCH: SUCCESS!");
$display("@@@ Passed\n");
$finish; // End simulation
end

// Initialize signals for waveform generation
initial begin
$dumpfile("map_table_tb.vcd");
$dumpvars(0, map_table_tb);
end

endmodule
115 changes: 115 additions & 0 deletions test/rob_test.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
`include "verilog/sys_defs.svh"
// test ROB_SZ = 4
module rob_test;

// TAG : valid, phys_reg, ready
// DUT I/O
logic clock;
logic reset;
logic [$clog2(`ROB_SZ):0] counter;
logic [$clog2(`ROB_SZ)-1:0] head_idx;
logic [$clog2(`ROB_SZ)-1:0] tail_idx;
//logic [$clog2(`ROB_SZ):0] next_counter;
ID_ROB_PACKET id_rob; // t_in, t_old_in, write_en
IC_ROB_PACKET ic_rob; // complete_idx, complete_en

ROB_ID_PACKET rob_id; // free_idx, free
ROB_IR_PACKET rob_ir; // retire_t, retire_t_old, retire_en

rob rob_dut (
.clock(clock),
.reset(reset),
.counter(counter),
.head_idx(head_idx),
.tail_idx(tail_idx),
//.next_counter(next_counter),
.id_rob_packet(id_rob),
.ic_rob_packet(ic_rob),
.rob_id_packet(rob_id),
.rob_ir_packet(rob_ir)
);



// CLOCK_PERIOD is defined on the commandline by the makefile
always begin
#(`CLOCK_PERIOD/2.0);
clock = ~clock;
end

initial begin
// setup monitor and reset signals
$monitor("time: %3.0d id_rob_write_en: %b ic_rob_complete_idx: %2.0d ic_rob_complete_en: %b rob_id_free_idx: %2.0d rob_id_free: %b rob_ir_retire_en: %b counter: %d head_idx: %d tail_idx: %d\n",
$time, id_rob.write_en, ic_rob.complete_idx, ic_rob.complete_en, rob_id.free_idx, rob_id.free, rob_ir.retire_en, counter, head_idx, tail_idx);

clock = 1'b0;
@(posedge clock)
reset = 1'b1;
@(posedge clock)
reset = 1'b0;
@(posedge clock)
/*first index*/
// id_rob
id_rob.write_en = 1'b1;
ic_rob.complete_idx = 2'b00;
ic_rob.complete_en = 1'b0;

/*second index*/
@(posedge clock)
id_rob.write_en = 1'b1;
ic_rob.complete_en = 1'b0;


/*third index*/
@(posedge clock)
id_rob.write_en = 1'b1;
ic_rob.complete_en = 1'b0;

/*fourth index*/
@(posedge clock)
id_rob.write_en = 1'b1;
ic_rob.complete_en = 1'b0; // full now

/*fifth index*/
@(posedge clock)
id_rob.write_en = 1'b0;
ic_rob.complete_en = 1'b0;

/*sixth index*/
@(posedge clock)
id_rob.write_en = 1'b0;
// ic_rob --> first index is complete
ic_rob.complete_idx = 2'b00;
ic_rob.complete_en = 1'b1;
@(posedge clock)
id_rob.write_en = 1'b0;
ic_rob.complete_en = 1'b0;

@(posedge clock)
id_rob.write_en = 1'b1;
ic_rob.complete_idx = 2'b01;
ic_rob.complete_en = 1'b1; // write & retire happens at the same time

@(posedge clock)
id_rob.write_en = 1'b1;
ic_rob.complete_idx = 2'b01;
ic_rob.complete_en = 1'b0;

@(posedge clock)
ic_rob.complete_idx = 2'b01;
ic_rob.complete_en = 1'b0;

id_rob.write_en = 1'b0;

@(posedge clock)
ic_rob.complete_en = 1'b1;
id_rob.write_en = 1'b1;
#60;
$display("\nENDING TESTBENCH: SUCCESS!");
$display("@@@ Passed\n");
$finish; // End simulation
end
endmodule



Binary file added verilog/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion verilog/decoder.sv
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module decoder (
output logic rd_mem, wr_mem, cond_branch, uncond_branch,
output logic csr_op, // used for CSR operations, we only use this as a cheap way to get the return code out
output logic halt, // non-zero on a halt
output logic illegal // non-zero on an illegal instruction
output logic illegal, // non-zero on an illegal instruction
);

// Note: I recommend using an IDE's code folding feature on this block
Expand Down
43 changes: 0 additions & 43 deletions verilog/dispatch.sv

This file was deleted.

Loading