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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [bench/] [cpp/] [zippy_tb.cpp] - Diff between revs 140 and 148

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

Rev 140 Rev 148
Line 78... Line 78...
public:
public:
        bool            m_valid, m_gie, m_last_pc_valid;
        bool            m_valid, m_gie, m_last_pc_valid;
        unsigned int    m_sR[16], m_uR[16];
        unsigned int    m_sR[16], m_uR[16];
        unsigned int    m_p[20];
        unsigned int    m_p[20];
        unsigned int    m_last_pc, m_pc, m_sp;
        unsigned int    m_last_pc, m_pc, m_sp;
        SPARSEMEM       m_smem[5];
        SPARSEMEM       m_smem[5]; // Nearby stack memory
        SPARSEMEM       m_imem[5];
        SPARSEMEM       m_imem[5]; // Nearby instruction memory
        ZIPSTATE(void) : m_valid(false), m_last_pc_valid(false) {}
        ZIPSTATE(void) : m_valid(false), m_last_pc_valid(false) {}
 
 
        void    step(void) {
        void    step(void) {
                m_last_pc_valid = true;
                m_last_pc_valid = true;
                m_last_pc = m_pc;
                m_last_pc = m_pc;
Line 682... Line 682...
                if (m_core->v__DOT__thecpu__DOT__opvalid_mem)
                if (m_core->v__DOT__thecpu__DOT__opvalid_mem)
                        mvprintw(ln-1,10,"M");
                        mvprintw(ln-1,10,"M");
                else if (m_core->v__DOT__thecpu__DOT__opvalid_alu)
                else if (m_core->v__DOT__thecpu__DOT__opvalid_alu)
                        mvprintw(ln-1,10,"A");
                        mvprintw(ln-1,10,"A");
 
 
 
                if (m_core->v__DOT__thecpu__DOT__opvalid_mem) {
 
                        showins(ln, "Mm",
 
                                m_core->v__DOT__thecpu__DOT__mem_ce,
 
                                m_core->v__DOT__thecpu__DOT__mem_pc_valid,
 
                                m_core->v__DOT__thecpu__DOT__alu_gie,
 
#ifdef  OPT_PIPELINED
 
                                m_core->v__DOT__thecpu__DOT__mem_stall,
 
#else
 
                                0,
 
#endif
 
                                alu_pc(),
 
#ifdef  OPT_VLIW
 
                                m_core->v__DOT__thecpu__DOT__r_alu_phase
 
#else
 
                                false
 
#endif
 
                        );
 
                } else {
                showins(ln, "Al",
                showins(ln, "Al",
                        m_core->v__DOT__thecpu__DOT__alu_ce,
                        m_core->v__DOT__thecpu__DOT__alu_ce,
                        m_core->v__DOT__thecpu__DOT__alu_pc_valid,
                        m_core->v__DOT__thecpu__DOT__alu_pc_valid,
                        m_core->v__DOT__thecpu__DOT__alu_gie,
                        m_core->v__DOT__thecpu__DOT__alu_gie,
#ifdef  OPT_PIPELINED
#ifdef  OPT_PIPELINED
Line 697... Line 715...
#ifdef  OPT_VLIW
#ifdef  OPT_VLIW
                        m_core->v__DOT__thecpu__DOT__r_alu_phase
                        m_core->v__DOT__thecpu__DOT__r_alu_phase
#else
#else
                        false
                        false
#endif
#endif
                        ); ln++;
                        );
 
                } ln++;
                if (m_core->v__DOT__thecpu__DOT__wr_reg_ce)
                if (m_core->v__DOT__thecpu__DOT__wr_reg_ce)
                        mvprintw(ln-1,10,"W");
                        mvprintw(ln-1,10,"W");
                else if (m_core->v__DOT__thecpu__DOT__alu_valid)
                else if (m_core->v__DOT__thecpu__DOT__alu_valid)
                        mvprintw(ln-1,10,(m_core->v__DOT__thecpu__DOT__alu_wr)?"w":"V");
                        mvprintw(ln-1,10,(m_core->v__DOT__thecpu__DOT__alu_wr)?"w":"V");
                else if (m_core->v__DOT__thecpu__DOT__mem_valid)
                else if (m_core->v__DOT__thecpu__DOT__mem_valid)
Line 1022... Line 1041...
#else
#else
                        false
                        false
#endif
#endif
                        ); ln++;
                        ); ln++;
 
 
 
                if (m_core->v__DOT__thecpu__DOT__opvalid_mem) {
 
                        showins(ln, "Mm",
 
                                m_core->v__DOT__thecpu__DOT__mem_ce,
 
                                m_core->v__DOT__thecpu__DOT__mem_pc_valid,
 
                                m_core->v__DOT__thecpu__DOT__alu_gie,
 
#ifdef  OPT_PIPELINED
 
                                m_core->v__DOT__thecpu__DOT__mem_stall,
 
#else
 
                                0,
 
#endif
 
                                alu_pc(),
 
#ifdef  OPT_VLIW
 
                                m_core->v__DOT__thecpu__DOT__r_alu_phase
 
#else
 
                                false
 
#endif
 
                        );
 
                } else {
                showins(ln, "Al",
                showins(ln, "Al",
                        m_core->v__DOT__thecpu__DOT__alu_ce,
                        m_core->v__DOT__thecpu__DOT__alu_ce,
                        m_core->v__DOT__thecpu__DOT__alu_pc_valid,
                        m_core->v__DOT__thecpu__DOT__alu_pc_valid,
                        m_core->v__DOT__thecpu__DOT__alu_gie,
                        m_core->v__DOT__thecpu__DOT__alu_gie,
#ifdef  OPT_PIPELINED
#ifdef  OPT_PIPELINED
Line 1037... Line 1074...
#ifdef  OPT_VLIW
#ifdef  OPT_VLIW
                        m_core->v__DOT__thecpu__DOT__r_alu_phase
                        m_core->v__DOT__thecpu__DOT__r_alu_phase
#else
#else
                        false
                        false
#endif
#endif
                        ); ln++;
                        );
 
                } ln++;
        }
        }
 
 
        void    tick(void) {
        void    tick(void) {
                int gie = m_core->v__DOT__thecpu__DOT__gie;
                int gie = m_core->v__DOT__thecpu__DOT__gie;
                /*
                /*
Line 1602... Line 1640...
 
 
void    usage(void) {
void    usage(void) {
        printf("USAGE: zippy_tb [-a] <testfile.out>\n");
        printf("USAGE: zippy_tb [-a] <testfile.out>\n");
        printf("\n");
        printf("\n");
        printf("\tWhere testfile.out is an output file from the assembler.\n");
        printf("\tWhere testfile.out is an output file from the assembler.\n");
 
        printf("\tThis file needs to be in a raw format and not an ELF\n");
 
        printf("\texecutable.  It will be inserted into memory at a memory\n");
 
        printf("\taddress of 0x0100000.  The memory device itself, the only\n");
 
        printf("\tdevice supported by this simulator, occupies addresses from\n");
 
        printf("\t0x0100000 to 0x01fffff.\n");
 
        printf("\n");
        printf("\t-a\tSets the testbench to run automatically without any\n");
        printf("\t-a\tSets the testbench to run automatically without any\n");
        printf("\t\tuser interaction.\n");
        printf("\t\tuser interaction.\n");
        printf("\n");
        printf("\n");
        printf("\tUser Commands:\n");
        printf("\tUser Commands:\n");
        printf("\t\tWhen the test bench is run interactively, the following\n");
        printf("\t\tWhen the test bench is run interactively, the following\n");

powered by: WebSVN 2.1.0

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