OpenCores
URL https://opencores.org/ocsvn/core_arm/core_arm/trunk

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [sparc/] [dsu.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tarookumic
 
2
 
3
 
4
 
5
----------------------------------------------------------------------------
6
--  This file is a part of the LEON VHDL model
7
--  Copyright (C) 1999  European Space Agency (ESA)
8
--
9
--  This library is free software; you can redistribute it and/or
10
--  modify it under the terms of the GNU Lesser General Public
11
--  License as published by the Free Software Foundation; either
12
--  version 2 of the License, or (at your option) any later version.
13
--
14
--  See the file COPYING.LGPL for the full details of the license.
15
 
16
 
17
-----------------------------------------------------------------------------
18
-- Entity:      dsu
19
-- File:        dsu.vhd
20
-- Author:      Jiri Gaisler - Gaisler Research
21
-- Description: Debug support unit. 
22
------------------------------------------------------------------------------
23
 
24
library IEEE;
25
use IEEE.std_logic_1164.all;
26
use work.leon_target.all;
27
use work.leon_config.all;
28
use work.leon_iface.all;
29
use work.amba.all;
30
use work.tech_map.all;
31
use IEEE.std_logic_unsigned."+";
32
use IEEE.std_logic_unsigned."-";
33
 
34
 
35
entity dsu is
36
  port (
37
    rst    : in  std_logic;
38
    clk    : in  clk_type;
39
    ahbmi  : in  ahb_mst_in_type;
40
    ahbsi  : in  ahb_slv_in_type;
41
    ahbso  : out ahb_slv_out_type;
42
    dsui   : in  dsu_in_type;
43
    dsuo   : out dsu_out_type;
44
    dbgi   : in  iu_debug_out_type;
45
    dbgo   : out iu_debug_in_type;
46
    irqo   : in  irq_out_type;
47
    dmi    : out dsumem_in_type;
48
    dmo    : in  dsumem_out_type
49
  );
50
end;
51
 
52
architecture rtl of dsu is
53
 
54
-- constant dsuconfig : debug_config_type := leon_config_table(cfgindex).debug;
55
 
56
constant TTIMEBITS : integer := 30; -- timer bits
57
 
58
type dsu_config_reg is record
59
  tenable       : std_logic;    -- trace enable
60
  tmode         : std_logic;    -- trace delay counter mode
61
  btrapa        : std_logic;    -- break on any IU trap
62
  btrape        : std_logic;    -- break on all IU traps but 3,4,5,6,0x11-0x1f
63
  berror        : std_logic;    -- break on IU error mode
64
  bwatch        : std_logic;    -- break on IU watchpoint
65
  bsoft         : std_logic;    -- break on software breakpoint (TA 1)
66
  bahb          : std_logic;    -- break on AHB watchpoint hit
67
  btrace        : std_logic;    -- break on trace freeze
68
  ftimer        : std_logic;    -- freeze timer on break
69
  rerror        : std_logic;    -- reset error mode
70
  step          : std_logic;    -- single step
71
  lresp         : std_logic;    -- link response enable
72
  dresp         : std_logic;    -- debug response enable
73
  dbreak        : std_logic;    -- force CPU in debug mode (write-only)
74
  dcnten        : std_logic;    -- delay counter enable
75
  delaycnt      : std_logic_vector(TBUFABITS - 1 downto 0); -- delay counter
76
end record;
77
 
78
type trace_ctrl_reg is record
79
  aindex        : std_logic_vector(TBUFABITS - 1 downto 0); -- buffer index
80
  pindex        : std_logic_vector(TBUFABITS - 1 downto 0); -- buffer index
81
  tproc         : std_logic;    -- trace processor enable
82
  tahb          : std_logic;    -- trace AHB enable
83
end record;
84
 
85
type trace_break_reg is record
86
  addr          : std_logic_vector(31 downto 2);
87
  mask          : std_logic_vector(31 downto 2);
88
  read          : std_logic;
89
  write         : std_logic;
90
  exec          : std_logic;
91
end record;
92
 
93
type regtype is record
94
-- AHB signals
95
  haddr         : std_logic_vector(31 downto 0);
96
  hwrite        : std_logic;
97
  htrans        : std_logic_vector(1 downto 0);
98
  hsize         : std_logic_vector(2 downto 0);
99
  hburst        : std_logic_vector(2 downto 0);
100
  hwdata        : std_logic_vector(31 downto 0);
101
  hmaster       : std_logic_vector(3 downto 0);
102
  hmastlock     : std_logic;
103
  hsel          : std_logic;
104
  hready        : std_logic;
105
  hready2       : std_logic;
106
  hready3       : std_logic;
107
  ahbactive     : std_logic;
108
 
109
  timer         : std_logic_vector(TTIMEBITS - 1 downto 0); -- timer
110
  dsubre        : std_logic_vector(2 downto 0); -- external DSUBRE signal
111
  dsuen         : std_logic_vector(2 downto 0); -- external DSUBRE signal
112
  dsuact        : std_logic;
113
 
114
  dsucfg        : dsu_config_reg;
115
  tbreg1        : trace_break_reg;
116
  tbreg2        : trace_break_reg;
117
  tctrl         : trace_ctrl_reg;
118
end record;
119
 
120
signal r, rin : regtype;
121
constant zero30 : std_logic_vector(29 downto 0) := (others => '0');
122
 
123
begin
124
 
125
  ctrl : process(rst, ahbmi, ahbsi, dsui, irqo, dbgi, r, dmo)
126
  variable v : regtype;
127
  variable vpbufi, vabufi : tracebuf_in_type;
128
  variable regsd : std_logic_vector(31 downto 0);   -- data from registers
129
  variable pindex, aindex : std_logic_vector(TBUFABITS - 1 downto 0); -- buffer index
130
  variable denable, ldst_cycle, bphit, bphit2 : std_logic;
131
  variable bufdata : std_logic_vector(127 downto 0);
132
  variable pbufo, abufo : tracebuf_out_type;
133
 
134
  begin
135
 
136
    v := r; regsd := (others => '0'); vpbufi.enable := '0'; vabufi.enable := '0';
137
    vpbufi.data := (others => '0'); vabufi.data := (others => '0');
138
    vpbufi.addr := (others => '0'); vabufi.addr := (others => '0');
139
    vpbufi.write := (others => '0'); vabufi.write := (others => '0');
140
    denable := '0'; bphit := '0'; bphit2 := '0';
141
    v.hready := r.hready2; v.hready2 := r.hready3; v.hready3 := '0';
142
    pbufo := dmo.pbufo; abufo := dmo.abufo;
143
    bufdata := pbufo.data;
144
    ldst_cycle := dbgi.wr.inst(31) and dbgi.wr.inst(30);
145
    v.dsubre := r.dsubre(1 downto 0) & dsui.dsubre;
146
    v.dsuen := r.dsuen(1 downto 0) & dsui.dsuen;
147
    v.dsucfg.dbreak := r.dsucfg.dbreak or
148
        (r.dsubre(1) and not r.dsubre(2)) or dbgi.dmode;
149
    v.dsuact := dbgi.dmode; v.dsucfg.rerror := '0';
150
 
151
-- trace buffer index and delay counters
152
    if DSUTRACE then
153
-- pragma translate_off
154
      if not is_x(r.timer) then
155
-- pragma translate_on
156
        if (r.dsucfg.tenable and not dbgi.dmode2) = '1' then
157
          v.timer := r.timer + 1;
158
        end if;
159
-- pragma translate_off
160
      end if;
161
-- pragma translate_on
162
-- pragma translate_off
163
      if not is_x(r.tctrl.pindex) then
164
-- pragma translate_on
165
        pindex := r.tctrl.pindex + 1;
166
-- pragma translate_off
167
      end if;
168
-- pragma translate_on
169
      if DSUMIXED then
170
-- pragma translate_off
171
        if not is_x(r.tctrl.aindex) then
172
-- pragma translate_on
173
          aindex := r.tctrl.aindex + 1;
174
-- pragma translate_off
175
        end if;
176
-- pragma translate_on
177
      end if;
178
    end if;
179
 
180
-- check for AHB watchpoints
181
    if (ahbsi.hready and r.ahbactive ) = '1' then
182
      if ((((r.tbreg1.addr xor r.haddr(31 downto 2)) and r.tbreg1.mask) = zero30) and
183
         (((r.tbreg1.read and not r.hwrite) or (r.tbreg1.write and r.hwrite)) = '1'))
184
        or ((((r.tbreg2.addr xor r.haddr(31 downto 2)) and r.tbreg2.mask) = zero30) and
185
           (((r.tbreg2.read and not r.hwrite) or (r.tbreg2.write and r.hwrite)) = '1'))
186
      then
187
        bphit := '1';
188
        if (r.dsucfg.dcnten = '0') and ((r.tctrl.tahb or r.tctrl.tproc) = '1') and
189
           (r.dsucfg.delaycnt /= zero30(TBUFABITS-1 downto 0))
190
        then v.dsucfg.dcnten := '1'; end if;
191
        if r.dsucfg.bahb = '1' then v.dsucfg.dbreak := '1'; end if;
192
      end if;
193
    end if;
194
 
195
-- check for IU trace breakpoints
196
    if (dbgi.holdn and dbgi.wr.pv and
197
 
198
         not dbgi.wr.annul) = '1'
199
 
200
    then
201
      if ((((r.tbreg1.addr xor dbgi.wr.pc(31 downto 2)) and r.tbreg1.mask) = zero30) and
202
         (r.tbreg1.exec = '1'))
203
        or ((((r.tbreg2.addr xor dbgi.wr.pc(31 downto 2)) and r.tbreg2.mask) = zero30) and
204
           (r.tbreg2.exec = '1'))
205
      then
206
        bphit2 := '1';
207
        if (r.dsucfg.tenable = '1') and (r.dsucfg.dcnten = '0') and
208
             (r.dsucfg.delaycnt /= zero30(TBUFABITS-1 downto 0))
209
        then v.dsucfg.dcnten := '1'; end if;
210
        if r.dsucfg.bahb = '1' then v.dsucfg.dbreak := '1'; end if;
211
      end if;
212
    end if;
213
 
214
-- generate buffer inputs
215
    if DSUTRACE then
216
      vpbufi.write := "0000"; vabufi.write := "0000";
217
      if r.dsucfg.tenable = '1' then
218
        vpbufi.addr := '0' & r.tctrl.pindex;
219
        vabufi.addr := '0' & r.tctrl.aindex;
220
        vabufi.data(125 downto 96) := r.timer;
221
        vpbufi.data(125 downto 96) := r.timer;
222
        vabufi.data(127) := bphit;
223
        vabufi.data(95 downto 92) := irqo.irl;
224
        vabufi.data(91 downto 88) := dbgi.psrpil;
225
        vabufi.data(87 downto 80) := dbgi.psrtt;
226
        vabufi.data(79) := r.hwrite;
227
        vabufi.data(78 downto 77) := r.htrans;
228
        vabufi.data(76 downto 74) := r.hsize;
229
        vabufi.data(73 downto 71) := r.hburst;
230
        vabufi.data(70 downto 67) := r.hmaster;
231
        vabufi.data(66) := r.hmastlock;
232
        vabufi.data(65 downto 64) := ahbmi.hresp;
233
        if r.hwrite = '1' then
234
          vabufi.data(63 downto 32) := ahbsi.hwdata;
235
        else
236
          vabufi.data(63 downto 32) := ahbmi.hrdata;
237
        end if;
238
        vabufi.data(31 downto 0) := r.haddr;
239
        vpbufi.data(127) := bphit2;
240
        vpbufi.data(126) := not dbgi.wr.pv;
241
        vpbufi.data(95 downto 64) := dbgi.result;
242
        vpbufi.data(63 downto 32) := dbgi.wr.pc(31 downto 2) &
243
                                    dbgi.trap & dbgi.error;
244
        vpbufi.data(31 downto 0) := dbgi.wr.inst;
245
      else
246
        vpbufi.addr := '0' & r.haddr(TBUFABITS+3 downto 4);
247
        vabufi.addr := '1' & r.haddr(TBUFABITS+3 downto 4);
248
        vpbufi.data := ahbsi.hwdata & ahbsi.hwdata & ahbsi.hwdata & ahbsi.hwdata;
249
        vabufi.data := vpbufi.data;
250
      end if;
251
 
252
-- write trace buffer
253
      if r.dsucfg.tenable = '1' then
254
        if (r.tctrl.tahb and r.ahbactive and ahbsi.hready) = '1' then
255
          if DSUMIXED then
256
            v.tctrl.aindex := aindex;
257
            vabufi.enable := '1'; vabufi.write := "1111";
258
          elsif (r.tctrl.tproc = '0') then
259
            v.tctrl.pindex := pindex;
260
            vpbufi.enable := '1'; vpbufi.write := "1111";
261
          end if;
262
        end if;
263
        if (r.tctrl.tproc and dbgi.holdn and
264
         (dbgi.wr.pv or dbgi.write_reg or ldst_cycle)
265
 
266
          and (not dbgi.vdmode) and not dbgi.wr.annul) = '1'
267
 
268
        then
269
          vpbufi.enable := '1'; vpbufi.write := "1111";
270
          v.tctrl.pindex := pindex;
271
        end if;
272
        if ((r.tctrl.tahb xor r.tctrl.tproc) = '1') and
273
            DSUMIXED and not DSUDPRAM
274
        then
275
          if r.tctrl.tahb = '1' then vpbufi := vabufi;
276
          else vabufi := vpbufi; end if;
277
          vabufi.enable := vabufi.enable and vabufi.addr(TBUFABITS-1);
278
          vpbufi.enable := vpbufi.enable and not vpbufi.addr(TBUFABITS-1);
279
        end if;
280
        if ((r.tctrl.tahb and not r.tctrl.tproc) = '1') and not DSUMIXED then
281
          vpbufi.data := vabufi.data;
282
        end if;
283
      end if;
284
    end if;
285
 
286
-- trace buffer delay counter handling
287
    if (r.dsucfg.dcnten = '1') then
288
      if (r.dsucfg.delaycnt = zero30(TBUFABITS-1 downto 0)) then
289
        v.dsucfg.tenable := '0'; v.dsucfg.dcnten := '0';
290
        v.dsucfg.dbreak := v.dsucfg.dbreak or r.dsucfg.btrace;
291
      end if;
292
-- pragma translate_off
293
      if not is_x(r.dsucfg.delaycnt) then
294
-- pragma translate_on
295
        if ((vpbufi.enable and not r.dsucfg.tmode) or
296
           (vabufi.enable and r.dsucfg.tmode)) = '1'
297
        then
298
          v.dsucfg.delaycnt := r.dsucfg.delaycnt - 1;
299
        end if;
300
-- pragma translate_off
301
      end if;
302
-- pragma translate_on
303
    end if;
304
 
305
-- save AHB transfer parameters
306
    if (ahbsi.hready = '1' ) and ((ahbsi.hsel = '1') or (r.dsucfg.bahb = '1') or
307
        (DSUTRACE and ((r.tctrl.tahb and r.dsucfg.tenable) = '1')))
308
    then
309
      v.haddr := ahbsi.haddr; v.hwrite := ahbsi.hwrite; v.htrans := ahbsi.htrans;
310
      v.hsize := ahbsi.hsize; v.hburst := ahbsi.hburst;
311
      v.hmaster := ahbsi.hmaster; v.hmastlock := ahbsi.hmastlock;
312
    end if;
313
    if r.hsel = '1' then v.hwdata := ahbsi.hwdata; end if;
314
    if ahbsi.hready = '1' then
315
      v.hsel := ahbsi.hsel;
316
      v.ahbactive := ahbsi.htrans(1);
317
    end if;
318
 
319
-- AHB slave access to DSU registers and trace buffers
320
    if (r.hsel and not r.hready) = '1' then
321
      case r.haddr(20 downto 16) is
322
      when "00000" =>   -- DSU control register access
323
        v.hready := '1';
324
        case r.haddr(4 downto 2) is
325
        when "000" =>
326
          regsd((TBUFABITS + 19) downto 20) := r.dsucfg.delaycnt;
327
          regsd(18 downto 1) :=
328
            r.dsucfg.dresp & r.dsucfg.lresp &
329
            r.dsucfg.step & dbgi.error &
330
            r.dsuen(2) & r.dsubre(2) & r.dsuact &
331
            r.dsucfg.dcnten & r.dsucfg.btrape & r.dsucfg.btrapa &
332
            r.dsucfg.bahb & r.dsucfg.dbreak & r.dsucfg.bsoft &
333
            r.dsucfg.bwatch & r.dsucfg.berror & r.dsucfg.ftimer &
334
            r.dsucfg.btrace &  r.dsucfg.tmode;
335
            if DSUTRACE then regsd(0) := r.dsucfg.tenable;
336
            end if;
337
          if r.hwrite = '1' then
338
            v.dsucfg.delaycnt := ahbsi.hwdata((TBUFABITS+ 19) downto 20);
339
            v.dsucfg.rerror := ahbsi.hwdata(19);
340
            v.dsucfg.dresp := ahbsi.hwdata(18);
341
            v.dsucfg.lresp := ahbsi.hwdata(17);
342
            v.dsucfg.step := ahbsi.hwdata(16);
343
            v.dsucfg.dcnten := ahbsi.hwdata(11);
344
            v.dsucfg.btrape  := ahbsi.hwdata(10);
345
            v.dsucfg.btrapa  := ahbsi.hwdata(9);
346
            v.dsucfg.bahb := ahbsi.hwdata(8);
347
            v.dsucfg.dbreak := ahbsi.hwdata(7);
348
            v.dsucfg.bsoft := ahbsi.hwdata(6);
349
            v.dsucfg.bwatch := ahbsi.hwdata(5);
350
            v.dsucfg.berror := ahbsi.hwdata(4);
351
            v.dsucfg.ftimer := ahbsi.hwdata(3);
352
            v.dsucfg.btrace := ahbsi.hwdata(2);
353
            v.dsucfg.tmode := ahbsi.hwdata(1);
354
            if DSUTRACE then
355
              v.dsucfg.tenable := ahbsi.hwdata(0);
356
            end if;
357
          end if;
358
        when "001" =>
359
          if DSUTRACE then
360
            regsd((TBUFABITS - 1) downto 0) := r.tctrl.pindex;
361
            if DSUMIXED then
362
              regsd((TBUFABITS - 1 + 12) downto 12) := r.tctrl.aindex;
363
            end if;
364
            regsd(24) := r.tctrl.tproc; regsd(25) := r.tctrl.tahb;
365
            if r.hwrite = '1' then
366
              v.tctrl.pindex := ahbsi.hwdata((TBUFABITS- 1) downto 0);
367
              if DSUMIXED then
368
                v.tctrl.aindex := ahbsi.hwdata((TBUFABITS- 1 + 12) downto 12);
369
              end if;
370
              v.tctrl.tproc  := ahbsi.hwdata(24);
371
              v.tctrl.tahb   := ahbsi.hwdata(25);
372
            end if;
373
          end if;
374
        when "010" =>
375
          if DSUTRACE then
376
            regsd((TTIMEBITS - 1) downto 0) := r.timer;
377
            if r.hwrite = '1' then
378
              v.timer := ahbsi.hwdata((TTIMEBITS- 1) downto 0);
379
            end if;
380
          end if;
381
        when "100" =>
382
          regsd(31 downto 2) := r.tbreg1.addr;
383
          if r.hwrite = '1' then
384
            v.tbreg1.addr := ahbsi.hwdata(31 downto 2);
385
            v.tbreg1.exec := ahbsi.hwdata(0);
386
          end if;
387
        when "101" =>
388
          regsd := r.tbreg1.mask & r.tbreg1.read & r.tbreg1.write;
389
          if r.hwrite = '1' then
390
            v.tbreg1.mask := ahbsi.hwdata(31 downto 2);
391
            v.tbreg1.read := ahbsi.hwdata(1);
392
            v.tbreg1.write := ahbsi.hwdata(0);
393
          end if;
394
        when "110" =>
395
          regsd(31 downto 2) := r.tbreg2.addr;
396
          if r.hwrite = '1' then
397
            v.tbreg2.addr := ahbsi.hwdata(31 downto 2);
398
            v.tbreg2.exec := ahbsi.hwdata(0);
399
          end if;
400
        when others =>
401
          regsd := r.tbreg2.mask & r.tbreg2.read & r.tbreg2.write;
402
          if r.hwrite = '1' then
403
            v.tbreg2.mask := ahbsi.hwdata(31 downto 2);
404
            v.tbreg2.read := ahbsi.hwdata(1);
405
            v.tbreg2.write := ahbsi.hwdata(0);
406
          end if;
407
        end case;
408
        v.hwdata := regsd;
409
      when "00001" =>   -- read/write access to trace buffer
410
        if r.hwrite = '1' then v.hready := '1'; else v.hready2 := not (r.hready2 or r.hready); end if;
411
        if DSUTRACE then
412
          if DSUMIXED and not DSUDPRAM then
413
            vabufi.enable := (not r.dsucfg.tenable) and r.haddr(TBUFABITS+3);
414
            vpbufi.enable := (not r.dsucfg.tenable) and not r.haddr(TBUFABITS+3);
415
            if  r.haddr(TBUFABITS+3) = '1' then bufdata := abufo.data;
416
            else bufdata := pbufo.data; end if;
417
          else
418
            vpbufi.enable := not r.dsucfg.tenable;
419
            if not DSUMIXED then vabufi.enable := vpbufi.enable; end if;
420
          end if;
421
          case r.haddr(3 downto 2) is
422
          when "00" =>
423
            v.hwdata := bufdata(127 downto 96);
424
            if r.hwrite = '1' then
425
              vpbufi.write(3) := vpbufi.enable;
426
              vabufi.write(3) := vabufi.enable;
427
            end if;
428
          when "01" =>
429
            v.hwdata := bufdata(95 downto 64);
430
            if r.hwrite = '1' then
431
              vpbufi.write(2) := vpbufi.enable;
432
              vabufi.write(2) := vabufi.enable;
433
            end if;
434
          when "10" =>
435
            v.hwdata := bufdata(63 downto 32);
436
            if r.hwrite = '1' then
437
              vpbufi.write(1) := vpbufi.enable;
438
              vabufi.write(1) := vabufi.enable;
439
            end if;
440
          when others =>
441
            v.hwdata := bufdata(31 downto 0);
442
            if r.hwrite = '1' then
443
              vpbufi.write(0) := vpbufi.enable;
444
              vabufi.write(0) := vabufi.enable;
445
            end if;
446
          end case;
447
        end if;
448
      when others =>    -- IU/cache diagnostic access
449
        if r.hwrite = '0' then v.hwdata := dbgi.ddata(31 downto 0); end if;
450
        if r.haddr(20) = '0' then        -- IU registers
451
            v.hready3 := not (r.hready2 or r.hready3);
452
            denable := r.hready2 or r.hready3;
453
        else
454
          denable := '1';
455
          if r.haddr(19) = '0' then      -- icache
456
            if r.hwrite = '0' then v.hready := dbgi.diagrdy and not r.hready;
457
            else v.hready2 := not (r.hready2 or r.hready); end if;
458
          else                          -- dcache
459
            if r.hwrite = '1' then v.hready2 := not (r.hready2 or r.hready);
460
            else
461
              v.hready2 := not r.hready2; v.hready3 := r.hready2 or r.hready3;
462
              v.hready := r.hready2 and r.hready3;
463
              if v.hready = '1' then v.hready2 := '0'; v.hready3 := '0'; end if;
464
            end if;
465
          end if;
466
        end if;
467
      end case;
468
    end if;
469
 
470
    if ((ahbsi.hsel and ahbsi.hready) = '1') and
471
          ((ahbsi.htrans = HTRANS_BUSY) or (ahbsi.htrans = HTRANS_IDLE))
472
    then v.hready := '1'; end if;
473
 
474
 
475
    if DSUMIXED then
476
      if ((r.tctrl.tahb and r.tctrl.tproc and r.dsucfg.tenable) = '1') then
477
        v.tctrl.aindex(TBUFABITS-1) := '1'; v.tctrl.pindex(TBUFABITS-1) := '0';
478
      end if;
479
    else vabufi := vpbufi; end if;
480
    vpbufi.addr(TBUFABITS) := '0'; vabufi.addr(TBUFABITS) := '1';
481
 
482
    dsuo.freezetime <= r.dsucfg.ftimer and dbgi.dmode2;
483
    dsuo.ntrace <= r.dsucfg.tenable and not v.dsucfg.tenable;
484
    dsuo.dsuact <= r.dsuact;
485
    dsuo.dsuen <= r.dsuen(2);
486
    dsuo.dsubre <= r.dsubre(2);
487
    dsuo.lresp <= r.dsucfg.lresp;
488
    dsuo.dresp <= r.dsucfg.dresp;
489
 
490
    if rst = '0' then
491
      v.ahbactive := '0'; v.dsucfg.tenable := '0';
492
      v.timer := (others => '0');
493
      v.hsel := '0'; v.dsucfg.dcnten := '0'; v.dsucfg.dbreak := r.dsubre(2);
494
      v.dsucfg.btrape := r.dsubre(2); v.dsucfg.berror := r.dsubre(2);
495
      v.dsucfg.bwatch := r.dsubre(2); v.dsucfg.bsoft := '0';
496
      v.dsucfg.btrapa := r.dsubre(2); v.dsucfg.lresp := '0';
497
      v.dsucfg.step := '0';
498
      v.dsucfg.dresp := '0'; v.dsucfg.ftimer := '0'; v.dsucfg.btrace := '0';
499
      v.dsucfg.bahb := '0';
500
      v.tbreg1.read := '0'; v.tbreg1.write := '0'; v.tbreg1.exec := '0';
501
      v.tbreg2.read := '0'; v.tbreg2.write := '0'; v.tbreg2.exec := '0';
502
    end if;
503
 
504
    rin <= v;
505
    dmi.pbufi <= vpbufi;
506
    dmi.abufi <= vabufi;
507
    ahbso.hrdata <= r.hwdata;
508
    ahbso.hready <= r.hready;
509
    dbgo.btrapa <= r.dsucfg.btrapa;
510
    dbgo.btrape <= r.dsucfg.btrape;
511
    dbgo.berror <= r.dsucfg.berror;
512
    dbgo.bwatch <= r.dsucfg.bwatch;
513
    dbgo.bsoft <= r.dsucfg.bsoft;
514
    dbgo.dbreak <= r.dsucfg.dbreak;
515
    dbgo.rerror <= r.dsucfg.rerror;
516
    dbgo.dsuen <= r.dsuen(2);
517
    dbgo.daddr <= r.haddr(21 downto 2);
518
    dbgo.dwrite <= r.hwrite;
519
    dbgo.ddata <= r.hwdata;
520
    dbgo.denable <= denable;
521
    dbgo.step  <= r.dsucfg.step ;
522
  end process;
523
 
524
  ahbso.hresp <= HRESP_OKAY;
525
 
526
 
527
  memstatregs : process(clk)
528
  begin if rising_edge(clk) then r <= rin; end if; end process;
529
 
530
 
531
 
532
end;
533
 
534
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.