mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-04-21 12:27:27 +03:00
Fixing some examples, adding scripts for compiling xilinx libs with ghdl
This commit is contained in:
@@ -3,9 +3,6 @@
|
||||
#define MemoryRead(A) (*(volatile unsigned long*)(A))
|
||||
#define MemoryWrite(A,V) *(volatile unsigned long*)(A)=(V)
|
||||
|
||||
typedef unsigned long uint32;
|
||||
typedef unsigned short uint16;
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
@@ -13,23 +10,29 @@ int main(void)
|
||||
volatile unsigned short *data16;
|
||||
volatile unsigned int *data32;
|
||||
|
||||
|
||||
volatile unsigned char test8;
|
||||
volatile unsigned short test16;
|
||||
volatile unsigned int test32, tmp;
|
||||
volatile unsigned long test64;
|
||||
|
||||
/*
|
||||
Operaciones de acceso a memoria
|
||||
*/
|
||||
|
||||
data8 = (unsigned char *)(0x20000410);
|
||||
data16 = (unsigned short *)(0x20000210);
|
||||
data32 = (unsigned int *)(0x20000330);
|
||||
|
||||
*data8 = 0x10;
|
||||
*data8 = 0x44;
|
||||
data8++;
|
||||
*data8 = 0x66;
|
||||
data8++;
|
||||
*data8 = 0x55;
|
||||
data8++;
|
||||
*data8 = 0x22;
|
||||
data8++;
|
||||
*data8 = 0x11;
|
||||
data8++;
|
||||
*data8 = 0x12;
|
||||
data8++;
|
||||
*data8 = 0x13;
|
||||
data8++;
|
||||
*data8 = 0x14;
|
||||
|
||||
*data16 = 0x2020;
|
||||
data16++;
|
||||
@@ -60,6 +63,25 @@ int main(void)
|
||||
data32 = (unsigned int *)(0x20000020);
|
||||
test32 = *data32;
|
||||
|
||||
|
||||
/*
|
||||
Operaciones aritméticas
|
||||
*/
|
||||
|
||||
|
||||
test32 = test32 + test8;
|
||||
test32 = 0x11111111 + test32;
|
||||
test32 = 0x1111 + test32;
|
||||
test32 = test32 + *data32;
|
||||
|
||||
test64 = test32 * test8;
|
||||
test64 = 0x11111111 * test32;
|
||||
test64 = 0x1111 * test32;
|
||||
test64 = test32 * *data32;
|
||||
|
||||
|
||||
|
||||
|
||||
while(1){
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user