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

Subversion Repositories openarty

[/] [openarty/] [trunk/] [sw/] [host/] [eqspiscope.cpp] - Diff between revs 14 and 16

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 14 Rev 16
Line 2... Line 2...
//
//
// Filename:    eqspiscope.cpp
// Filename:    eqspiscope.cpp
//
//
// Project:     XuLA2-LX25 SoC based upon the ZipCPU
// Project:     XuLA2-LX25 SoC based upon the ZipCPU
//
//
// Purpose:     
// Purpose:     This program decodes the bits in the debugging wires output
 
//              from the eqspiflash module, and stored in the Wishbone Scope
 
//      device.  The result is placed on the screen output, so you can see what
 
//      is going on internal to the device.
 
//              
//
//
// Creator:     Dan Gisselquist, Ph.D.
// Creator:     Dan Gisselquist, Ph.D.
//              Gisselquist Technology, LLC
//              Gisselquist Technology, LLC
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
Line 56... Line 60...
        m_fpga->kill();
        m_fpga->kill();
        exit(0);
        exit(0);
}
}
 
 
class   EQSPISCOPE : public SCOPE {
class   EQSPISCOPE : public SCOPE {
        int     m_oword[2], m_iword[2], m_p;
        // While I put these in at one time, they really mess up other scopes,
 
        // since setting parameters based upon the debug word forces the decoder
 
        // to be non-constant, calling methods change, etc., etc., etc.
 
        //
 
        // int  m_oword[2], m_iword[2], m_p;
public:
public:
        EQSPISCOPE(FPGA *fpga, unsigned addr, bool vecread)
        EQSPISCOPE(FPGA *fpga, unsigned addr, bool vecread)
                : SCOPE(fpga, addr, false, false) {};
                : SCOPE(fpga, addr, false, false) {};
        ~EQSPISCOPE(void) {}
        ~EQSPISCOPE(void) {}
        virtual void    decode(DEVBUS::BUSW val) {
        virtual void    decode(DEVBUS::BUSW val) const {
                int     cyc, cstb, dstb, ack, back, accepted, valid, word,
                int     cyc, cstb, dstb, ack, back, accepted, valid, word,
                        out, cs, sck, mod, odat, idat;
                        out, cs, sck, mod, odat, idat;
 
 
                cyc      = (val>>31)&1;
                cyc      = (val>>31)&1;
                cstb     = (val>>30)&1;
                cstb     = (val>>30)&1;
Line 80... Line 88...
                sck      = (val>>10)&1;
                sck      = (val>>10)&1;
                mod      = (val>> 8)&3;
                mod      = (val>> 8)&3;
                odat     = (val>> 4)&15;
                odat     = (val>> 4)&15;
                idat     = (val    )&15;
                idat     = (val    )&15;
 
 
                m_p = (m_p^1)&1;
                /*
                if (mod&2) {
                m_p = (m_p^1)&1;
                        m_oword[m_p] = (m_oword[m_p]<<4)|odat;
                if (mod&2) {
                        m_iword[m_p] = (m_iword[m_p]<<4)|idat;
                        m_oword[m_p] = (m_oword[m_p]<<4)|odat;
                } else {
                        m_iword[m_p] = (m_iword[m_p]<<4)|idat;
                        m_oword[m_p] = (m_oword[m_p]<<1)|(odat&1);
                } else {
                        m_iword[m_p] = (m_iword[m_p]<<1)|((idat&2)?1:0);
                        m_oword[m_p] = (m_oword[m_p]<<1)|(odat&1);
                }
                        m_iword[m_p] = (m_iword[m_p]<<1)|((idat&2)?1:0);
 
                }
 
                */
 
 
                printf("%s%s%s%s%s%s%s %02x %02x %s%s %d %x.%d->  ->%x.%d",
                printf("%s%s%s%s%s%s%s %02x %02x %s%s %d %x.%d->  ->%x.%d",
                        (cyc)?"CYC ":"    ",
                        (cyc)?"CYC ":"    ",
                        (cstb)?"CSTB":"    ",
                        (cstb)?"CSTB":"    ",
                        (dstb)?"DSTB":"    ",
                        (dstb)?"DSTB":"    ",
Line 102... Line 112...
                        word<<1, out<<2,
                        word<<1, out<<2,
                        (cs)?"  ":"CS",
                        (cs)?"  ":"CS",
                        (sck)?"CK":"  ",
                        (sck)?"CK":"  ",
                        (mod), odat, (odat&1)?1:0, idat, (idat&2)?1:0);
                        (mod), odat, (odat&1)?1:0, idat, (idat&2)?1:0);
 
 
                printf("  / %08x -> %08x", m_oword[m_p], m_iword[m_p]);
                // printf("  / %08x -> %08x", m_oword[m_p], m_iword[m_p]);
 
 
        }
        }
};
};
 
 
int main(int argc, char **argv) {
int main(int argc, char **argv) {

powered by: WebSVN 2.1.0

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