1 /* Simulator instruction operand writer for sh.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 2000-2010 Red Hat, Inc.
7 This file is part of the Red Hat simulators.
15 template <typename ST>
16 static void clear_stacks (ST &st)
18 for (int i = 0; i < sh4al::pipe_sz; i++)
22 void sh4al::write_stacks::reset ()
24 clear_stacks (h_pc_writes);
25 clear_stacks (h_pr_writes);
27 void sh4al::write_stacks::writeback (int tick, sh4al::sh4al_cpu* current_cpu)
30 // register writeback loops
31 while (! h_pc_writes[tick].empty())
33 write<UDI> &w = h_pc_writes[tick].top();
34 current_cpu->h_pc_set(w.val);
35 h_pc_writes[tick].pop();
38 while (! h_pr_writes[tick].empty())
40 write<SI> &w = h_pr_writes[tick].top();
41 current_cpu->h_pr_set(w.val);
42 h_pr_writes[tick].pop();
46 // memory writeback loops