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
+23
View File
@@ -0,0 +1,23 @@
module tb;
logic [4:0] register_index;
logic [2:0] abi_class;
integer index, args=0, saved=0, temporaries=0, fixed=0;
string trace_file;
abi_registers dut (.*);
initial begin
if ($value$plusargs("trace=%s", trace_file)) begin $dumpfile(trace_file); $dumpvars(0, tb); end
for (index=0; index<32; index+=1) begin
register_index=index[4:0]; #1;
case (abi_class)
3: args+=1;
4: saved+=1;
5: temporaries+=1;
0,1,2,6: fixed+=1;
default: $fatal(1, "FAIL class index=%0d class=%0d", index, abi_class);
endcase
end
if (args!=8 || saved!=12 || temporaries!=7 || fixed!=5) $fatal(1, "FAIL counts %0d %0d %0d %0d", args,saved,temporaries,fixed);
$display("PASS task02 args=8 saved=12 temporaries=7 fixed=5");
$finish;
end
endmodule