feat(L08): add subroutines and ABI card
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user