feat(L08): add subroutines and ABI card

This commit is contained in:
user
2026-07-21 17:19:51 +02:00
commit ea50415a5e
42 changed files with 7250 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
module tb;
logic [31:0] pc, rs1, target, link;
logic signed [31:0] immediate;
logic jalr;
string trace_file;
link_address dut (.*);
initial begin
if ($value$plusargs("trace=%s", trace_file)) begin $dumpfile(trace_file); $dumpvars(0, tb); end
pc=32'h100; rs1=0; immediate=24; jalr=0; #1;
if (target !== 32'h118 || link !== 32'h104) $fatal(1, "FAIL jal target=%h link=%h", target, link);
rs1=32'h205; immediate=-4; jalr=1; #1;
if (target !== 32'h200 || link !== 32'h104) $fatal(1, "FAIL jalr target=%h link=%h", target, link);
$display("PASS task01 jal_target=00000118 link=00000104 jalr_target=00000200");
$finish;
end
endmodule