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/] [targetTransactor.java] - Blame information for rev 54

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 54 nyawn
////////////////////////////////////////////////////////////////
2
//
3
// targetTransactor.java
4
//
5
// Copyright (C) 2010 Nathan Yawn 
6
//                    (nyawn@opencores.org)
7
//
8 51 nyawn
// This class handles the top-level target transactions.
9
// Its methods are specific transactions (read register,
10
// is target running, etc.).  It constructs an appropriate
11
// transaction object, then gives it to the RSP algorithm
12
// for processing.
13 54 nyawn
//
14
////////////////////////////////////////////////////////////////
15
//
16
// This source file may be used and distributed without
17
// restriction provided that this copyright statement is not
18
// removed from the file and that any derivative work contains
19
// the original copyright notice and the associated disclaimer.
20
// 
21
// This source file is free software; you can redistribute it
22
// and/or modify it under the terms of the GNU General
23
// Public License as published by the Free Software Foundation;
24
// either version 3.0 of the License, or (at your option) any
25
// later version.
26
//
27
// This source is distributed in the hope that it will be
28
// useful, but WITHOUT ANY WARRANTY; without even the implied 
29
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30
// PURPOSE.  See the GNU Lesser General Public License for more
31
// details.
32
// 
33
// You should have received a copy of the GNU General
34
// Public License along with this source; if not, download it 
35
// from http://www.gnu.org/licenses/gpl.html
36
//
37
////////////////////////////////////////////////////////////////
38 51 nyawn
package advancedWatchpointControl;
39
 
40
import java.io.IOException;
41
 
42
public class targetTransactor {
43
 
44
        rspCoder rsp = null;
45
 
46
        public targetTransactor(rspCoder r) {
47
                rsp = r;
48
        }
49
 
50
        // Succeeds or throws an IOException.
51
        public void writeRegister(targetDebugRegisterSet.regType reg, long val) throws IOException {
52
                WriteRegisterTransaction xact = new WriteRegisterTransaction(reg, val);
53
                rsp.Transact(xact);
54
        }
55
 
56
        // Returns a valid value or throws an IOException.
57
        public long readRegister(targetDebugRegisterSet.regType reg) throws IOException {
58
                long ret;
59
                ReadRegisterTransaction xact = new ReadRegisterTransaction(reg);
60
                rsp.Transact(xact);
61
                ret = xact.getDataValueRead();
62
                return ret;
63
        }
64
 
65
        // Returns a valid boolean indicator or throws an IOException.
66
        public boolean isTargetRunning() throws IOException {
67
                boolean ret;
68
                TargetRunningTransaction xact = new TargetRunningTransaction();
69
                rsp.Transact(xact);
70
                ret = xact.getIsTargetRunning();
71
                return ret;
72
        }
73
 
74
}

powered by: WebSVN 2.1.0

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