OpenCores
URL https://opencores.org/ocsvn/timestamp/timestamp/trunk

Subversion Repositories timestamp

[/] [timestamp/] [trunk/] [tstamp_sysless/] [testapp_tstamp.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 robotron
#include "xparameters.h"
2
#include "xreg405.h"
3
#include "stdio.h"
4
#include "xuartns550_l.h"
5
#include "xutil.h"
6
#include "xpseudo_asm.h"
7
 
8
/**
9
   requires following in system.mhs:
10
 
11
   PARAMETER C_APU_CONTROL = 0x1E01
12
   PARAMETER C_APU_UDI_1 = 0xC07605
13
**/
14
 
15
//volatile unsigned __attribute__((section(".bram"))) bram[0x1000];
16
volatile unsigned *bram = (unsigned*)0xcc000000;
17
 
18
int main() {
19
  char c;
20
  int a, b, i;
21
 
22
#if 1
23
  /* initialize caches (I.J.Krakora's warning) */
24
  XCache_EnableDCache(0x80000001);
25
  XCache_EnableICache(0x80000001);
26
#endif
27
 
28
   XUartNs550_SetBaud(XPAR_RS232_UART_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, 9600);
29
   XUartNs550_mSetLineControlReg(XPAR_RS232_UART_BASEADDR, XUN_LCR_8_DATA_BITS);
30
   xil_printf("Zaciname.\r\n");
31
 
32
#if 1
33
  /* enable APU */
34
  unsigned int msr_data;
35
  msr_data = mfmsr();
36
  msr_data = msr_data | XREG_MSR_APU_AVAILABLE | XREG_MSR_APU_ENABLE;
37
  mtmsr(msr_data);
38
#endif
39
 
40
  for (i = 0; i < 0x400; i++) {
41
    if (bram[i] != 0)
42
      xil_printf("|%02x: 0x%08x\r\n", i, bram[i]);
43
    bram[i] = 0;
44
  }
45
 
46
  xil_printf("Go!\r\n");
47
  for (;;) {
48
    c = getchar();
49
    xil_printf("*before\r\n");
50
 
51
    UDI0FCM_IMM_GPR_GPR(0, 0xdeadbeef, b);
52
 
53
    xil_printf("*after\r\n");
54
    for (i = 0; i < 0x400; i++)
55
      if (bram[i] != 0)
56
        xil_printf("%02x: 0x%08x\r\n", i, bram[i]);
57
 
58
    xil_printf("--\r\n");
59
  }
60
 
61
  return 0;
62
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.