|
|
|
@ -21,7 +21,7 @@
|
|
|
|
|
|
|
|
|
|
/* Revision History
|
|
|
|
|
* V0.1: - Initial Version
|
|
|
|
|
* V0.2:
|
|
|
|
|
* V0.2:
|
|
|
|
|
* ADDED
|
|
|
|
|
* - Improved debugging. Added Execution and Breakpoint icons in border.
|
|
|
|
|
* - Show more compiler messages.
|
|
|
|
@ -51,10 +51,10 @@
|
|
|
|
|
* - Debian packaging support by "Adrian Knoth"
|
|
|
|
|
* - Initial JTAG support
|
|
|
|
|
* - Initial Help
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* IDEAS (Oct 9, 2005)
|
|
|
|
|
* - Multiple picoblaze support
|
|
|
|
|
* - IO ports (and irq) can be changed from other software.
|
|
|
|
|
* - IO ports (and irq) can be changed from other software.
|
|
|
|
|
* - Download mem file with JTAG
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
@ -93,7 +93,7 @@ enum IDs {
|
|
|
|
|
NEXT_ID,
|
|
|
|
|
INTERRUPT_ID,
|
|
|
|
|
RESET_ID,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VIEW_SERIAL_ID,
|
|
|
|
|
VIEW_SCRATCHPAD_ID
|
|
|
|
|
} ;
|
|
|
|
@ -110,50 +110,50 @@ KPicoSim::KPicoSim() : KMainWindow( 0, "KPicoSim" )
|
|
|
|
|
m_messages = new KListView( m_splitter, "messages" ) ;
|
|
|
|
|
m_simulator = new KSimulator( TQT_TQOBJECT(this) ) ;
|
|
|
|
|
m_processorView = new KProcessorView( this ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_tabWidget->addTab( m_editor, "Source" ) ;
|
|
|
|
|
addDockWindow( m_processorView, DockLeft ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_splitter->setOrientation( Qt::Vertical ) ;
|
|
|
|
|
setCentralWidget( m_splitter ) ;
|
|
|
|
|
m_messages->setAllColumnsShowFocus( true ) ;
|
|
|
|
|
m_messages->setFullWidth( true ) ;
|
|
|
|
|
m_messages->resize( m_messages->width(), m_splitter->height() / 5 ) ;
|
|
|
|
|
m_messages->resize( m_messages->width(), m_splitter->height() / 5 ) ;
|
|
|
|
|
|
|
|
|
|
buildMenu() ;
|
|
|
|
|
|
|
|
|
|
buildMenu() ;
|
|
|
|
|
|
|
|
|
|
KToolBar *toolbar = new KToolBar( this ) ;
|
|
|
|
|
addDockWindow( toolbar ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toolbar->insertButton( "filenew", -1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(m_editor), TQT_SLOT( slotNewFile() ), true, "New" ) ;
|
|
|
|
|
toolbar->insertButton( "fileopen", -1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(m_editor), TQT_SLOT( slotOpen() ), true, "Open" ) ;
|
|
|
|
|
toolbar->insertButton( "filesave", -1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(m_editor), TQT_SLOT( slotSave() ), true, "Save" ) ;
|
|
|
|
|
toolbar->insertButton( "filesaveas", -1, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(m_editor), TQT_SLOT( slotSaveAs() ), true, "Save As" ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_debugBar = new KToolBar( this ) ;
|
|
|
|
|
addDockWindow( m_debugBar ) ;
|
|
|
|
|
m_debugBar->insertButton( UserIcon( "rebuild" ), COMPILE_ID, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( compile() ), true, "Compile" ) ;
|
|
|
|
|
m_debugBar->insertButton( "run", START_SIM_ID, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( startSim() ), true, "Start/Stop Debug" ) ;
|
|
|
|
|
m_debugBar->insertSeparator() ;
|
|
|
|
|
m_debugBar->insertButton( UserIcon( "continue" ), RUN_ID, TQT_SIGNAL( clicked() ), TQT_TQOBJECT(this), TQT_SLOT( startStop() ), false, "Continue" ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_debugBar->insertButton( UserIcon( "next" ), NEXT_ID, TQT_SIGNAL( clicked() ), m_simulator, TQT_SLOT( next() ), false, "Next" ) ;
|
|
|
|
|
m_debugBar->insertButton( UserIcon( "interrupt" ), INTERRUPT_ID, TQT_SIGNAL( clicked() ), m_simulator, TQT_SLOT( interrupt() ), false, "Interrupt" ) ;
|
|
|
|
|
m_debugBar->insertButton( UserIcon( "reset" ), RESET_ID, TQT_SIGNAL( clicked() ), m_simulator, TQT_SLOT( reset() ), false, "Reset" ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect( TQT_TQOBJECT(this), TQT_SIGNAL( run() ), m_simulator, TQT_SLOT( run() ) );
|
|
|
|
|
connect( TQT_TQOBJECT(this), TQT_SIGNAL( stop() ), m_simulator, TQT_SLOT( stop() ) ) ;
|
|
|
|
|
connect( m_simulator, TQT_SIGNAL( stepped( unsigned int ) ), TQT_TQOBJECT(this), TQT_SLOT( stepped( unsigned int ) ) ) ;
|
|
|
|
|
connect( m_processorView, TQT_SIGNAL( processorRegsChanged() ), TQT_TQOBJECT(this), TQT_SLOT( updateProcessorRegs() ) ) ;
|
|
|
|
|
connect( m_processorView, TQT_SIGNAL( processorFlagsChanged() ), TQT_TQOBJECT(this), TQT_SLOT( updateProcessorFlags() ) ) ;
|
|
|
|
|
connect( m_messages, TQT_SIGNAL( clicked( TQListViewItem * ) ), TQT_TQOBJECT(this), TQT_SLOT( messageListClicked( TQListViewItem * ) ) ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_messages->addColumn( "Line" ) ;
|
|
|
|
|
m_messages->addColumn( "Description" ) ;
|
|
|
|
|
m_messages->setSorting( -1, FALSE ) ;
|
|
|
|
|
m_simulator->setMessageList( m_messages ) ;
|
|
|
|
|
|
|
|
|
|
m_simulationMode = false ;
|
|
|
|
|
m_simulationMode = false ;
|
|
|
|
|
m_scratchpadView = NULL ;
|
|
|
|
|
m_serialView = NULL ;
|
|
|
|
|
|
|
|
|
@ -185,51 +185,51 @@ void KPicoSim::buildMenu()
|
|
|
|
|
m_fileMenu->insertItem( ldr->loadIcon( "filenew", KIcon::Small ), "New", TQT_TQOBJECT(this), TQT_SLOT( slotFileNew() ) ) ;
|
|
|
|
|
m_fileMenu->insertItem( ldr->loadIcon( "fileopen", KIcon::Small ), "Open", TQT_TQOBJECT(m_editor), TQT_SLOT( slotOpen() ) ) ;
|
|
|
|
|
m_fileMenu->insertSeparator() ;
|
|
|
|
|
m_fileMenu->insertItem( ldr->loadIcon( "filesave", KIcon::Small ), "Save", TQT_TQOBJECT(m_editor), TQT_SLOT( slotSave() ), TQKeySequence::TQKeySequence( "CTRL+S" ) ) ;
|
|
|
|
|
m_fileMenu->insertItem( ldr->loadIcon( "filesave", KIcon::Small ), "Save", TQT_TQOBJECT(m_editor), TQT_SLOT( slotSave() ), TQKeySequence( "CTRL+S" ) ) ;
|
|
|
|
|
m_fileMenu->insertItem( ldr->loadIcon( "filesaveas", KIcon::Small ), "Save As...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotSaveAs() ) ) ;
|
|
|
|
|
m_fileMenu->insertSeparator() ;
|
|
|
|
|
m_fileMenu->insertItem( ldr->loadIcon( "fileprint", KIcon::Small ), "Print...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotPrint() ), TQKeySequence::TQKeySequence( "CTRL+P" ) ) ;
|
|
|
|
|
m_fileMenu->insertItem( ldr->loadIcon( "fileprint", KIcon::Small ), "Print...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotPrint() ), TQKeySequence( "CTRL+P" ) ) ;
|
|
|
|
|
m_fileMenu->insertSeparator() ;
|
|
|
|
|
m_fileMenu->insertItem( "Export", exportMenu ) ;
|
|
|
|
|
m_fileMenu->insertSeparator() ;
|
|
|
|
|
m_fileMenu->insertItem( ldr->loadIcon( "fileclose", KIcon::Small ), "Quit", TQT_TQOBJECT(this), TQT_SLOT( slotClose() ) ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_editMenu = new KPopupMenu( this ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "undo", KIcon::Small ), "Undo", TQT_TQOBJECT(m_editor), TQT_SLOT( slotUndo() ),TQKeySequence::TQKeySequence( "CTRL+Z" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "redo", KIcon::Small ), "Redo", TQT_TQOBJECT(m_editor), TQT_SLOT( slotRedo() ),TQKeySequence::TQKeySequence( "CTRL+SHIFT+Z" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "undo", KIcon::Small ), "Undo", TQT_TQOBJECT(m_editor), TQT_SLOT( slotUndo() ),TQKeySequence( "CTRL+Z" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "redo", KIcon::Small ), "Redo", TQT_TQOBJECT(m_editor), TQT_SLOT( slotRedo() ),TQKeySequence( "CTRL+SHIFT+Z" ) ) ;
|
|
|
|
|
m_editMenu->insertSeparator() ;
|
|
|
|
|
m_editMenu->insertItem( "Select All", TQT_TQOBJECT(m_editor), TQT_SLOT( slotSelectAll() ),TQKeySequence::TQKeySequence( "CTRL+A" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( "Select All", TQT_TQOBJECT(m_editor), TQT_SLOT( slotSelectAll() ),TQKeySequence( "CTRL+A" ) ) ;
|
|
|
|
|
m_editMenu->insertSeparator() ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "editcut", KIcon::Small ), "Cut", TQT_TQOBJECT(m_editor), TQT_SLOT( slotCut() ),TQKeySequence::TQKeySequence( "CTRL+X" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "editcopy", KIcon::Small ), "Copy", TQT_TQOBJECT(m_editor), TQT_SLOT( slotCopy() ),TQKeySequence::TQKeySequence( "CTRL+C" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "editpaste", KIcon::Small ), "Paste", TQT_TQOBJECT(m_editor), TQT_SLOT( slotPaste() ),TQKeySequence::TQKeySequence( "CTRL+V" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "editcut", KIcon::Small ), "Cut", TQT_TQOBJECT(m_editor), TQT_SLOT( slotCut() ),TQKeySequence( "CTRL+X" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "editcopy", KIcon::Small ), "Copy", TQT_TQOBJECT(m_editor), TQT_SLOT( slotCopy() ),TQKeySequence( "CTRL+C" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "editpaste", KIcon::Small ), "Paste", TQT_TQOBJECT(m_editor), TQT_SLOT( slotPaste() ),TQKeySequence( "CTRL+V" ) ) ;
|
|
|
|
|
m_editMenu->insertSeparator() ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "tqfind", KIcon::Small ), "Find...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotFind() ), TQKeySequence::TQKeySequence( "CTRL+F" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( "Find Next", TQT_TQOBJECT(m_editor), TQT_SLOT( slotFindNext() ), TQKeySequence::TQKeySequence( "F3" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( ldr->loadIcon( "tqfind", KIcon::Small ), "Find...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotFind() ), TQKeySequence( "CTRL+F" ) ) ;
|
|
|
|
|
m_editMenu->insertItem( "Find Next", TQT_TQOBJECT(m_editor), TQT_SLOT( slotFindNext() ), TQKeySequence( "F3" ) ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_debugMenu = new KPopupMenu( this ) ;
|
|
|
|
|
m_debugMenu->insertSeparator() ;
|
|
|
|
|
m_debugMenu->insertItem( ldr->loadIcon( "rebuild", KIcon::Small ), "Compile", TQT_TQOBJECT(this), TQT_SLOT( compile() ), TQKeySequence::TQKeySequence( "SHIFT+F9" ) ) ;
|
|
|
|
|
m_debugMenu->insertItem( ldr->loadIcon( "run", KIcon::Small ), "Start Debug", TQT_TQOBJECT(this), TQT_SLOT( startSim() ), TQKeySequence::TQKeySequence( "F9" ) , START_SIM_ID ) ;
|
|
|
|
|
m_debugMenu->insertItem( ldr->loadIcon( "rebuild", KIcon::Small ), "Compile", TQT_TQOBJECT(this), TQT_SLOT( compile() ), TQKeySequence( "SHIFT+F9" ) ) ;
|
|
|
|
|
m_debugMenu->insertItem( ldr->loadIcon( "run", KIcon::Small ), "Start Debug", TQT_TQOBJECT(this), TQT_SLOT( startSim() ), TQKeySequence( "F9" ) , START_SIM_ID ) ;
|
|
|
|
|
|
|
|
|
|
m_debugMenu->insertSeparator() ;
|
|
|
|
|
m_debugMenu->insertItem( "Continue", TQT_TQOBJECT(this), TQT_SLOT( startStop() ), TQKeySequence::TQKeySequence( "F10" ) , RUN_ID ) ;
|
|
|
|
|
m_debugMenu->insertItem( "Next", m_simulator, TQT_SLOT( next() ), TQKeySequence::TQKeySequence( "F5" ) , NEXT_ID ) ;
|
|
|
|
|
m_debugMenu->insertItem( "Interrupt", m_simulator, TQT_SLOT( interrupt() ), TQKeySequence::TQKeySequence( "F4" ) , INTERRUPT_ID ) ;
|
|
|
|
|
m_debugMenu->insertItem( "Reset", m_simulator, TQT_SLOT( reset() ), TQKeySequence::TQKeySequence( "F11" ) , RESET_ID ) ;
|
|
|
|
|
|
|
|
|
|
m_debugMenu->insertItem( "Continue", TQT_TQOBJECT(this), TQT_SLOT( startStop() ), TQKeySequence( "F10" ) , RUN_ID ) ;
|
|
|
|
|
m_debugMenu->insertItem( "Next", m_simulator, TQT_SLOT( next() ), TQKeySequence( "F5" ) , NEXT_ID ) ;
|
|
|
|
|
m_debugMenu->insertItem( "Interrupt", m_simulator, TQT_SLOT( interrupt() ), TQKeySequence( "F4" ) , INTERRUPT_ID ) ;
|
|
|
|
|
m_debugMenu->insertItem( "Reset", m_simulator, TQT_SLOT( reset() ), TQKeySequence( "F11" ) , RESET_ID ) ;
|
|
|
|
|
|
|
|
|
|
m_debugMenu->insertSeparator() ;
|
|
|
|
|
m_debugMenu->insertItem( "Toggle Breakpoint", TQT_TQOBJECT(m_editor), TQT_SLOT( slotToggleBreakpoint() ), TQKeySequence::TQKeySequence( "F8" ) ) ;
|
|
|
|
|
|
|
|
|
|
m_debugMenu->insertItem( "Toggle Breakpoint", TQT_TQOBJECT(m_editor), TQT_SLOT( slotToggleBreakpoint() ), TQKeySequence( "F8" ) ) ;
|
|
|
|
|
|
|
|
|
|
m_settingsMenu = new KPopupMenu( this ) ;
|
|
|
|
|
m_settingsMenu->insertItem( "Configure Editor...", TQT_TQOBJECT(m_editor), TQT_SLOT( slotShowConfig() ) ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_peripheralMenu = new KPopupMenu( this ) ;
|
|
|
|
|
m_peripheralMenu->insertItem( "I/O Port", TQT_TQOBJECT(this), TQT_SLOT( newIOPort() ) ) ;
|
|
|
|
|
m_peripheralMenu->insertItem( "Scratchpad", TQT_TQOBJECT(this), TQT_SLOT( showScratchpad() ), 0, VIEW_SCRATCHPAD_ID ) ;
|
|
|
|
|
m_peripheralMenu->insertItem( "Serial port", TQT_TQOBJECT(this), TQT_SLOT( showSerialPort() ), 0, VIEW_SERIAL_ID ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_jtagMenu = new KPopupMenu( this ) ;
|
|
|
|
|
m_jtagMenu->insertItem( "Download", TQT_TQOBJECT(this), TQT_SLOT( jtagDownload() ) ) ;
|
|
|
|
|
|
|
|
|
@ -246,7 +246,7 @@ void KPicoSim::buildMenu()
|
|
|
|
|
) ;
|
|
|
|
|
aboutData->addAuthor( "Mark Six", "m6@xs4all.nl", "http://www.xs4all.nl/~marksix" ) ;
|
|
|
|
|
|
|
|
|
|
KHelpMenu *helpMenu = new KHelpMenu( this, aboutData, false ) ;
|
|
|
|
|
KHelpMenu *helpMenu = new KHelpMenu( this, aboutData, false ) ;
|
|
|
|
|
KPopupMenu *help = helpMenu->menu() ;
|
|
|
|
|
|
|
|
|
|
menuBar()->insertItem( "File", m_fileMenu ) ;
|
|
|
|
@ -256,17 +256,17 @@ void KPicoSim::buildMenu()
|
|
|
|
|
menuBar()->insertItem( "JTAG", m_jtagMenu ) ;
|
|
|
|
|
menuBar()->insertItem( "Settings", m_settingsMenu ) ;
|
|
|
|
|
menuBar()->insertItem( "Help", help ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_debugMenu->setItemEnabled( RUN_ID, false ) ;
|
|
|
|
|
m_debugMenu->setItemEnabled( NEXT_ID, false ) ;
|
|
|
|
|
m_debugMenu->setItemEnabled( INTERRUPT_ID, false ) ;
|
|
|
|
|
m_debugMenu->setItemEnabled( RESET_ID, false ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_peripheralMenu->setCheckable( true );
|
|
|
|
|
m_peripheralMenu->setItemChecked( VIEW_SERIAL_ID, false ) ;
|
|
|
|
|
m_peripheralMenu->setItemChecked( VIEW_SCRATCHPAD_ID, false ) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
menuBar()->show() ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|