Skip to content

Commit 0c4c26d

Browse files
author
Sebastien Bourdeauducq
committedOct 1, 2011
fpvm: new scheduler from Werner (NEEDS REPLACEMENT OF alloca())
1 parent 7414dca commit 0c4c26d

File tree

9 files changed

+715
-31
lines changed

9 files changed

+715
-31
lines changed
 

‎software/bios/Makefile

+6-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ boot.o: ../../software/include/net/microudp.h
4444
boot.o: ../../software/include/net/tftp.h ../../software/include/hal/vga.h
4545
boot.o: ../../software/include/hal/usb.h ../../software/include/hw/hpdmc.h
4646
boot.o: ../../software/include/hw/common.h ../../software/include/hw/flash.h
47-
boot.o: boot.h
47+
boot.o: unlzma.h boot.h
4848
isr.o: ../../software/include/hw/interrupts.h
4949
isr.o: ../../software/include/base/irq.h ../../software/include/base/uart.h
5050
isr.o: ../../software/include/hal/usb.h ../../software/include/hal/tmu.h
@@ -62,11 +62,12 @@ main.o: ../../software/include/base/version.h
6262
main.o: ../../software/include/net/mdio.h ../../software/include/hw/fmlbrg.h
6363
main.o: ../../software/include/hw/sysctl.h ../../software/include/hw/common.h
6464
main.o: ../../software/include/hw/gpio.h ../../software/include/hw/flash.h
65-
main.o: ../../software/include/hal/vga.h ../../software/include/hal/tmu.h
66-
main.o: ../../software/include/hw/tmu.h ../../software/include/hal/brd.h
67-
main.o: ../../software/include/hal/usb.h ../../software/include/hal/ukb.h
68-
main.o: boot.h splash.h
65+
main.o: ../../software/include/hw/minimac.h ../../software/include/hal/vga.h
66+
main.o: ../../software/include/hal/tmu.h ../../software/include/hw/tmu.h
67+
main.o: ../../software/include/hal/brd.h ../../software/include/hal/usb.h
68+
main.o: ../../software/include/hal/ukb.h boot.h splash.h
6969
splash.o: ../../software/include/base/stdio.h
7070
splash.o: ../../software/include/base/stdlib.h
7171
splash.o: ../../software/include/hal/vga.h ../../software/include/hw/flash.h
7272
splash.o: splash.h
73+
unlzma.o: unlzma.h

‎software/demo/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ eval.o: ../../software/include/base/stdlib.h
6262
eval.o: ../../software/include/base/string.h ../../software/include/hw/pfpu.h
6363
eval.o: ../../software/include/hw/common.h ../../software/include/hw/tmu.h
6464
eval.o: ../../software/include/hal/pfpu.h ../../software/include/fpvm/fpvm.h
65-
eval.o: ../../software/include/fpvm/is.h ../../software/include/fpvm/gfpus.h
65+
eval.o: ../../software/include/fpvm/is.h
66+
eval.o: ../../software/include/fpvm/schedulers.h
6667
eval.o: ../../software/include/fpvm/pfpu.h eval.h renderer.h
6768
font.o: color.h font.h
6869
isr.o: ../../software/include/hw/interrupts.h

‎software/demo/eval.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Milkymist SoC (Software)
3-
* Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
3+
* Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
2222

2323
#include <hal/pfpu.h>
2424
#include <fpvm/fpvm.h>
25-
#include <fpvm/gfpus.h>
25+
#include <fpvm/schedulers.h>
2626
#include <fpvm/pfpu.h>
2727

2828
#include "eval.h"
@@ -281,7 +281,7 @@ static int finalize_pfv()
281281

282282
static int schedule_pfv()
283283
{
284-
perframe_prog_length = gfpus_schedule(&pfv_fragment, (unsigned int *)perframe_prog, (unsigned int *)perframe_regs);
284+
perframe_prog_length = fpvm_default_schedule(&pfv_fragment, (unsigned int *)perframe_prog, (unsigned int *)perframe_regs);
285285
eval_reinit_all_pfv();
286286
if(perframe_prog_length < 0) {
287287
printf("EVL: per-frame VLIW scheduling failed\n");
@@ -527,7 +527,7 @@ static int finalize_pvv()
527527

528528
static int schedule_pvv()
529529
{
530-
pervertex_prog_length = gfpus_schedule(&pvv_fragment, (unsigned int *)pervertex_prog, (unsigned int *)pervertex_regs);
530+
pervertex_prog_length = fpvm_default_schedule(&pvv_fragment, (unsigned int *)pervertex_prog, (unsigned int *)pervertex_regs);
531531
if(pervertex_prog_length < 0) {
532532
printf("EVL: per-vertex VLIW scheduling failed\n");
533533
return 0;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Milkymist SoC (Software)
3-
* Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
3+
* Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -15,6 +15,17 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18+
19+
#ifndef __FPVM_SCHEDULERS_H
20+
#define __FPVM_SCHEDULERS_H
21+
22+
#include <fpvm/fpvm.h>
23+
24+
/*
25+
* code must be able to hold PFPU_PROGSIZE 32-bit instructions.
26+
* registers must be able to hold PFPU_REG_COUNT 32-bit values.
27+
*/
28+
1829
/*
1930
* Greedy Floating Point Unit Scheduler
2031
* This program takes FPVM code and performs greedy VLIW scheduling
@@ -23,17 +34,14 @@
2334
* program and takes the first schedulable instruction, without trying to
2435
* optimize the order of instructions.
2536
*/
26-
27-
#ifndef __FPVM_GFPUS_H
28-
#define __FPVM_GFPUS_H
29-
30-
#include <fpvm/fpvm.h>
37+
int gfpus_schedule(struct fpvm_fragment *fragment, unsigned int *code, unsigned int *registers);
3138

3239
/*
33-
* code must be able to hold PFPU_PROGSIZE 32-bit instructions.
34-
* registers must be able to hold PFPU_REG_COUNT 32-bit values.
40+
* Lean New / Lamely Named Floating Point Unit Scheduler
41+
* A smarter, faster, optimizing scheduler by Werner Almesberger.
3542
*/
43+
int lnfpus_schedule(struct fpvm_fragment *fragment, unsigned int *code, unsigned int *registers);
3644

37-
int gfpus_schedule(struct fpvm_fragment *fragment, unsigned int *code, unsigned int *registers);
45+
#define fpvm_default_schedule lnfpus_schedule
3846

39-
#endif /* __FPVM_GFPUS_H */
47+
#endif /* __FPVM_SCHEDULERS_H */

‎software/libfpvm/Makefile

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MMDIR=../..
22
include $(MMDIR)/software/include.mak
33

4-
OBJECTS=fpvm.o parser_helper.o scanner.o parser.o gfpus.o pfpu.o
4+
OBJECTS=fpvm.o parser_helper.o scanner.o parser.o gfpus.o lnfpus.o pfpu.o
55

66
all: libfpvm.a
77

@@ -39,8 +39,16 @@ gfpus.o: ../../software/include/base/stdio.h
3939
gfpus.o: ../../software/include/base/stdlib.h
4040
gfpus.o: ../../software/include/fpvm/is.h ../../software/include/fpvm/fpvm.h
4141
gfpus.o: ../../software/include/fpvm/pfpu.h
42-
gfpus.o: ../../software/include/fpvm/gfpus.h ../../software/include/hw/pfpu.h
43-
gfpus.o: ../../software/include/hw/common.h
42+
gfpus.o: ../../software/include/fpvm/schedulers.h
43+
gfpus.o: ../../software/include/hw/pfpu.h ../../software/include/hw/common.h
44+
lnfpus.o: ../../software/include/base/stdlib.h
45+
lnfpus.o: ../../software/include/base/stdio.h
46+
lnfpus.o: ../../software/include/base/string.h
47+
lnfpus.o: ../../software/include/base/assert.h
48+
lnfpus.o: ../../software/include/fpvm/is.h ../../software/include/fpvm/fpvm.h
49+
lnfpus.o: ../../software/include/fpvm/pfpu.h
50+
lnfpus.o: ../../software/include/fpvm/schedulers.h
51+
lnfpus.o: ../../software/include/hw/pfpu.h ../../software/include/hw/common.h
4452
parser.o: ../../software/include/base/stdio.h
4553
parser.o: ../../software/include/base/stdlib.h
4654
parser.o: ../../software/include/base/assert.h

‎software/libfpvm/gfpus.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Milkymist SoC (Software)
3-
* Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
3+
* Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
2020
#include <fpvm/is.h>
2121
#include <fpvm/fpvm.h>
2222
#include <fpvm/pfpu.h>
23-
#include <fpvm/gfpus.h>
23+
#include <fpvm/schedulers.h>
2424

2525
#include <hw/pfpu.h>
2626

‎software/libfpvm/lnfpus.c

+666
Large diffs are not rendered by default.

‎software/libfpvm/subdir.mak

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
OBJECTS=fpvm.o parser_helper.o scanner.o parser.o gfpus.o pfpu.o
1+
OBJECTS=fpvm.o parser_helper.o scanner.o parser.o gfpus.o lnfpus.o pfpu.o
22

33
all: libfpvm.a
44

‎software/libfpvm/x86-linux/test.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Milkymist SoC (Software)
3-
* Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
3+
* Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
1818
#include <stdio.h>
1919

2020
#include <fpvm/fpvm.h>
21-
#include <fpvm/gfpus.h>
21+
#include <fpvm/schedulers.h>
2222
#include <fpvm/pfpu.h>
2323
#include <hw/pfpu.h>
2424

@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
4040
fpvm_finalize(&frag);
4141
fpvm_dump(&frag);
4242
printf("== PFPU:\n");
43-
len = gfpus_schedule(&frag, code, registers);
43+
len = fpvm_default_schedule(&frag, code, registers);
4444
if(len > 0)
4545
pfpu_dump(code, len);
4646

@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
6060
fpvm_finalize(&frag);
6161
fpvm_dump(&frag);
6262
printf("== PFPU:\n");
63-
len = gfpus_schedule(&frag, code, registers);
63+
len = fpvm_default_schedule(&frag, code, registers);
6464
if(len > 0)
6565
pfpu_dump(code, len);
6666

@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
7373
fpvm_finalize(&frag);
7474
fpvm_dump(&frag);
7575
printf("== PFPU:\n");
76-
len = gfpus_schedule(&frag, code, registers);
76+
len = fpvm_default_schedule(&frag, code, registers);
7777
if(len > 0)
7878
pfpu_dump(code, len);
7979

0 commit comments

Comments
 (0)
Please sign in to comment.