Package avrora.sim

Examples of avrora.sim.Simulator$Probe$Empty


    micaZ = (MicaZ) factory.newPlatform(1, program.getProgram());
    myCpu = (AtmelMicrocontroller) micaZ.getMicrocontroller();
    eeprom = (EEPROM) myCpu.getDevice("eeprom");
   
    avrProperties = (AVRProperties) myCpu.getProperties();
    Simulator sim = myCpu.getSimulator();
    interpreter = (AtmelInterpreter) sim.getInterpreter();
//     State state = interpreter.getState();
    myMemory = new AvrMoteMemory(program.getProgram().getSourceMapping(), avrProperties, interpreter);
  }
View Full Code Here


     * transmissions) are returned.
     * @param r the radio sampling the channel
     * @return the last 8 bits transmitted in the channel
     */
    public byte readChannel(Radio r) {
        Simulator sim = r.getSimulator();
        long time = sim.getClock().getCount();
        synchronizer.waitForNeighbors(time);
        return (byte)radioChannel.read(time, 8);
    }
View Full Code Here

    }

    public ATMega128(int id, ClockDomain cd, InterpreterFactory f, Program p) {
        super(cd, props, new FiniteStateMachine(cd.getMainClock(), MODE_ACTIVE, idleModeNames, transitionTimeMatrix));
        simulator = new Simulator(id, f, this, p);
        interpreter = simulator.getInterpreter();
        MCUCR_reg = getIOReg("MCUCR");
        installPins();
        installDevices();
        new Energy("CPU", modeAmpere, sleepState, simulator);
View Full Code Here

    }

    public ATMega16(int id, ClockDomain cd, InterpreterFactory f, Program p) {
        super(cd, props, new FiniteStateMachine(cd.getMainClock(), MODE_ACTIVE, idleModeNames, transitionTimeMatrix));
        simulator = new Simulator(id, f, this, p);
        interpreter = simulator.getInterpreter();
        MCUCR_reg = getIOReg("MCUCR");
        installPins();
        installDevices();
    }
View Full Code Here

        // this code should be adjusted to account for that.
        controller = new ATMegaController();
        controller.install(mcu);

        //setup energy recording
        Simulator simulator = mcu.getSimulator();
        stateMachine = new FiniteStateMachine(simulator.getClock(), RadioEnergy.startMode, allModeNames, ttm);
       
        new Energy("Radio", RadioEnergy.modeAmpere, stateMachine);

    }
View Full Code Here

    }

    public ATMega32(int id, ClockDomain cd, InterpreterFactory f, Program p) {
        super(cd, props, new FiniteStateMachine(cd.getMainClock(), MODE_ACTIVE, idleModeNames, transitionTimeMatrix));
        simulator = new Simulator(id, f, this, p);
        interpreter = simulator.getInterpreter();
        MCUCR_reg = getIOReg("MCUCR");
        installPins();
        installDevices();
    }
View Full Code Here

  public void fireAfterWrite(State state, int data_addr, byte value){
    Utils.debugMsg("fireAfterWrite()", this);
    Utils.debugMsg("    Adresse: "+data_addr+"  Wert: "+value, this);
    Utils.debugMsg("    Zeitpunkt: "+state.getCycles(), this);

    Simulator sim = state.getSimulator();

    switch(value) {
      case Const.SIG_NODE_TRANSITION_FINISHED:
        Utils.debugMsg("Transition beendet", this);
        extSync.resetEventToNow(sim, value);
View Full Code Here

        Iterator i = sim.getNodeIterator();
        long aggCycles = 0;
        long maxCycles = 0;
        while ( i.hasNext() ) {
            Simulation.Node n = (Simulation.Node)i.next();
            Simulator simulator = n.getSimulator();
            if ( simulator == null ) continue;
            long count = simulator.getClock().getCount();
            aggCycles += count;
            if ( count > maxCycles ) maxCycles = count;
        }
        TermUtil.reportQuantity("Simulated time", maxCycles, "cycles");
        TermUtil.reportQuantity("Time for simulation", StringUtil.milliToSecs(diff), "seconds");
View Full Code Here

                northInt, eastInt, southInt, westInt));

    }

    public void addSimulatorThread(SimulatorThread simThread) {
        Simulator sim = simThread.getSimulator();
        Microcontroller currMCU = sim.getMicrocontroller();

        // iterator over PinNodes
        Iterator i = pinNodes.iterator();

        // go through the complete list of PinNodes
View Full Code Here

     * see simple air for more
     *
     * @see avrora.sim.radio.RadioAir#sampleRSSI(avrora.sim.radio.Radio)
     */
    public int sampleRSSI(Radio r) {
        Simulator s = r.getSimulator();
        long t = s.getState().getCycles();
        synchronizer.waitForNeighbors(t);
        // we just got woken up (or returned immediately from checkRSSIWaiters
        // this means we are now ready to proceed and compute our RSSI value.
        return getLocalAir(r).sampleRSSI(t);
    }
View Full Code Here

TOP

Related Classes of avrora.sim.Simulator$Probe$Empty

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.