예제 #1
0
        }//Init

        /// <summary>
        /// The onLoad is called after all plugins have had their init called and are all loaded.
        /// </summary>
        private void onLoad(object sender, EventArgs args)
        {
            //request a panel to display our user interface in from the simulator
            Panel panel = mHost.RequestPanel(this.PluginName);

            //create the plugin user control and add it to the requested panel
            mButtonTimerDisplay = new ButtonTimerDisplay();
            panel.Controls.Add(mButtonTimerDisplay);

            //Create the timer control and initialize it
            mTimerControl = new TimerControl(mHost, mButtonTimerDisplay);

            //Create the leds control and initialize it
            mLedsControl = new LedsControl(mHost, mButtonTimerDisplay.LedsDisplay);

            //Create the black buttons control and initialize it
            mBlackButtonsControl = new BlackButtonsControl(mHost, mButtonTimerDisplay.BlackButtons);

            //Create the eight segment control and initialize it
            mEightSegmentControl = new EightSegmentControl(mHost, mButtonTimerDisplay.EightSegmentDisplay);

            mTwoLineLCDControl = new TwoLineLCDControl(mHost, mButtonTimerDisplay.TwoLineLCDDisplay);

            mTrackBarControl = new TrackBarControl(mHost, mButtonTimerDisplay.TrackBarControl, mButtonTimerDisplay.TrackBarLabel);
        }//onLoad
예제 #2
0
        }//Init

        /// <summary>
        /// The onLoad is called after all plugins have had their init called and are all loaded.
        /// </summary>
        public void onLoad(object sender, EventArgs e)
        {
            //subscribe to the restart event so we can re-init the register when the simulation is restarted
            mHost.Restart += onRestart;

            //subscribe to the Start and Stop events so we can track when the simulation is running
            mHost.StartSimulation += onStart;
            mHost.StopSimulation  += onStop;

            //request a panel from ARMSim user interface, create the register64 control and add it to the panel
            Panel panel = mHost.RequestPanel(this.PluginName);

            mRegister64Control = new ARMSim.Plugins.UIControls.Register64TextBox();
            panel.Controls.Add(mRegister64Control);

            //request the opcodes from the undefined opcode range of the ARM processor. Specify the execute method
            //that will be called when this opcode is encountered by the simulation engine.
            mHost.RequestOpcodeRange(0x0ef000f0, 0x0ffff0f0, this.onExecute);

            //Here we will insert the mnemonics of the new instructions into the parsing tables. The method specified
            //is called when the instruction is parsed. It allows us to form the final opcode with the operands
            //encoded into the opcode.
            mHost.RequestMnemonic("LOAD64", 0x0ef000f0, "R", this.onFormInstruction64);
            mHost.RequestMnemonic("STORE64", 0x0ef001f0, "R", this.onFormInstruction64);
            mHost.RequestMnemonic("ADDS64", 0x0ef002f0, "R", this.onFormInstruction64);
            mHost.RequestMnemonic("ADD64", 0x0ef003f0, "R", this.onFormInstruction64);
            mHost.RequestMnemonic("MULS64", 0x0ef004f0, "R", this.onFormInstruction64);
            mHost.RequestMnemonic("MUL64", 0x0ef005f0, "R", this.onFormInstruction64);
            mHost.RequestMnemonic("MULAS64", 0x0ef006f0, "R", this.onFormInstruction64);
            mHost.RequestMnemonic("MULA64", 0x0ef007f0, "R", this.onFormInstruction64);

            //set the current internal 64 bit value(0) into the UI control
            //since the simulation is not running it will update
            UpdateRegister64();
        }//onLoad
예제 #3
0
        }//init

        /// <summary>
        /// The onLoad function is called after all the plugins have been loaded and their
        /// init methods called.
        /// </summary>
        public void onLoad(object sender, EventArgs e)
        {
            mEmbestBoardControl = new ARMSim.Plugins.UIControls.EmbestBoard();

            Panel panel = mIHost.RequestPanel(this.PluginName);

            panel.Controls.Add(mEmbestBoardControl);

            //request that we get all SWI calls for the range 0x0200 - 0x0x2ff
            mIHost.RequestOpCodeRange(0x0f000200, 0x0fffff00, this.onExecute);
        }//onLoad
예제 #4
0
        //called after all plugins have had their init called and are all loaded
        public void onLoad(object sender, EventArgs e)
        {
            mHost.Restart += onRestart;

            Panel panel = mHost.RequestPanel(this.PluginName);

            mTrafficIntersectionControl = new TrafficIntersectionControl();
            panel.Controls.Add(mTrafficIntersectionControl);

            //request that we get all SWI calls for the range 0x0100 - 0x0x1ff
            mHost.RequestOpCodeRange(0x0f000100, 0x0fffff00, this.onExecute);
        }
        }//init

        /// <summary>
        /// The onLoad function is called after all the plugins have been loaded and their
        /// init methods called.
        /// </summary>
        private void onLoad(object sender, EventArgs e)
        {
            ARMSim.Plugins.UIControls.EmbestBoard embestBoardControl         = new ARMSim.Plugins.UIControls.EmbestBoard();
            InterruptControllerDisplay            interruptControllerDisplay = new InterruptControllerDisplay(mInteruptController);

            mInteruptController = new InteruptController(mIHost, interruptControllerDisplay);
            mWatchDogTimer      = new WatchDogTimer(mIHost, mInteruptController);
            mPWMTimer           = new PWMTimer(mIHost, mInteruptController);
            mIOPorts            = new IOPorts(mIHost);
            mLeds                = new Leds(mIHost, mIOPorts, embestBoardControl.Leds);
            mBlackButtons        = new BlackButtons(mIOPorts, mInteruptController, embestBoardControl.BlackButtons);
            mBlueButtons         = new BlueButtons(mIHost, mIOPorts, mInteruptController, embestBoardControl.BlueButtons);
            mLcdDisplay          = new LcdDisplay(mIHost, embestBoardControl.Lcd);
            mEightSegmentDisplay = new EightSegmentDisplay(mIHost, embestBoardControl.EightSegmentDisplay);
            mUarts               = new Uarts(mIHost, mInteruptController);

            mIHost.RequestPanel(this.PluginName).Controls.Add(embestBoardControl);
            mIHost.RequestPanel("InterruptControllerDisplay").Controls.Add(interruptControllerDisplay);

            mIHost.Restart += onRestart;
        }//onLoad
예제 #6
0
        }//init

        /// <summary>
        /// The onLoad function is called after all the plugins have been loaded and their
        /// init methods called.
        /// </summary>
        public void onLoad(object sender, EventArgs e)
        {
            //Subscribe to the restart event so we can clear the eight segment display when the simulation is restarted.
            mIHost.Restart += onRestart;

            //Create the Eight segment display user control
            mEightSegmentDisplayControl = new UIControls.EightSegmentDisplay();

            //request a panel from the UI and add our control
            Panel panel = mIHost.RequestPanel(this.PluginName);

            panel.Controls.Add(mEightSegmentDisplayControl);

            //request reads/writes to the memory address of the display
            mIHost.RequestMemoryBlock(0x02140000, 0xffffffff, this.onMemoryAccessRead, this.onMemoryAccessWrite);

            //request that we get the SWI instruction (swi 0x100) for our plugin and specify the function
            // to call when it is encountered by the simulation engine.
            mIHost.RequestOpCodeRange(0x0f000100, 0x0fffffff, this.onExecuteSWI);

            //Here we are going to request part of the undefined opcode space of the ARM processor.
            //We are going to create 2 instructions to write to the Eight Segment Display as follows:
            // SEGDIGIT reg,  where reg is a gernal purpose register
            //    This instruction will take the digit in register reg and write that digit to the display.
            //    If the digit is NOT 0-9, nothing is written to the display
            //
            // SEGPATTERN reg, where reg is a gernal purpose register
            //    This instruction will take the 8 bit pattern in register reg and write that pattern to the display.
            //    The top 24 bits are ignored, only the bottom 8 bits are used.
            //
            // We will encode which instruction in bit 8 of the opcode and encode the register number in the
            // bottom 4 bits of the opcode (bits 0-3) (See onExecuteEightSegmentOpcode for details)
            mIHost.RequestOpCodeRange(0x0ef000f0, 0x0ffffef0, this.onExecuteEightSegmentOpcode);
            //mIHost.RequestOpcodeRange("*ef00ef*", this.onExecuteEightSegmentOpcode);

            // To make testing of these instructions easier, we will insert some mnemonics into the parsing
            // tables so we can reference the instructions by their symbols. We need to provide a base opcode
            // and the expected paramaters. In this case we expect a single register so we use the operand "R"
            // We also need to provide a delegate callback that the parser will call when this mnemonic is parsed.
            //
            // However, RequestMnemonic is no longer supported in ARMSim#2.0
            // these requests will throw an exception
            mIHost.RequestMnemonic("SEGDIGIT", 0x0ef000f0, "R", this.onFormEightSegmentOpCode);
            mIHost.RequestMnemonic("SEGPATTERN", 0x0ef001f0, "R", this.onFormEightSegmentOpCode);
        }//onLoad
예제 #7
0
        }//Init

        /// <summary>
        /// The onLoad is called after all plugins have had their init called and are all loaded.
        /// </summary>
        private void onLoad(object sender, EventArgs e)
        {
            mMatrixStackDisplay      = new MatrixStackDisplay();
            mMatrixStackDisplay.Dock = DockStyle.Fill;

            //request a panel from ARMSim user interface, create the register64 control and add it to the panel
            Panel panel = mHost.RequestPanel(this.PluginName);

            panel.Controls.Add(mMatrixStackDisplay);
            panel.Resize += new EventHandler(this.panel1_Resize);

            //subscribe to the restart event so we can re-init the register when the simulation is restarted
            mHost.Restart += onRestart;

            //subscribe to the Start and Stop events so we can track when the simulation is running
            mHost.StartSimulation += mHost_Start;
            mHost.StopSimulation  += mHost_StopSimulation;

            //request the opcodes from the undefined opcode range of the ARM processor. Specify the execute method
            //that will be called when this opcode is encountered by the simulation engine.
            mHost.RequestOpcodeRange(0x0ef000f0, 0x0ff000f0, this.onExecute);

            //Here we will insert the mnemonics of the new instructions into the parsing tables. The method specified
            //is called whwn the instruction is parsed. It allows us to form the final opcode with the operands
            //encoded into the opcode.
            mHost.RequestMnemonic("MLOADI", 0x0ef000f0, "RRR", this.onFormInstruction3);
            mHost.RequestMnemonic("MLOADF", 0x0ef001f0, "RRR", this.onFormInstruction3);
            mHost.RequestMnemonic("MLOADD", 0x0ef002f0, "RRR", this.onFormInstruction3);
            mHost.RequestMnemonic("MPOP", 0x0ef008f0, "RRR", this.onFormInstruction3);

            mHost.RequestMnemonic("MIDENT", 0x0ef003f0, "R", this.onFormInstruction1);
            mHost.RequestMnemonic("MADD", 0x0ef004f0, "", this.onFormInstruction1);
            mHost.RequestMnemonic("MSUB", 0x0ef005f0, "", this.onFormInstruction1);
            mHost.RequestMnemonic("MMUL", 0x0ef006f0, "", this.onFormInstruction1);
            mHost.RequestMnemonic("MDOT", 0x0ef007f0, "", this.onFormInstruction1);
        }//onLoad