Package avrora.sim.mcu

Examples of avrora.sim.mcu.MicrocontrollerProperties


        factory = f;

        // reset the state of the simulation
        clock = mcu.getClockDomain().getMainClock();
        MicrocontrollerProperties props = microcontroller.getProperties();
        interpreter = factory.newInterpreter(this, program, props);
    }
View Full Code Here


        // set up the reference to the simulator
        this.simulator = simulator;

        this.clock = simulator.clock;

        MicrocontrollerProperties props = simulator.getMicrocontroller().getProperties();

        SREG = props.getIOReg("SREG");

        // only look for the RAMPZ register if the flash is more than 64kb
        if ( props.hasIOReg("RAMPZ") )
            RAMPZ = props.getIOReg("RAMPZ");
        else
            RAMPZ = -1;

        // if program will not fit onto hardware, error
        if (p.program_end > pr.flash_size)
            throw Avrora.failure("program will not fit into " + pr.flash_size + " bytes");

        // beginning address of SRAM array
        sram_start = pr.ioreg_size + NUM_REGS;

        // maximum data address
        sram_max = NUM_REGS + pr.ioreg_size + pr.sram_size;


        // allocate SRAM
        sram = new byte[sram_max];

        // initialize IO registers to default values
        registers = simulator.getMicrocontroller().getRegisterSet();

        // for performance, we share a refernce to the ActiveRegister[] array
        ioregs = registers.share();
        SREG_reg = ioregs[SREG] = new SREG_reg();

        // allocate FLASH
        ErrorReporter reporter = new ErrorReporter();
        flash = props.codeSegmentFactory.newCodeSegment("flash", this, reporter, p);
        reporter.segment = flash;
        // for performance, we share a reference to the Instr[] array representing flash
        // TODO: implement share() method
        shared_instr = flash.shareCode(null);

        // initialize the interrupt table
        interrupts = new InterruptTable(this, props.num_interrupts);

        SPL_reg = (RWRegister) ioregs[props.getIOReg("SPL")];
        SPH_reg = (RWRegister) ioregs[props.getIOReg("SPH")];
    }
View Full Code Here

            else
                insertSingleWatches(m, s);
        }

        private void insertAllWatches(Microcontroller m, Simulator s) {
            MicrocontrollerProperties props = m.getProperties();
            int size = props.ioreg_size;
            for ( int cntr = 0; cntr < size; cntr++ ) {
                String name = props.getIORegName(cntr);
                if ( name == null ) name = StringUtil.to0xHex(cntr,2);
                s.insertIORWatch(new Watch(name), cntr);
            }
        }
View Full Code Here

        Monitor(Simulator s) {
            simulator = s;
            microcontroller = simulator.getMicrocontroller();
            program = simulator.getProgram();
            MicrocontrollerProperties p = microcontroller.getProperties();
            ramsize = p.sram_size + p.ioreg_size + BaseInterpreter.NUM_REGS;
            if ( LOWER_ADDRESS.get() ) {
                memstart = 0;
            } else {
                memstart = BaseInterpreter.NUM_REGS + p.ioreg_size;
View Full Code Here

            simulator.insertEvent(this, 1);

            spl = new InitWatch();
            sph = new InitWatch();

            MicrocontrollerProperties mp = simulator.getMicrocontroller().getProperties();
            SPL_REG = mp.getIOReg("SPL");
            SPH_REG = mp.getIOReg("SPH");

            simulator.insertIORWatch(spl, SPL_REG);
            simulator.insertIORWatch(sph, SPH_REG);
        }
View Full Code Here

TOP

Related Classes of avrora.sim.mcu.MicrocontrollerProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.