예제 #1
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
예제 #2
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
예제 #3
0
        }//init

        /// <summary>
        /// Called when all the plugins have been created and init.
        /// </summary>
        public void onLoad(object sender, EventArgs e)
        {
            //setup for file handles and file io
            mFiles.RemoveAll(x => true);

            //We only need SWI calls for swi 0x123456
            mIhost.RequestOpCodeRange(0x0f123456, 0x0fffffff, this.Execute);

            //setup callbacks needed
            mIhost.Restart += onRestart;
            mIhost.Unload  += onUnload;
        }//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>
        /// Called when all the plugins have been created and init.
        /// </summary>
        public void onLoad(object sender, EventArgs e)
        {
            //setup for file handles and file io

            //request that we get all SWI calls for the range 0x00 - 0xff (first 256)
            mIhost.RequestOpCodeRange(0x0f000000, 0x0fffff00, this.Execute);

            //setup callbacks needed
            mIhost.Restart += onRestart;
            mIhost.Unload  += onUnload;

            SetupStreams();
        }//onLoad
예제 #6
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)
        {
            //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.
            //
            // However RequestMnemonic is no longer supported in ARMSim#2.0.
            // Thse requests will throw an exception.
            mHost.RequestMnemonic("UDIV", 0x0ef000f0, "RRR", this.onFormInstruction);
            mHost.RequestMnemonic("SDIV", 0x0ef001f0, "RRR", this.onFormInstruction);
        }//onLoad