Demo firmware compiles (but does not link) in emulation
authorlekernel <sebastien.bourdeauducq@lekernel.net>
Tue, 20 Oct 2009 18:55:30 +0000 (20:55 +0200)
committerlekernel <sebastien.bourdeauducq@lekernel.net>
Tue, 20 Oct 2009 18:55:30 +0000 (20:55 +0200)
software/demo/Makefile.emu
software/demo/compiler.c
software/demo/main.c
software/demo/parser.y
software/demo/shell.c
software/demo/ui.c
software/include/hw/tmu.h

index b6c6b9a..d4ae8b1 100644 (file)
@@ -1,5 +1,5 @@
 OBJECTS=isr.o tick.o wave.o analyzer.o scanner.o parser.o parser_helper.o compiler.o scheduler.o eval.o line.o apipe.o rpipe.o renderer.o cpustats.o shell.o ui.o main.o
-CFLAGS=-O2 -Wall -fsigned-char -fsingle-precision-constant -I$(MMEMUDIR)/include
+CFLAGS=-O2 -Wall -fsigned-char -fsingle-precision-constant -DEMULATION -I$(MMEMUDIR)/include
 
 all: emu
 
@@ -22,7 +22,7 @@ spam.raw: spam.png
 spam.h: spam.raw
        xxd -i spam.raw spam.h
 
-emu: $(OBJECTS)
+emu: bandfilters.h spam.h $(OBJECTS)
        $(CC) $(LDFLAGS) -o $@ -L$(MMEMUDIR)/src --start-group $(OBJECTS) -lmmemulation --end-group
 
 .PHONY: clean
index 70b67ce..a618e71 100644 (file)
@@ -293,7 +293,11 @@ void print_terminals(struct compiler_state *sc)
                if(sc->terminals[i].valid) {
                        printf("R%03d ", i);
                        if(sc->terminals[i].isconst)
+#ifdef EMULATION
+                               printf("%f\n", sc->terminals[i].id.x);
+#else
                                printf("%f\n", &sc->terminals[i].id.x);
+#endif
                        else
                                printf("%s\n", sc->terminals[i].id.name);
                }
index 6a6e06b..c178f0c 100644 (file)
@@ -22,9 +22,6 @@
 #include <irq.h>
 #include <board.h>
 #include <version.h>
-#include <hw/sysctl.h>
-#include <hw/gpio.h>
-#include <hw/interrupts.h>
 
 #include <hal/brd.h>
 #include <hal/mem.h>
index c174204..007c957 100644 (file)
@@ -18,6 +18,7 @@
 %include {
        #include <assert.h>
        #include <string.h>
+       #include <stdlib.h>
        #include <malloc.h>
        #include <math.h>
        #include "ast.h"
index 907f77b..0f91ee0 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <console.h>
 #include <uart.h>
 #include <board.h>
 #include <hw/pfpu.h>
 #include <hw/tmu.h>
+#ifndef EMULATION
 #include <hw/sysctl.h>
 #include <hw/gpio.h>
+#endif
 #include <hw/interrupts.h>
 
 #include <hal/vga.h>
@@ -212,6 +215,9 @@ static void help()
  */
 static void pfputest()
 {
+#ifdef EMULATION
+       printf("Not supported in emulation\n");
+#else
        unsigned int mesh[128][128];
        unsigned int *pfpu_regs = (unsigned int *)CSR_PFPU_DREGBASE;
        unsigned int *pfpu_code = (unsigned int *)CSR_PFPU_CODEBASE;
@@ -285,6 +291,7 @@ static void pfputest()
        CSR_PFPU_CTL = 0; /* Ack interrupt */
        irq_ack(IRQ_PFPU);
        irq_setmask(oldmask);
+#endif
 }
 
 static void tmutest_callback(struct tmu_td *td)
index c457b3f..e20f347 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef EMULATION
+
+void ui_init()
+{
+}
+
+void ui_isr_key()
+{
+}
+
+void ui_tick()
+{
+}
+
+#else
+
 #include <stdio.h>
 #include <string.h>
 #include <cffat.h>
@@ -271,3 +287,5 @@ void ui_tick()
                refresh_screen();
        }
 }
+
+#endif /* EMULATION */
index 4d41eaf..7c463bc 100644 (file)
@@ -25,7 +25,6 @@
 #define TMU_CTL_BUSY           0x01
 #define TMU_CTL_IRQ            0x02
 #define TMU_CTL_CHROMAKEY      0x04
-#define TMU_CTL_WRAP           0x08
 
 #define CSR_TMU_HMESHLAST      MMPTR(0x80006004)
 #define CSR_TMU_VMESHLAST      MMPTR(0x80006008)