7 int main(int argc
, char** argv
)
11 int fromhost_fd
= -1, tohost_fd
= -1;
12 size_t icsim_sets
= 1024, icsim_linesz
= 32, icsim_ways
= 1;
14 for(int c
; (c
= getopt(argc
,argv
,"dp:f:t:i:")) != -1; )
22 nprocs
= atoi(optarg
);
25 fromhost_fd
= atoi(optarg
);
28 tohost_fd
= atoi(optarg
);
34 icsim_sets
= atoi(optarg
+1);
37 icsim_linesz
= atoi(optarg
+1);
40 icsim_ways
= atoi(optarg
+1);
47 demand(fcntl(fromhost_fd
,F_GETFD
) >= 0, "fromhost file not open");
48 demand(fcntl(tohost_fd
,F_GETFD
) >= 0, "tohost file not open");
50 icsim_t
icache(icsim_sets
, icsim_ways
, icsim_linesz
, "I$");
51 icsim_t
dcache(512, 2, 32, "D$");
53 appserver_link_t
applink(tohost_fd
, fromhost_fd
);
55 sim_t
s(nprocs
, MEMSIZE
, &applink
, &icache
, &dcache
);