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

Subversion Repositories adv_debug_sys

[/] [adv_debug_sys/] [trunk/] [Software/] [AdvancedWatchpointControl/] [src/] [advancedWatchpointControl/] [TargetRunningTransaction.java] - Blame information for rev 54

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 54 nyawn
////////////////////////////////////////////////////////////////
2
//
3
// targetDebugRegisterSet.java
4
//
5
// Copyright (C) 2010 Nathan Yawn 
6
//                    (nyawn@opencores.org)
7
//
8
// This class defines a transaction object which is passed
9
// to the RSP coder in order to determine whether the target
10
// CPU is running.
11
//
12
////////////////////////////////////////////////////////////////
13
//
14
// This source file may be used and distributed without
15
// restriction provided that this copyright statement is not
16
// removed from the file and that any derivative work contains
17
// the original copyright notice and the associated disclaimer.
18
// 
19
// This source file is free software; you can redistribute it
20
// and/or modify it under the terms of the GNU General
21
// Public License as published by the Free Software Foundation;
22
// either version 3.0 of the License, or (at your option) any
23
// later version.
24
//
25
// This source is distributed in the hope that it will be
26
// useful, but WITHOUT ANY WARRANTY; without even the implied 
27
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
28
// PURPOSE.  See the GNU Lesser General Public License for more
29
// details.
30
// 
31
// You should have received a copy of the GNU General
32
// Public License along with this source; if not, download it 
33
// from http://www.gnu.org/licenses/gpl.html
34
//
35
////////////////////////////////////////////////////////////////
36 51 nyawn
package advancedWatchpointControl;
37
 
38
 
39
public class TargetRunningTransaction implements TargetTransaction {
40
 
41
        private boolean isTargetRunning = false;
42
 
43
        public TargetRunningTransaction() {
44
        }
45
 
46
        @Override
47
        public String getDataToSend() {
48
                return new String("?");
49
        }
50
 
51
        @Override
52
        public boolean receivePacket(String pkt) {
53
 
54
                // 'S##' means it's stopped, 'R' means it's running,
55
                // anything else is an error.
56
                if(pkt.charAt(0) == 'R') {
57
                        // target is running, disallow accesses
58
                        isTargetRunning = true;
59
                }
60
                else if(pkt.charAt(0) == 'S') {
61
                        // We got a stop packet 
62
                        isTargetRunning = false;
63
                }
64
                else {
65
                        return false;
66
                }
67
 
68
                return true;
69
        }
70
 
71
        public boolean getIsTargetRunning() {
72
                return isTargetRunning;
73
        }
74
 
75
}

powered by: WebSVN 2.1.0

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