Search
lxdream.org :: lxdream/test/lib.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/lib.h
changeset 185:6755a04c447f
next190:f7653df5e832
author nkeynes
date Tue Jul 11 01:35:27 2006 +0000 (15 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/lib.h Tue Jul 11 01:35:27 2006 +0000
1.3 @@ -0,0 +1,59 @@
1.4 +#ifndef dc_lib_H
1.5 +#define dc_lib_H
1.6 +
1.7 +#include <stdio.h>
1.8 +
1.9 +typedef unsigned char uint8_t;
1.10 +typedef unsigned short uint16_t;
1.11 +typedef unsigned int uint32_t;
1.12 +typedef volatile unsigned int vuint32_t;
1.13 +typedef volatile unsigned short vuint16_t;
1.14 +
1.15 +#define ASIC_STATUS0 0xA05F6900
1.16 +#define ASIC_STATUS1 0xA05F6904
1.17 +#define ASIC_STATUS2 0xA05F6908
1.18 +#define ASIC_IRQB0 0xA05F6920
1.19 +#define ASIC_IRQC2 0xA05f6938
1.20 +#define IRQB0_MASK 0x0007B000
1.21 +
1.22 +#define long_read(A) (*((volatile unsigned long*)(A)))
1.23 +#define long_write(A, V) ( (*((volatile unsigned long*)(A))) = (V) )
1.24 +#define word_read(A) (*((volatile unsigned short*)(A)))
1.25 +#define word_write(A, V) ( (*((volatile unsigned short*)(A))) = (V) )
1.26 +#define byte_read(A) (unsigned int)(*((volatile unsigned char*)(A)))
1.27 +#define byte_write(A, V) ( (*((volatile unsigned char*)(A))) = (V) )
1.28 +
1.29 +int asic_wait(int event);
1.30 +void asic_clear(void);
1.31 +void asic_dump(FILE *f);
1.32 +
1.33 +void fwrite_dump(FILE *f, char *buf, int length);
1.34 +
1.35 +void *align32(char *buf );
1.36 +void write_asic_status(void);
1.37 +void reset_asic_status(void);
1.38 +void g2_fifo_wait( void );
1.39 +
1.40 +void spu_memload( uint32_t dst, const void *src, int length );
1.41 +void spu_memread( void *dst, uint32_t src, int length );
1.42 +void dump_spu_memory( unsigned int from, int length );
1.43 +
1.44 +struct spudma_struct {
1.45 + uint32_t g2_addr;
1.46 + uint32_t sh4_addr;
1.47 + uint32_t count;
1.48 + uint32_t direction;
1.49 + uint32_t mode;
1.50 + uint32_t enable;
1.51 + uint32_t status;
1.52 + uint32_t blah;
1.53 +};
1.54 +extern struct spudma_struct *spudma;
1.55 +
1.56 +#define get_asic_status() (long_read(ASIC_STATUS0)&EVENT_MAPLE_MASK)
1.57 +
1.58 +int is_start_pressed();
1.59 +
1.60 +#define CHECK_IEQUALS( a, b ) if( a != b ) { fprintf(stderr, "Assertion failed at %s:%d: expected %08X, but was %08X\n", __FILE__, __LINE__, a, b ); return -1; }
1.61 +
1.62 +#endif
.