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

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [host/] [scopecls.h] - Blame information for rev 52

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 52 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Filename:    scopecls.h
4
//
5
// Project:     WBScope, a wishbone hosted scope
6
//
7
// Purpose:     After rebuilding the same code over and over again for every
8
//              "scope" I tried to interact with, I thought it would be simpler
9
//      to try to make a more generic interface, that other things could plug
10
//      into.  This is that more generic interface.
11
//
12
// Creator:     Dan Gisselquist, Ph.D.
13
//              Gisselquist Technology, LLC
14
//
15
////////////////////////////////////////////////////////////////////////////////
16
//
17
// Copyright (C) 2015-2017, Gisselquist Technology, LLC
18
//
19
// This program is free software (firmware): you can redistribute it and/or
20
// modify it under the terms of  the GNU General Public License as published
21
// by the Free Software Foundation, either version 3 of the License, or (at
22
// your option) any later version.
23
//
24
// This program is distributed in the hope that it will be useful, but WITHOUT
25
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
26
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
27
// for more details.
28
//
29
// You should have received a copy of the GNU General Public License along
30
// with this program.  (It's in the $(ROOT)/doc directory.  Run make with no
31
// target there if the PDF file isn't present.)  If not, see
32
// <http://www.gnu.org/licenses/> for a copy.
33
//
34
// License:     GPL, v3, as defined and found on www.gnu.org,
35
//              http://www.gnu.org/licenses/gpl.html
36
//
37
//
38
////////////////////////////////////////////////////////////////////////////////
39
//
40
//
41
#ifndef SCOPECLS_H
42
#define SCOPECLS_H
43
 
44
#include <vector>
45
#include "devbus.h"
46
 
47
class   TRACEINFO {
48
public:
49
        const char      *m_name;
50
        char            m_key[4];
51
        unsigned        m_nbits, m_nshift;
52
};
53
 
54
class   SCOPE {
55
        DEVBUS          *m_fpga;
56
        DEVBUS::BUSW    m_addr;
57
        bool            m_compressed, m_vector_read;
58
        unsigned        m_scoplen;
59
        unsigned        *m_data;
60
        std::vector<TRACEINFO *> m_traces;
61
 
62
public:
63
        SCOPE(DEVBUS *fpga, unsigned addr,
64
                        bool compressed=false, bool vecread=true)
65
                : m_fpga(fpga), m_addr(addr),
66
                        m_compressed(compressed), m_vector_read(vecread),
67
                        m_scoplen(0), m_data(NULL) {}
68
        ~SCOPE(void) { if (m_data) delete[] m_data; }
69
 
70
        bool    ready();
71
        void    decode_control(void);
72
        int     scoplen(void);
73
        virtual void    rawread(void);
74
                void    print(void);
75
        virtual void    write_trace_timescale(FILE *fp);
76
        virtual void    write_trace_header(FILE *fp);
77
                void    write_binary_trace(FILE *fp, const int nbits,
78
                                unsigned val, const char *str);
79
                void    write_binary_trace(FILE *fp, TRACEINFO *info,
80
                                unsigned value);
81
                void    writevcd(const char *trace_file_name);
82
                void    register_trace(const char *varname,
83
                                unsigned nbits, unsigned shift);
84
        virtual void    decode(DEVBUS::BUSW v) const = 0;
85
        virtual void    define_traces(void);
86
};
87
 
88
#endif  // SCOPECLS_H

powered by: WebSVN 2.1.0

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