summaryrefslogtreecommitdiff
path: root/cleopatre/devkit/tests/hal/gidel
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/devkit/tests/hal/gidel')
-rw-r--r--cleopatre/devkit/tests/hal/gidel/ftests/Makefile34
-rw-r--r--cleopatre/devkit/tests/hal/gidel/ftests/src/start.cpp139
-rw-r--r--cleopatre/devkit/tests/hal/gidel/ftests/src/start2.cpp117
-rw-r--r--cleopatre/devkit/tests/hal/gidel/ftests/src/start3.cpp137
4 files changed, 0 insertions, 427 deletions
diff --git a/cleopatre/devkit/tests/hal/gidel/ftests/Makefile b/cleopatre/devkit/tests/hal/gidel/ftests/Makefile
deleted file mode 100644
index a3224c5321..0000000000
--- a/cleopatre/devkit/tests/hal/gidel/ftests/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-BASE := $(CURDIR)/../../../../..
-OBJPATH := ./obj
-SRCPATH := ./src
-PRJPATH := $(BASE)/devkit/hal/gidel
-INC_PRJPATH := $(PRJPATH)
-###################################################
-
-# Common stuff
-CC := g++
-CFLAGS := -Wall -g3 -DLINUX -I. -I$(INC_PRJPATH)
-LIBS := -L$(PRJPATH) -lgidel -lgidelproc
-export LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:$(PRJPATH)
-
-SRCS=$(subst $(SRCPATH)/,,$(wildcard $(SRCPATH)/*.cpp))
-BINS=$(addprefix $(OBJPATH)/,$(SRCS:.cpp=.elf))
-
-
-# Rules
-all: $(PRJPATH)/libgidel.so $(OBJPATH) $(BINS)
-
-$(PRJPATH)/libgidel.so:
- $(MAKE) -C $(PRJPATH)
-
-$(OBJPATH)/%.elf: $(OBJPATH)/%.o
- $(CC) -shared -o $@ $^ $(LIBS)
-
-$(OBJPATH)/%.o : $(SRCPATH)/%.cpp
- $(CC) $(CFLAGS) -c -o $@ $<
-
-$(OBJPATH):
- mkdir -p $@
-
-clean :
- rm -rf $(OBJPATH)
diff --git a/cleopatre/devkit/tests/hal/gidel/ftests/src/start.cpp b/cleopatre/devkit/tests/hal/gidel/ftests/src/start.cpp
deleted file mode 100644
index bf7acf4975..0000000000
--- a/cleopatre/devkit/tests/hal/gidel/ftests/src/start.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2008 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file test.cpp
- * \brief simple loader and basic test program
- * \ingroup
- *
- * this program load an rbf file into the gidel's FPGA
- * and start some tests
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#include "AHBMemory.h"
-#include "AHBRegister.h"
-#include "Gidel.h"
-
-#define FPGA_NUM 1
-#define RBF "/home/spidcom/Maria_proto/projects/Maria_Proto_11/modules/maria_proto/board/hardware/proto_maria_ddr/fpga.rbf"
-
-CGidel *m_gidel = NULL;
-char rbf[_MAX_PATH];
-
-static void catch_sigint(int sig)
-{
- if(m_gidel != NULL)
- {
- printf("freeing memory...\n");
- delete m_gidel;
- }
- exit(0);
-}
-
-void test_irq(LPVOID pData)
-{
- printf("Oh What a pretty IRQ !\n");
-}
-
-int main(int argc, char* argv[])
-{
- unsigned char user;
-
- signal(SIGINT, catch_sigint);
-
- memset(rbf, 0, sizeof(rbf));
- strcpy(rbf, RBF);
-
- //download .rbf into the FPGA
- printf("\nLoading FPGA under GIDEL..........");
- try
- {
- m_gidel = new CGidel(rbf, FPGA_NUM, 0);
- }
- catch(const ProcException& e)
- {
- e.ErrorMsg();
- exit(-1);
- }
- catch(...)
- {
- printf("failed\nUnable to Load FPGA under Gidel\n");
- exit(-1);
- }
- //print rbf version
- printf("done (V%d)\n", m_gidel->GetRBFVersion());
- //start processor and ahb
- printf("Starting processor and AHB........");
- m_gidel->f_rst_ahb = 0;
- m_gidel->f_rst_proc = 0;
-
- if(!m_gidel->f_rst_ahb && !m_gidel->f_rst_proc)
- printf("done\n");
- else
- printf("failed\nUnable to UnReset processor and AHB\n");
-
- unsigned int test;
- AHBRegister leon_cfg_reg(m_gidel, 0x80000024);
- test = leon_cfg_reg;
- printf("leon_cfg_reg=%x\n",test);
- printf("leon_cfg_reg=%x\n",(unsigned int)leon_cfg_reg);
-
- unsigned int test1;
- AHBRegister myreg(m_gidel, 0xB5000010);
- test1 = myreg;
- printf("test1=%x\n",test1);
- myreg = 0x12345678;
- printf("myreg=%x\n",(unsigned int)myreg);
-
- unsigned int test2, test3, val[4] = {0x11111111, 0x22222222, 0x33333333, 0x44444444};
- AHBMemoryPtr<DWORD> memory(m_gidel, 0x00000030, 4);
- for(int i=0 ; i<4 ; i++)
- {
- *memory = val[i];
- test2 = *memory;
- test3 = memory.GetAddr();
- printf("memory 0x%08x=%08x\n", test3, test2);
- memory = memory + 1;
-// memory += 1;
-// memory++;
- }
-
- //set interrupt handler (interrupt from LEON)
- m_gidel->SetUserInterruptHandler(&test_irq);
- m_gidel->EnableInterrupt(true);
-
- //config interrupt to LEON
- //active interrupt 5 with GPIO14 on positive edge
- printf("Waiting debuggueur..."); scanf("%c",&user);
- unsigned int cfg;
- AHBRegister gpio_int_cfg(m_gidel, 0x800000A8);
- cfg = gpio_int_cfg;
- printf("GPIO int cfg before : %x\n",cfg);
- gpio_int_cfg = (cfg & 0xFFFF00FF) | 0xEE00; //active interrupt on GPIO 14 on positive edge
- printf("GPIO int cfg after : %x\n",(unsigned int)gpio_int_cfg);
-
- do {
- //start interrupt to LEON
- printf("Start Interrupt to LEON (%x) ? (y/n): ", (unsigned int)m_gidel->r_Pciit);
- scanf("%c",&user);
-
- if(user == 'y')
- {
- printf("Interrupt sending\n");
- if(m_gidel->f_pciit_to_leon == 1)
- m_gidel->f_pciit_to_leon = 0;
- else
- m_gidel->f_pciit_to_leon = 1;
- }
- } while(1); //wait Ctrl+C
-
- return 0;
-}
-
diff --git a/cleopatre/devkit/tests/hal/gidel/ftests/src/start2.cpp b/cleopatre/devkit/tests/hal/gidel/ftests/src/start2.cpp
deleted file mode 100644
index a5d2c1a08b..0000000000
--- a/cleopatre/devkit/tests/hal/gidel/ftests/src/start2.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2008 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file test.cpp
- * \brief simple loader and basic test program
- * \ingroup
- *
- * this program load an rbf file into the gidel's FPGA
- * and start some tests
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#include "AHBMemory.h"
-#include "AHBRegister.h"
-#include "Gidel.h"
-
-#define FPGA_NUM 1
-#define RBF "/home/spidcom/Maria_proto/projects/Maria_Proto_11/modules/maria_proto/board/hardware/proto_maria_ddr/fpga.rbf"
-
-CGidel *m_gidel = NULL;
-char rbf[_MAX_PATH];
-
-static void catch_sigint(int sig)
-{
- if(m_gidel != NULL)
- {
- printf("freeing memory...\n");
- delete m_gidel;
- }
- exit(0);
-}
-
-void test_irq(LPVOID pData)
-{
- printf("Oh What a pretty IRQ !\n");
-}
-
-int main(int argc, char* argv[])
-{
- signal(SIGINT, catch_sigint);
-
- memset(rbf, 0, sizeof(rbf));
- strcpy(rbf, RBF);
-
- //download .rbf into the FPGA
- printf("\nLoading FPGA under GIDEL..........");
- try
- {
- m_gidel = new CGidel(rbf, FPGA_NUM, 0);
- }
- catch(const ProcException& e)
- {
- e.ErrorMsg();
- exit(-1);
- }
- catch(...)
- {
- printf("failed\nUnable to Load FPGA under Gidel\n");
- exit(-1);
- }
- //print rbf version
- printf("done (V%d)\n", m_gidel->GetRBFVersion());
- //start processor and ahb
- printf("Starting processor and AHB........");
- m_gidel->f_rst_ahb = 0;
- m_gidel->f_rst_proc = 0;
-
- if(!m_gidel->f_rst_ahb && !m_gidel->f_rst_proc)
- printf("done\n");
- else
- printf("failed\nUnable to UnReset processor and AHB\n");
-
- //set interrupt handler (interrupt from LEON)
- m_gidel->SetUserInterruptHandler(&test_irq);
- m_gidel->EnableInterrupt(true);
-
- AHBRegister L2A_head(m_gidel, 0xB500001C);
-
- unsigned int error = 0;
- unsigned int result;
- printf("Read/Write test starting... ");
-
- for(unsigned int i=0;;i++)
- {
- L2A_head = i;
- result = L2A_head;
- if(result != i)
- {
- printf("i=0x%08x ; result=0x%08x\n",i,result);
- printf("PCI latency Last=%d ; PCI latency Max=%d\n", (unsigned int)m_gidel->r_PCILatencyLast, (unsigned int)m_gidel->r_PCILatencyMax);
- error++;
- }
- if((!(i%100000)) && (i!=0))
- {
- if(error)
- {
- printf("%d on %d Errors\n", error, i);
- i = 0;
- error = 0;
- }
- else
- {
- i = 0;
- printf("No Errors\n");
- }
- }
- }
- return 0;
-}
-
diff --git a/cleopatre/devkit/tests/hal/gidel/ftests/src/start3.cpp b/cleopatre/devkit/tests/hal/gidel/ftests/src/start3.cpp
deleted file mode 100644
index a5953dd508..0000000000
--- a/cleopatre/devkit/tests/hal/gidel/ftests/src/start3.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2008 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file test.cpp
- * \brief simple loader and basic test program
- * \ingroup
- *
- * this program load an rbf file into the gidel's FPGA
- * and start some tests
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#include "AHBMemory.h"
-#include "AHBRegister.h"
-#include "Gidel.h"
-
-#define FPGA_NUM 1
-#define RBF "/home/spidcom/Maria_proto/projects/Maria_Proto_11/modules/maria_proto/board/hardware/proto_maria_ddr/fpga.rbf"
-
-CGidel *m_gidel = NULL;
-char rbf[_MAX_PATH];
-
-static void catch_sigint(int sig)
-{
- if(m_gidel != NULL)
- {
- printf("freeing memory...\n");
- delete m_gidel;
- }
- exit(0);
-}
-
-void test_irq(LPVOID pData)
-{
- printf("Oh What a pretty IRQ !\n");
-}
-
-int main(int argc, char* argv[])
-{
- signal(SIGINT, catch_sigint);
-
- memset(rbf, 0, sizeof(rbf));
- strcpy(rbf, RBF);
-
- //download .rbf into the FPGA
- printf("\nLoading FPGA under GIDEL..........");
- try
- {
- m_gidel = new CGidel(rbf, FPGA_NUM, 0);
- }
- catch(const ProcException& e)
- {
- e.ErrorMsg();
- exit(-1);
- }
- catch(...)
- {
- printf("failed\nUnable to Load FPGA under Gidel\n");
- exit(-1);
- }
- //print rbf version
- printf("done (V%d)\n", m_gidel->GetRBFVersion());
- //start processor and ahb
- printf("Starting processor and AHB........");
- m_gidel->f_rst_ahb = 0;
- m_gidel->f_rst_proc = 0;
-
- if(!m_gidel->f_rst_ahb && !m_gidel->f_rst_proc)
- printf("done\n");
- else
- printf("failed\nUnable to UnReset processor and AHB\n");
-
- //set interrupt handler (interrupt from LEON)
- m_gidel->SetUserInterruptHandler(&test_irq);
- m_gidel->EnableInterrupt(true);
-
- AHBMemoryPtr<uint32_t> ddr2(m_gidel, 0x50000, 4);
-
- unsigned int error = 0;
- unsigned int result[4];
- printf("Read/Write test starting... \n");
-
- for(unsigned int i=0;;i++)
- {
- *ddr2 = i;
- *(ddr2+1) = i+1;
- *(ddr2+2) = i+2;
- *(ddr2+3) = i+3;
- result[0] = *ddr2;
- result[1] = *(ddr2+1);
- result[2] = *(ddr2+2);
- result[3] = *(ddr2+3);
- if(result[0] != i)
- {
- printf("00000 i=0x%08x ; result=0x%08x\n",i,result[0]);
- error++;
- }
- if(result[1] != i+1)
- {
- printf("11111 i=0x%08x ; result=0x%08x\n",i+1,result[1]);
- error++;
- }
- if(result[2] != i+2)
- {
- printf("22222 i=0x%08x ; result=0x%08x\n",i+2,result[2]);
- error++;
- }
- if(result[3] != i+3)
- {
- printf("44444 i=0x%08x ; result=0x%08x\n",i+3,result[3]);
- error++;
- }
- if((!(i%25000)) && (i!=0))
- {
- if(error)
- {
- printf("%d on %d Errors\n", error, i);
- i = 0;
- error = 0;
- }
- else
- {
- i = 0;
- printf("No Errors\n");
- }
- }
- }
- return 0;
-}
-