35use ieee.std_logic_1164.
all;
36use ieee.numeric_std.
all;
37use ieee.std_logic_textio.
all;
66 proc_tm:
process (
CLK)
67 variable oline : line;
68 variable clkcycle : integer := 0;
69 variable ipsw : slv16 := (others=>'0');
70 variable ibaddr : slv16 := (others=>'0');
71 variable emaddr : slv22 := (others=>'0');
72 variable dp_ireg_we_last : slbit := '0';
73 variable vm_ibsres_busy_last : slbit := '0';
74 variable vm_ibsres_ack_last : slbit := '0';
75 variable wcycle : boolean := false;
79 if rising_edge(CLK) then
81 clkcycle := clkcycle + 1;
85 file_open(ofile, "tmu_ofile", WRITE_MODE);
89 write(oline, string'("#"));
90 write(oline, string'(" clkcycle:d"));
91 write(oline, string'(" cpu:o"));
93 write(oline, string'(" dp.pc:o"));
94 write(oline, string'(" dp.psw:o"));
95 write(oline, string'(" dp.ireg:o"));
96 write(oline, string'(" dp.ireg_we:b"));
97 write(oline, string'(" dp.ireg_we_last:b"));
98 write(oline, string'(" dp.dsrc:o"));
99 write(oline, string'(" dp.ddst:o"));
100 write(oline, string'(" dp.dtmp:o"));
101 write(oline, string'(" dp.dres:o"));
102 write(oline, string'(" dp.gr_adst:o"));
103 write(oline, string'(" dp.gr_mode:o"));
104 write(oline, string'(" dp.gr_bytop:b"));
105 write(oline, string'(" dp.gr_we:b"));
107 write(oline, string'(" se.istart:b"));
108 write(oline, string'(" se.vstart:b"));
110 write(oline, string'(" vm.vmcntl.cacc:b"));
111 write(oline, string'(" vm.vmcntl.macc:b"));
112 write(oline, string'(" vm.ibmreq.aval:b"));
113 write(oline, string'(" vm.ibmreq.re:b"));
114 write(oline, string'(" vm.ibmreq.we:b"));
115 write(oline, string'(" vm.ibmreq.rmw:b"));
116 write(oline, string'(" vm.ibmreq.be0:b"));
117 write(oline, string'(" vm.ibmreq.be1:b"));
118 write(oline, string'(" vm.ibmreq.cacc:b"));
119 write(oline, string'(" vm.ibmreq.racc:b"));
120 write(oline, string'(" vm.ibmreq.addr:o"));
121 write(oline, string'(" vm.ibmreq.din:o"));
122 write(oline, string'(" vm.ibsres.ack:b"));
123 write(oline, string'(" vm.ibsres.busy:b"));
124 write(oline, string'(" vm.ibsres.dout:o"));
125 write(oline, string'(" vm.emmreq.req:b"));
126 write(oline, string'(" vm.emmreq.we:b"));
127 write(oline, string'(" vm.emmreq.be:b"));
128 write(oline, string'(" vm.emmreq.cancel:b"));
129 write(oline, string'(" vm.emmreq.addr:o"));
130 write(oline, string'(" vm.emmreq.din:o"));
131 write(oline, string'(" vm.emsres.ack_r:b"));
132 write(oline, string'(" vm.emsres.ack_w:b"));
133 write(oline, string'(" vm.emsres.dout:o"));
135 write(oline, string'(" co.cpugo:b"));
136 write(oline, string'(" co.cpususp:b"));
137 write(oline, string'(" co.suspint:b"));
138 write(oline, string'(" co.suspext:b"));
140 write(oline, string'(" ca.rd:b"));
141 write(oline, string'(" ca.wr:b"));
142 write(oline, string'(" ca.rdhit:b"));
143 write(oline, string'(" ca.wrhit:b"));
144 write(oline, string'(" ca.rdmem:b"));
145 write(oline, string'(" ca.wrmem:b"));
146 write(oline, string'(" ca.rdwait:b"));
147 write(oline, string'(" ca.wrwait:b"));
149 writeline(ofile, oline);
152 ipsw := (others=>'0');
160 ibaddr := "1110000000000000";
163 emaddr := (others=>'0');
167 if dp_ireg_we_last='1' or
181 (vm_ibsres_busy_last='1' and vm_ibsres_ack_last='0')
192 write(oline, clkcycle, right, 9);
193 write(oline, string'(" 0"));
196 writeoct(oline, ipsw, right, 7);
199 write(oline, dp_ireg_we_last, right, 2);
204 writeoct(oline, DM_STAT_DP.gr_adst, right, 2);
205 writeoct(oline, DM_STAT_DP.gr_mode, right, 2);
212 write(oline, DM_STAT_VM.vmcntl.cacc, right, 2);
213 write(oline, DM_STAT_VM.vmcntl.macc, right, 2);
214 write(oline, DM_STAT_VM.ibmreq.aval, right, 2);
217 write(oline, DM_STAT_VM.ibmreq.rmw, right, 2);
218 write(oline, DM_STAT_VM.ibmreq.be0, right, 2);
219 write(oline, DM_STAT_VM.ibmreq.be1, right, 2);
220 write(oline, DM_STAT_VM.ibmreq.cacc, right, 2);
221 write(oline, DM_STAT_VM.ibmreq.racc, right, 2);
222 writeoct(oline, ibaddr, right, 7);
223 writeoct(oline, DM_STAT_VM.ibmreq.din, right, 7);
224 write(oline, DM_STAT_VM.ibsres.ack, right, 2);
225 write(oline, DM_STAT_VM.ibsres.busy, right, 2);
226 writeoct(oline, DM_STAT_VM.ibsres.dout, right, 7);
228 write(oline, DM_STAT_VM.emmreq.req, right, 2);
231 write(oline, DM_STAT_VM.emmreq.cancel, right, 2);
232 writeoct(oline, emaddr, right, 9);
233 writeoct(oline, DM_STAT_VM.emmreq.din, right, 7);
234 write(oline, DM_STAT_VM.emsres.ack_r, right, 2);
235 write(oline, DM_STAT_VM.emsres.ack_w, right, 2);
236 writeoct(oline, DM_STAT_VM.emsres.dout, right, 7);
252 writeline(ofile, oline);
256 vm_ibsres_busy_last := DM_STAT_VM.ibsres.busy;
in DM_STAT_DP dm_stat_dp_type
in DM_STAT_CO dm_stat_co_type
in DM_STAT_SE dm_stat_se_type
in DM_STAT_VM dm_stat_vm_type
in DM_STAT_CA dm_stat_ca_type
std_logic_vector( 15 downto 0) slv16
std_logic_vector( 21 downto 0) slv22