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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [bench/] [cpp/] [zippy_tb.cpp] - Diff between revs 76 and 87

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

Rev 76 Rev 87
Line 731... Line 731...
                mvprintw(ln-2, 48, "r_opB: 0x%08x",
                mvprintw(ln-2, 48, "r_opB: 0x%08x",
                        m_core->v__DOT__thecpu__DOT__opB);
                        m_core->v__DOT__thecpu__DOT__opB);
                */
                */
                mvprintw(ln-3, 48, "Op(%x)%8x,%8x->",
                mvprintw(ln-3, 48, "Op(%x)%8x,%8x->",
                        m_core->v__DOT__thecpu__DOT__opn,
                        m_core->v__DOT__thecpu__DOT__opn,
                        m_core->v__DOT__thecpu__DOT__r_opA,
                        m_core->v__DOT__thecpu__DOT__opA,
                        m_core->v__DOT__thecpu__DOT__r_opB);
                        m_core->v__DOT__thecpu__DOT__opB);
                if (m_core->v__DOT__thecpu__DOT__alu_valid)
                if (m_core->v__DOT__thecpu__DOT__alu_valid)
                        printw("%08x", m_core->v__DOT__thecpu__DOT__alu_result);
                        printw("%08x", m_core->v__DOT__thecpu__DOT__alu_result);
                else
                else
                        printw("%8s","");
                        printw("%8s","");
                mvprintw(ln-1, 48, "%s%s%s ",
                mvprintw(ln-1, 48, "%s%s%s ",
                        (m_core->v__DOT__thecpu__DOT__alu_valid)?"A"
                        (m_core->v__DOT__thecpu__DOT__alu_valid)?"A"
                          :((m_core->v__DOT__thecpu__DOT__doalu__DOT__genblk3__DOT__r_busy)?"a":" "),
                          :((m_core->v__DOT__thecpu__DOT__doalu__DOT__genblk2__DOT__r_busy)?"a":" "),
                        (m_core->v__DOT__thecpu__DOT__div_valid)?"D"
                        (m_core->v__DOT__thecpu__DOT__div_valid)?"D"
                          :((m_core->v__DOT__thecpu__DOT__div_busy)?"d":" "),
                          :((m_core->v__DOT__thecpu__DOT__div_busy)?"d":" "),
                        (m_core->v__DOT__thecpu__DOT__div_valid)?"F"
                        (m_core->v__DOT__thecpu__DOT__div_valid)?"F"
                          :((m_core->v__DOT__thecpu__DOT__div_busy)?"f":" "));
                          :((m_core->v__DOT__thecpu__DOT__div_busy)?"f":" "));
                printw("MEM: %s%s %s%s %s %-5s",
                printw("MEM: %s%s %s%s %s %-5s",
Line 1752... Line 1752...
                // while((tb->wb_read(CMD_REG) & (CMD_HALT|CMD_STALL))==(CMD_HALT|CMD_STALL))
                // while((tb->wb_read(CMD_REG) & (CMD_HALT|CMD_STALL))==(CMD_HALT|CMD_STALL))
                        // tb->show_state();
                        // tb->show_state();
 
 
                while(!done) {
                while(!done) {
                        if ((high_speed)&&(!manual)&&(!halted)) {
                        if ((high_speed)&&(!manual)&&(!halted)) {
 
                                // chv = getch();
 
 
                                struct  pollfd  fds[1];
                                struct  pollfd  fds[1];
                                fds[0].fd = STDIN_FILENO;
                                fds[0].fd = STDIN_FILENO;
                                fds[0].events = POLLIN;
                                fds[0].events = POLLIN;
 
 
                                if (poll(fds, 1, 0) > 0)
                                if (poll(fds, 1, 0) > 0)
                                        chv = getch();
                                        chv = getch();
                                else
                                else
                                        chv = ERR;
                                        chv = ERR;
 
 
                        } else {
                        } else {
                                chv = getch();
                                chv = getch();
                        }
                        }
                        switch(chv) {
                        switch(chv) {
                        case 'h': case 'H':
                        case 'h': case 'H':
Line 1771... Line 1775...
                                        erase();
                                        erase();
                                halted = true;
                                halted = true;
                                break;
                                break;
                        case 'G':
                        case 'G':
                                high_speed = true;
                                high_speed = true;
 
                                // cbreak();
                        case 'g':
                        case 'g':
                                tb->wb_write(CMD_REG, 0);
                                tb->wb_write(CMD_REG, 0);
                                if (halted)
                                if (halted)
                                        erase();
                                        erase();
                                halted = false;
                                halted = false;
Line 1798... Line 1803...
                                if (!halted)
                                if (!halted)
                                        erase();
                                        erase();
                                tb->step();
                                tb->step();
                                manual = false;
                                manual = false;
                                halted = true;
                                halted = true;
 
                                // if (high_speed)
 
                                        // halfdelay(1);
                                high_speed = false;
                                high_speed = false;
                                break;
                                break;
                        case 'S':
                        case 'S':
                                if ((!manual)||(halted))
                                if ((!manual)||(halted))
                                        erase();
                                        erase();
                                manual = true;
                                manual = true;
                                halted = true;
                                halted = true;
 
                                // if (high_speed)
 
                                        // halfdelay(1);
                                high_speed = false;
                                high_speed = false;
                                tb->m_core->v__DOT__cmd_halt = 0;
                                tb->m_core->v__DOT__cmd_halt = 0;
                                tb->m_core->v__DOT__cmd_step = 1;
                                tb->m_core->v__DOT__cmd_step = 1;
                                tb->eval();
                                tb->eval();
                                tb->tick();
                                tb->tick();
Line 1816... Line 1825...
                        case 'T': // 
                        case 'T': // 
                                if ((!manual)||(halted))
                                if ((!manual)||(halted))
                                        erase();
                                        erase();
                                manual = true;
                                manual = true;
                                halted = true;
                                halted = true;
 
                                // if (high_speed)
 
                                        // halfdelay(1);
                                high_speed = false;
                                high_speed = false;
                                tb->m_core->v__DOT__cmd_halt = 1;
                                tb->m_core->v__DOT__cmd_halt = 1;
                                tb->m_core->v__DOT__cmd_step = 0;
                                tb->m_core->v__DOT__cmd_step = 0;
                                tb->eval();
                                tb->eval();
                                tb->tick();
                                tb->tick();
Line 1827... Line 1838...
                        case 't':
                        case 't':
                                if ((!manual)||(halted))
                                if ((!manual)||(halted))
                                        erase();
                                        erase();
                                manual = true;
                                manual = true;
                                halted = false;
                                halted = false;
 
                                // if (high_speed)
 
                                        // halfdelay(1);
                                high_speed = false;
                                high_speed = false;
                //              tb->m_core->v__DOT__thecpu__DOT__step = 0;
                //              tb->m_core->v__DOT__thecpu__DOT__step = 0;
                                tb->m_core->v__DOT__cmd_halt = 0;
                                tb->m_core->v__DOT__cmd_halt = 0;
                //              tb->m_core->v__DOT__cmd_step = 0;
                //              tb->m_core->v__DOT__cmd_step = 0;
                                tb->tick();
                                tb->tick();

powered by: WebSVN 2.1.0

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