forked from jop-devel/jop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
814 lines (639 loc) · 25.7 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
<project name="jop" default="all">
<description>
Should build JOP and all tools from scratch.
not included at the moment:
ACEX board
configuration CPLD compiling
Spartan-3 targets
You probably want to change the following parts:
qproj ... your Quartus FPGA project
usb ... USB or serial download
com-port ... your communication ports
use-config-* .. how the board is configured
target-app-path, main-class ... your target application
There is a shortcut for the target app:
p1 ... source directory
p2 ... package name for the main class (with / delimiter)
p3 ... class that contains the main method
for a quick change you can also use command line arguments when invoking Ant:
ant -Dqproj=cycwrk -Dtarget-app-path=java/target/src/bench -Dmain-class=jbe/DoAll japp
</description>
<!--================================================================
Board configuration
================================================================-->
<!-- set property usb to true for an USB based board (dspio, usbmin, lego) -->
<property name="usb" value="true"/>
<!-- com1 is the usual serial port -->
<condition property="com-port" value="/dev/ttyS0">
<not> <istrue value="${usb}"/> </not>
</condition>
<!-- com6 is the FTDI VCOM for the USB download -->
<condition property="com-port" value="/dev/ttyUSB1">
<istrue value="${usb}"/>
</condition>
<!-- use -usb to download the Java application without the echo 'protocol' on USB -->
<condition property="com-flag" value="-e">
<not> <istrue value="${usb}"/> </not>
</condition>
<condition property="com-flag" value="-e -usb">
<istrue value="${usb}"/>
</condition>
<!-- select how to configure the board -->
<property name="use-config-usb" value="true"/>
<!-- <property name="use-config-byteblast" value="true"/> -->
<!-- <property name="use-config-usbblast" value="true"/> -->
<!-- <property name="use-config-urjtag" value="true"/> -->
<!-- choose blaster type for config-byteblast -->
<condition property="blaster-type" value="ByteBlastMV">
<istrue value="${use-config-byteblast}"/>
</condition>
<condition property="blaster-type" value="USB-Blaster">
<istrue value="${use-config-usbblast}"/>
</condition>
<!-- select usbrunner depending on operating system -->
<condition property="usbrunner" value="./USBRunner">
<os family="unix" name="linux"/>
</condition>
<condition property="usbrunner" value="USBRunner.exe">
<os family="windows"/>
</condition>
<!-- set flags to build the right targets -->
<condition property="use-jopser">
<not> <istrue value="${usb}"/> </not>
</condition>
<condition property="use-jopusb">
<istrue value="${usb}"/>
</condition>
<!-- 'some' different Quartus projects -->
<!-- <property name="qproj" value="cycbaseio"/> -->
<!-- <property name="qproj" value="cycbg"/> -->
<!-- <property name="qproj" value="dspio"/> -->
<!-- <property name="qproj" value="lego"/> -->
<!-- <property name="qproj" value="cycfpu"/> -->
<!-- <property name="qproj" value="cyc256x16"/> -->
<!-- <property name="qproj" value="sopcmin"/> -->
<property name="qproj" value="usbmin"/>
<!-- Nelson uncomment this -->
<!-- <property name="qproj" value="cyc12baseio"/> -->
<!-- Jens & Mikael uncomment this -->
<!-- <property name="qproj" value="mikjen"/> -->
<!-- Which project do you want to be downloaded? -->
<property name="dlproj" value="${qproj}"/>
<!-- Which project do you want to be programmed into the flash? -->
<property name="flproj" value="${dlproj}"/>
<!-- IP address for Flash programming -->
<!-- <property name="ipdest" value="192.168.1.2"/> -->
<property name="ipdest" value="192.168.0.123"/>
<!--================================================================
Application configuration
================================================================-->
<!-- JOP RTS configuration -->
<property name="USE_SCOPES" value="false"/>
<property name="USE_SCOPECHECKS" value="false"/>
<property name="ADD_REF_INFO" value="false"/>
<property name="MEASURE" value="true"/>
<property name="jop-conf-string"
value="USE_SCOPES=${USE_SCOPES} USE_SCOPECHECKS=${USE_SCOPECHECKS} ADD_REF_INFO=${ADD_REF_INFO} MEASURE=${MEASURE}"/>
<property name="p1" value="test"/>
<property name="p2" value="test"/>
<property name="p3" value="HelloWorld"/>
<!-- Run full test suite -->
<!-- <property name="p1" value="test"/> -->
<!-- <property name="p2" value="test"/> -->
<!-- <property name="p3" value="DoAll"/> -->
<!--================================================================
Tool configuration
================================================================-->
<!-- application optimization with ProGuard: proguard.sourceforge.net -->
<!-- uncomment following line to use it -->
<!-- <property name="optimize" value="true"/> -->
<!-- To use JCopter, uncomment the following line (value is not important): -->
<!-- <property name="use-jcopter" value="true"/> -->
<!-- <property name="wcet-method" value="main"/> -->
<property name="wcet-method" value="measure"/>
<!--================================================================
end of configuration section
================================================================-->
<property name="tools" value="java/tools"/>
<path id="ext-cp">
<fileset dir="java/lib">
<include name="bcel-5.2.jar"/>
<include name="jakarta-regexp-1.3.jar"/>
<include name="RXTXcomm.jar"/>
<include name="lpsolve55j.jar"/>
<include name="log4j-1.2.15.jar"/>
<!-- wcet -->
<include name="velocity-dep-1.5.jar"/>
<include name="jgrapht-jdk1.5.jar"/>
</fileset>
</path>
<property name="target" value="java/target"/>
<path id="tools-cp">
<pathelement location="${tools}/dist/lib/jop-tools.jar"/>
<path refid="ext-cp"/>
</path>
<property name="pctools" value="java/pc"/>
<target name="optimize" if="optimize">
<move file="java/target/dist/lib/classes.zip" tofile="java/target/dist/lib/in.zip"/>
<taskdef resource="proguard/ant/task.properties" classpath="java/lib/proguard.jar"/>
<proguard configuration="optimize.pro"/>
</target>
<!-- Add your application source paths and class that contains the -->
<!-- main method here. We are using those simple P1/2/3 variables for -->
<!-- p1=directory, p2=package name, and p3=main class -->
<!-- for sources 'inside' the JOP source tree -->
<!-- path to your application source -->
<property name="target-app-path" value="${target}/src/${p1}"/>
<!-- the class that contains the Main method with package names -->
<property name="main-class" value="${p2}/${p3}"/>
<!-- here an example how to define an application outside -->
<!-- from the jop directory tree -->
<!-- Rasmus's distributed SVM (see www.dsvm.org) -->
<!-- <property name="target-app-path" value="/usrx/jop_rasmus/dsvm_hw/DSVMFP/src"/> -->
<!-- <property name="main-class" value="dsvmfp/TestSMO"/> -->
<!-- <property name="main-class" value="test/TestSMO"/> -->
<!-- and the version for Rasmus's machine ;-) -->
<!-- <property name="p1" value="src"/> -->
<!-- <property name="p2" value="dsvmfp"/> -->
<!-- <property name="p3" value="TestSMO"/> -->
<!-- <property name="target-app-path" value="C:\eclipse\workspace\DSVMFP\src"/> -->
<!-- <property name="main-class" value="dsvmfp/TestSMO"/> -->
<!-- Jame's APT system (see www.muvium.com) -->
<!-- <property name="target-app-path" value="/usr2/muvium/jopaptalone/src"/> -->
<!-- <property name="main-class" value="com/muvium/eclipse/PeriodicTimer/JOPBootstrapLauncher"/> -->
<!-- Add more directories here when needed -->
<!-- <path id="target-app-source-path"> -->
<!-- <pathelement location="${target-app-path}"/> -->
<!-- </path> -->
<property name="target-app" value="${target-app-path}/${main-class}.java"/>
<!-- Just any name that the .jop file gets. -->
<property name="jopbin" value="${p3}.jop"/>
<!-- for WCET testing -->
<path id="target-app-source-path">
<dirset dir="${target}">
<include name="src/app"/>
<include name="src/bench"/>
</dirset>
<pathelement location="${target-app-path}"/>
</path>
<path id="target-source">
<dirset dir="${target}">
<include name="src/common"/>
<include name="src/jdk_base"/>
<include name="src/jdk11"/>
<include name="src/rtapi"/>
</dirset>
<path refid="target-app-source-path"/>
</path>
<pathconvert refid="target-source" property="target-source-flattened"/>
<target name="all" depends="directories, tools, jopser, jopusb, jop-config, japp" description="Every everything"/>
<target name="japp" depends="java-app, config-usb, config-urjtag, config-byteblast, download"/>
<target name="clean">
<delete dir="asm/generated"/>
<delete>
<fileset dir="vhdl" includes="*.vhd"/>
</delete>
<delete includeemptydirs="true">
<fileset dir="quartus" includes="**/*.svf,**/*.rpt,**/*.smsg,**/*.sof,**/*.pin,**/*.pin,**/jop.pof,**/*.summary,**/*.ttf,**/*.qdf,**/*.done,**/*.qws,**/db/,**/incremental_db/"/>
</delete>
<ant dir="modelsim" antfile="clean.xml"/>
<delete dir="rbf"/>
<delete file="${target}/src/common/com/jopdesign/sys/Config.java"/>
<delete dir="${tools}/dist"/>
<delete dir="${pctools}/dist"/>
<delete dir="${target}/dist"/>
<delete dir="${target}/wcet"/>
</target>
<target name="tools" description="Builds all the (Java) tools">
<delete dir="${tools}/dist"/>
<mkdir dir="${tools}/dist"/>
<mkdir dir="${tools}/dist/lib"/>
<mkdir dir="${tools}/dist/classes"/>
<javac debug="true" destdir="${tools}/dist/classes" classpathref="ext-cp" encoding="Latin1">
<src path="${tools}/src"/>
<src path="${target}/src/common"/>
<include name="*.java"/>
<include name="org/apache/**/*.java"/>
<include name="com/jopdesign/build/*.java"/>
<include name="com/jopdesign/common/tools/*.java"/>
<include name="com/jopdesign/tools/*.java"/>
<include name="com/jopdesign/dfa/*.java"/>
<include name="com/jopdesign/jcopter/*.java"/>
<include name="com/jopdesign/wcet/*.java"/>
</javac>
<!-- Additional files to be included in the tools.jar -->
<copy todir="${tools}/dist/classes" failonerror="true">
<fileset dir="${tools}/src">
<include name="com/jopdesign/wcet/**/*.vm"/>
</fileset>
</copy>
<jar basedir="${tools}/dist/classes" destfile="${tools}/dist/lib/jop-tools.jar"/>
</target>
<target name="wcet-preprocess" description="Replace bytecodes that JOP cannot execute">
<java classpathref="tools-cp" classname="com.jopdesign.wcet.WCETPreprocess">
<arg line="-c ${target}/dist/classes -o ${target}/dist ${main-class}"/>
</java>
</target>
<target name="run-jcopter" description="Run JCopter on the compiled target" if="use-jcopter">
<java classpathref="tools-cp" classname="com.jopdesign.jcopter.JCopter">
<arg line="-c ${target}/dist/classes -o ${target}/dist --classdir ${target}/dist/classes.opt
--wcet-preprocess
--use-dfa --dfa-cache-dir dfa-cache
--target-method ${wcet-method} ${main-class}"/>
</java>
</target>
<target name="dfa" description="Run DFA on the target application">
<java classpathref="tools-cp" classname="com.jopdesign.dfa.Main">
<arg line="-cp ${target}/dist/lib/classes.zip ${main-class}"/>
</java>
</target>
<target name="zip-classes" description="Zip classes" unless="use-jcopter">
<jar destfile="${target}/dist/lib/classes.zip" basedir="${target}/dist/classes"/>
</target>
<target name="zip-classes-opt" description="Zip optimized classes" if="use-jcopter">
<jar destfile="${target}/dist/lib/classes.zip" basedir="${target}/dist/classes.opt"/>
</target>
<target name="jop-config" description="Build configuration">
<java classpathref="tools-cp" classname="com.jopdesign.tools.GenJopConfig"
output="${target}/src/common/com/jopdesign/sys/Config.java">
<arg line="${jop-conf-string}"/>
</java>
</target>
<target name="java-app" description="Compile and JOPize the application">
<delete dir="${target}/dist"/>
<mkdir dir="${target}/dist"/>
<mkdir dir="${target}/dist/classes"/>
<mkdir dir="${target}/dist/lib"/>
<mkdir dir="${target}/dist/bin"/>
<tempfile property="empty.dir" destDir="${java.io.tmpdir}"/>
<mkdir dir="${empty.dir}"/>
<javac
destdir="${target}/dist/classes"
sourcepathref="target-source"
source="1.5"
includeAntRuntime="false"
debug="true"
encoding="Latin1">
<!-- We want to force bootclasspath, extdirs, and classpath to be empty, but Ant makes this difficult. -->
<!-- If any of these are an empty string, Ant uses the default instead. So, we give them dummy values. -->
<!-- This works for all but classpath, for which Ant removes any non-existent paths. -->
<!-- MS: this is needed for Java 1.5 -->
<bootclasspath path="${empty.dir}"/>
<extdirs path="${empty.dir}"/>
<classpath path="${empty.dir}"/>
<src path="${target}/src/common"/>
<include name="com/jopdesign/sys/*.java"/>
</javac>
<javac
destdir="${target}/dist/classes"
sourcepathref="target-source"
source="1.5"
includeAntRuntime="false"
debug="true"
encoding="Latin1">
<!-- We want to force bootclasspath, extdirs, and classpath to be empty, but Ant makes this difficult. -->
<!-- If any of these are an empty string, Ant uses the default instead. So, we give them dummy values. -->
<!-- This works for all but classpath, for which Ant removes any non-existent paths. -->
<!-- MS: this is needed for Java 1.5 -->
<bootclasspath path="${empty.dir}"/>
<extdirs path="${empty.dir}"/>
<classpath path="${empty.dir}"/>
<src path="${basedir}"/>
<include name="${target-app}"/>
</javac>
<delete dir="${empty.dir}"/>
<antcall target="wcet-preprocess"/>
<antcall target="run-jcopter"/>
<antcall target="zip-classes"/>
<antcall target="zip-classes-opt"/>
<antcall target="optimize"/>
<java
classpathref="tools-cp"
classname="com.jopdesign.build.JOPizer"
failonerror="true"
fork="true">
<sysproperty key="mgci" value="false"/>
<arg line="-cp ${target}/dist/lib/classes.zip -o ${target}/dist/bin/${jopbin} ${main-class}"/>
</java>
<java
classpathref="tools-cp"
classname="com.jopdesign.tools.jop2dat"
failonerror="true"
fork="true">
<arg line="${target}/dist/bin/${jopbin}"/>
</java>
<move todir="modelsim">
<fileset dir="${basedir}">
<include name="*.dat"/>
</fileset>
</move>
</target>
<!-- we moved the pc stuff to its own target to be NOT built on make all. -->
<!-- It depends on javax.comm which is NOT installed by default - Blame SUN on this! -->
<!-- TODO: change it to RXTXcomm if it's working ok -->
<target name="pc">
<delete dir="${pctools}/dist"/>
<mkdir dir="${pctools}/dist/lib"/>
<mkdir dir="${pctools}/dist/classes"/>
<javac debug="true" destdir="${pctools}/dist/classes" encoding="Latin1">
<src path="java/target/src/common"/>
<include name="com/jopdesign/sys/SoftFloat.java"/>
</javac>
<javac debug="true" srcdir="${pctools}/src" destdir="${pctools}/dist/classes" encoding="Latin1"/>
<jar destfile="${pctools}/dist/lib/jop-pc.jar" basedir="${pctools}/dist/classes"/>
</target>
<target name="jopser" description="Creates JBC files used to boot from the serial line" if="use-jopser">
<ant dir="asm" antfile="jopser.xml"/>
<echo message="${qproj}"/>
<antcall target="jbc-project"/>
</target>
<target name="jopusb" description="Creates project.jbc files used to boot from the USB interface" if="use-jopusb">
<ant dir="asm" antfile="jopusb.xml"/>
<echo message="${qproj}"/>
<antcall target="jbc-project"/>
</target>
<target name="jbc-project" description="Helper target for jopser and jopusb">
<antcall target="qsyn">
<param name="qbt" value="${qproj}"/>
</antcall>
<exec executable="quartus_cpf" dir="quartus/${qproj}" failonerror="true">
<arg line="-c jop.sof ../../rbf/${qproj}.rbf"/>
</exec>
<exec executable="quartus_cpf" dir="quartus/${qproj}" failonerror="true">
<arg line="-c -q 10MHz -g 3.3 -n p jop.sof jop.svf"/>
</exec>
</target>
<target name="jopflash" description="Creates project.ttf files used to boot from flash.">
<ant dir="asm" antfile="jopflash"/>
<echo message="${qproj}"/>
<antcall target="qsyn">
<param name="qbt" value="${qproj}"/>
</antcall>
<exec executable="quartus_cpf" failonerror="true">
<arg line="-c quartus/${qproj}/jop.sof ttf/${qproj}.ttf"/>
</exec>
</target>
<target name="qsyn" description="Quartus build process called by jopser, jopusb, ...">
<echo message="${qbt}"/>
<echo message="building ${qbt}"/>
<delete dir="quartus/${qbt}/db"/>
<delete file="quartus/${qbt}/jop.sof"/>
<delete file="jbc/${qbt}.jbc"/>
<delete file="rbf/${qbt}.rbf"/>
<exec executable="quartus_map" failonerror="true">
<arg line="quartus/${qbt}/jop"/>
</exec>
<exec executable="quartus_fit" failonerror="true">
<arg line="quartus/${qbt}/jop"/>
</exec>
<exec executable="quartus_asm" failonerror="true">
<arg line="quartus/${qbt}/jop"/>
</exec>
<exec executable="quartus_sta" failonerror="true">
<arg line="quartus/${qbt}/jop"/>
</exec>
</target>
<target name="sim" depends="java-app" description="Modelsim target without the tools">
<ant dir="asm" antfile="jopsim.xml"/>
<ant dir="modelsim" antfile="sim.xml"/>
</target>
<target name="jsim" depends="java-app" description="JopSim target without the tools">
<java classname="com.jopdesign.tools.JopSim" failonerror="true" fork="true">
<sysproperty key="log" value="false"/>
<classpath>
<pathelement location="java/tools/dist/lib/jop-tools.jar"/>
</classpath>
<arg line="java/target/dist/bin/${jopbin}"/>
</java>
</target>
<target name="config-byteblast" if="use-config-byteblast">
<exec executable="quartus_pgm" dir="quartus/${dlproj}" failonerror="true">
<arg line="-c ${blaster-type} -m JTAG jop.cdf"/>
</exec>
</target>
<target name="config-usb" if="use-config-usb">
<exec executable="${usbrunner}" resolveexecutable="true" dir="rbf" failonerror="true">
<arg line="${dlproj}.rbf"/>
</exec>
</target>
<target name="config-urjtag" if="use-config-urjtag">
<exec executable="jtag" dir="quartus/${dlproj}" failonerror="true">
<arg line="../../urjtag.config"/>
</exec>
</target>
<target name="download">
<!--
Ant's way to logging is very annoying!
that's the JavaDown version
-->
<java classname="com.jopdesign.tools.JavaDown" failonerror="true"
output="/dev/stdout" input="/dev/null">
<classpath>
<pathelement location="java/tools/dist/lib/jop-tools.jar"/>
<pathelement location="java/lib/RXTXcomm.jar"/>
</classpath>
<arg line="${com-flag} java/target/dist/bin/${jopbin} ${com-port}"/>
</java>
<!--
this is the download version with down.exe
<exec executable="down" spawn="true">
<arg line="${com-flag} java/target/dist/bin/${jopbin} ${com-port}"/>
</exec>
-->
<!--
Just generate a dl.bat as Ant logging need line feeds
<echo message="down ${com-flag} java/target/dist/bin/${jopbin} ${com-port}" file="dl.bat"/>
-->
</target>
<target name="prog-flash" depends="java-app" description="Flash programming">
<exec executable="quartus_pgm" failonerror="true">
<arg line="-c ByteblasterMV -m JTAG -o p;jbc/${dlproj}.jbc"/>
</exec>
<exec executable="down" failonerror="true">
<arg line="java/target/dist/bin/${jopbin} ${com-port}"/>
</exec>
<java
classpath="${pctools}/dist/lib/jop-pc.jar"
classname="udp.Flash"
failonerror="true"
fork="true">
<arg line="java/target/dist/bin/${jopbin} ${ipdest}"/>
</java>
<java
classpath="${pctools}/dist/lib/jop-pc.jar"
classname="udp.Flash"
failonerror="true"
fork="true">
<arg line="ttf/${flproj}.ttf ${ipdest}"/>
</java>
<exec executable="quartus_pgm" failonerror="true">
<arg line="-c ${blaster-type} -m JTAG -o p;quartus/cycconf/cyc_conf.pof"/>
</exec>
</target>
<target name="erase-flash">
<java
classpath="${pctools}/dist/lib/jop-pc.jar"
classname="udp.Erase"
failonerror="true"
fork="true">
<arg line="${ipdest}"/>
</java>
</target>
<target name="pld-init">
<exec executable="quartus_pgm" failonerror="true">
<arg line="-c ${blaster-type} -m JTAG -o p;quartus/cycconf/cyc_conf_init.pof"/>
</exec>
</target>
<target name="pld-conf">
<exec executable="quartus_pgm" failonerror="true">
<arg line="-c ${blaster-type} -m JTAG -o p;quartus/cycconf/cyc_conf.pof"/>
</exec>
</target>
<target name="oebb">
<java
classpath="${pctools}/dist/lib/jop-pc.jar"
classname="udp.Flash"
failonerror="true"
fork="true">
<arg line="java/target/dist/bin/oebb_Main.jop 192.168.1.2"/>
</java>
</target>
<target name="bg"
depends="directories, tools, jopflash, jopser, prog-flash"
description="do the whole build process including flash programming for BG and baseio (TAL)"/>
<target name="directories" description="Creates some directories for configuration files">
<mkdir dir="jbc"/>
<mkdir dir="ttf"/>
<mkdir dir="rbf"/>
</target>
<!-- The order is not so perfect. We would prefer to first program the PLD. -->
<target name="xxx" description="Configures the FPGA and programs the PLD but uses a .jbc file">
<exec executable="quartus_pgm" failonerror="true">
<arg line="-c ${blaster-type} -m JTAG -o p;jbc/cycbg.jbc"/>
</exec>
<exec executable="quartus_pgm" failonerror="true">
<arg line="-c ${blaster-type} -m JTAG -o p;jbc/cyc_conf.jbc"/>
</exec>
</target>
<!-- TODO: combine all quartus stuff to a single target -->
<target name="jop-blink-test" description="JOP porting test programs">
<ant dir="asm">
<property name="project" value="blink"/>
</ant>
<echo message="${qproj}"/>
<antcall target="test-project"/>
<exec dir="quartus/${dlproj}" executable="quartus_pgm" failonerror="true">
<arg line="-c ${blaster-type} -m JTAG jop.cdf"/>
</exec>
<exec executable="e" failonerror="true">
<arg line="${com-port}"/>
</exec>
</target>
<target name="jop-testmon">
<ant dir="asm">
<property name="project" value="testmon"/>
</ant>
<echo message="${qproj}"/>
<antcall target="test-project"/>
<exec dir="quartus/${dlproj}" executable="quartus_pgm" failonerror="true">
<arg line="-c ${blaster-type} -m JTAG jop.cdf"/>
</exec>
</target>
<target name="test-project" description="Helper target for jop-blink-test and jop-testmon">
<echo message="building ${qproj}"/>
<delete dir="quartus/${qproj}/db"/>
<property name="qp" value="quartus/${qproj}/jop"/>
<echo message="${qp}"/>
<exec executable="quartus_map" failonerror="true">
<arg line="${qp}"/>
</exec>
<exec executable="quartus_fit" failonerror="true">
<arg line="${qp}"/>
</exec>
<exec executable="quartus_asm" failonerror="true">
<arg line="${qp}"/>
</exec>
<exec executable="quartus_sta" failonerror="true">
<arg line="${qp}"/>
</exec>
<exec dir="quartus/${qproj}" executable="quartus_cpf" failonerror="true">
<arg line="-c jop.cdf ../../jbc/${qproj}.jbc"/>
</exec>
</target>
<target name="udp-dbg" description="UDP debugging">
<java
classname="udp.UDPDbg"
classpath="${pctools}/dist/lib/jop-pc.jar"
failonerror="true"
fork="true"/>
</target>
<!-- use latex=true to get LaTeX friendly table output. -->
<!-- WCETAnalyser options -->
<!-- latex: it will output latex formatting in the tables (afterwards replace ">" with "$>$ and "_" with "\_") -->
<!-- dot: it will generate directed graphs of basic blocks in dot format (see: http://www.graphviz.org/) -->
<!-- jline: it will insert Java source code into the bytecode tables -->
<target name="wca_rup" description="Rasmus's WCET analyser">
<mkdir dir="${target}/tmp"/>
<java
classpathref="tools-cp"
classname="com.jopdesign.build.WCETPreprocess"
failonerror="true" fork="true">
<arg line="-cp ${target}/dist/lib/classes.zip -o ${target}/tmp ${main-class}"/>
</java>
<delete dir="${target}/wcet"/>
<mkdir dir="${target}/wcet"/>
<java
classpathref="tools-cp"
classname="com.jopdesign.wcet.WCETAnalyser"
failonerror="true"
fork="true">
<sysproperty key="latex" value="false"/>
<sysproperty key="dot" value="true"/>
<sysproperty key="jline" value="true"/>
<sysproperty key="ls" value="true"/>
<sysproperty key="java.library.path" value=".:${java.library.path}"/>
<!--
<arg line="-mm ${wcet-method} -cp ${target}/dist/lib/classes.zip -o ${target}/wcet/${p3}wcet.txt -sp "${target-source-flattened} " ${main-class}"/>
-->
<arg line="-mm ${wcet-method} -cp ${target}/tmp -o ${target}/wcet/${p3}wcet.txt -sp ${target-source-flattened} ${main-class}"/>
</java>
</target>
<target name="wcet" description="Benedikt's WCET analyser" depends="java-app">
<delete dir="${target}/wcet"/>
<mkdir dir="${target}/wcet"/>
<java
classpathref="tools-cp"
classname="com.jopdesign.wcet.WCETAnalysis"
failonerror="true"
fork="true">
<jvmarg line="-Xms1280M -Xmx1280M"/>
<sysproperty key="java.library.path" value=".:${java.library.path}"/>
<arg line="--classpath ${target}/dist/lib/classes.zip
--sp ${target-source-flattened}
--reportdir ${target}/wcet
--wcet-preprocess
--target-method ${wcet-method} ${main-class}"/>
</java>
</target>
<target name="dot2eps"> <!-- depends wcet or wcet -->
<exec executable="make" dir="${target}/wcet" failonerror="yes"/>
</target>
<target name="typegraph">
<java
classpathref="tools-cp"
classname="com.jopdesign.common.tools.TypeGraphTool"
failonerror="true"
fork="true">
<arg line="--classpath ${target}/dist/lib/classes.zip --dump-levels --max-level ${main-class}"/>
</java>
</target>
<target name="test">
<java
classpathref="tools-cp"
classname="com.jopdesign.wcet.CallGraph"
failonerror="true"
fork="true">
<arg line="-cp ${target}/dist/lib/classes.zip -o ${target}/wcet/${p3}call.txt -sp ${target-source-flattened} ${main-class}"/>
</java>
</target>
</project>