head	1.5;
access;
symbols
	bg2_23:1.5
	bg2_22:1.5
	bg2_21:1.5
	bg2_20:1.5
	bg2_16:1.5
	bg2_15:1.5
	bg2_12:1.5
	bg2_07:1.5
	isorc2008_submission:1.4
	handbook_alpha_edition:1.4
	jtres2007_submission:1.4
	bg1_07:1.4
	bg1_06:1.4
	bg1_05:1.4
	TAL_101:1.4
	TAL_100:1.4
	jtres_submission:1.4;
locks; strict;
comment	@# @;


1.5
date	2008.02.24.19.55.00;	author martin;	state Exp;
branches;
next	1.4;
commitid	5aac47c1cb8c4567;

1.4
date	2006.06.23.00.26.25;	author martin;	state Exp;
branches;
next	1.3;
commitid	4a60449b352f4567;

1.3
date	2006.06.17.22.14.50;	author martin;	state Exp;
branches;
next	1.2;
commitid	545b44947ed74567;

1.2
date	2006.06.17.15.38.40;	author martin;	state Exp;
branches;
next	1.1;
commitid	3631449421fc4567;

1.1
date	2006.06.01.02.05.51;	author martin;	state Exp;
branches;
next	;
commitid	7c19447e4b7d4567;


desc
@@


1.5
log
@JOP goes GPL
@
text
@/*
  This file is part of JOP, the Java Optimized Processor
    see <http://www.jopdesign.com/>

  Copyright (C) 2001-2008, Martin Schoeberl (martin@@jopdesign.com)

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package wcet;

import joprt.RtThread;
import wcet.lift.LiftControl;
import wcet.lift.TalIo;

import com.jopdesign.sys.Const;
import com.jopdesign.sys.Native;


public class StartLift {

	private static LiftControl ctrl;
	private static TalIo io;


	static int ts, te, to;


	public static void main(String[] args) {

		ts = Native.rdMem(Const.IO_CNT);
		te = Native.rdMem(Const.IO_CNT);
		to = te-ts;
		// to avoid stack overflow in Control()
		new RtThread(10,10);
		// initialization
		ctrl = new LiftControl();
		io = new TalIo();

		int min = 0x7fffffff;
		int max = 0;
		int val = 0;
		for (int i=0; i<100; ++i) { // @@WCA loop=100
			measure();
			val = te-ts-to;
			if (val<min) min = val;
			if (val>max) max = val;
		}
		System.out.println(min);
		System.out.println(max);
	}
	static void measure() {
		ts = Native.rdMem(Const.IO_CNT);
		loop();
		te = Native.rdMem(Const.IO_CNT);		
	}
	
	static void loop() {
		ctrl.setVals();
		ctrl.getVals();
		ctrl.loop(io);
	}

}
@


1.4
log
@with System.out
@
text
@d1 20
@


1.3
log
@no message
@
text
@d40 2
a41 2
//		System.out.println(min);
//		System.out.println(max);
@


1.2
log
@WCET examples
@
text
@a16 8
//	public static void main(String[] args) {
//
//		// just because it's not so simple to
//		// have the main method in a deeper package
//		// blame MS on this Makefile
//		wcet.lift.Lift.main(null);
//	}

@


1.1
log
@Lift example from Turkey project
@
text
@d3 7
d13 14
d30 25
a54 4
		// just because it's not so simple to
		// have the main method in a deeper package
		// blame MS on this Makefile
		wcet.lift.Lift.main(null);
d56 7
a62 1
			
@

