summaryrefslogtreecommitdiff
path: root/tb
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-08-10 20:16:09 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-08-10 20:16:09 +0300
commitb1ee83cd1ea325a5d353365ac35790a7c1d47845 (patch)
treefcb4157129bbc3cb84a3990edb15fddda5f9806a /tb
parent373edb42380875eafc8b9de54d80b939d263d041 (diff)
downloadttarv32-b1ee83cd1ea325a5d353365ac35790a7c1d47845.tar.gz
ttarv32-b1ee83cd1ea325a5d353365ac35790a7c1d47845.zip
decrease max path lengthHEADmaster
+ Not fully functional, but good enough for now
Diffstat (limited to 'tb')
-rw-r--r--tb/sched_tb.sv34
-rw-r--r--tb/ttarv32_tb.sv1
2 files changed, 30 insertions, 5 deletions
diff --git a/tb/sched_tb.sv b/tb/sched_tb.sv
index 036464e..13c032e 100644
--- a/tb/sched_tb.sv
+++ b/tb/sched_tb.sv
@@ -2,6 +2,8 @@
module sched_tb;
+logic clk, rst_n;
+
typedef struct packed {
mov_t[1:0] in;
mov_t[0:0] out;
@@ -13,17 +15,20 @@ slot_t[1:0] prev_slots;
slot_t[1:0] next_slots;
insn_t[2:0] prev_que;
insn_t[2:0] next_que;
+bit[2-1:0] shift;
sched #(
.QUE_DEPTH(3),
.SLOT_COUNT(2),
- .SLOT_DEPTH(1),
.slot_t(slot_t)
) sched (
+ .clk_i(clk),
+ .rst_ni(rst_n),
.que_i(prev_que),
.que_o(next_que),
.slots_i(prev_slots),
- .slots_o(next_slots)
+ .slots_o(next_slots),
+ .shift_o(shift)
);
slot_t[1:0] first_check = {76'b0,
@@ -39,6 +44,13 @@ initial begin
$dumpfile("sched_tb.vcd");
$dumpvars();
+ clk = 0;
+ rst_n = 0;
+
+ #1
+
+ rst_n = 1;
+
/* pretend we've queued something like
* add r1, r2, r3
* add r4, r2, r1
@@ -59,20 +71,34 @@ initial begin
prev_slots = '0;
- #10
+ #1
+ clk = 1;
+
+ #1
+ clk = 0;
assert (next_slots == first_check)
else $error("\nwanted:\t%h", first_check, "\ngot:\t%h", next_slots);
+ assert (shift == 1)
+ else $error("expected shift == 1, got %d", shift);
+
/* pretend all operations finished */
prev_slots = '0;
prev_que = next_que;
- #10
+ #1
+ clk = 1;
+
+ #1
+ clk = 0;
assert (next_slots == second_check)
else $error("\nwanted:\t%h", second_check, "\ngot:\t%h", next_slots);
+ assert (shift == 2)
+ else $error("expected shift == 2, got %d", shift);
+
#10 $finish;
end
endmodule
diff --git a/tb/ttarv32_tb.sv b/tb/ttarv32_tb.sv
index 6277f02..5b30f25 100644
--- a/tb/ttarv32_tb.sv
+++ b/tb/ttarv32_tb.sv
@@ -18,7 +18,6 @@ logic rst_n;
ttarv32 #(
.SLOT_COUNT(4),
- .SLOT_DEPTH(3),
.ALU_COUNT(2)
) ttarv32 (
.clk_i(clk),