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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.accelerator/] [hibi_dct/] [1.0/] [sw/] [dct_to_hibi_test.c] - Blame information for rev 181

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 170 lanttu
/*
2
 * file   dct__hibi_test.c
3
 * date   2013-3-27
4
 * author LM
5
 *
6
 */
7
 
8
#include <stdio.h>
9
#include <stdlib.h>
10
#include <string.h>
11
 
12
 
13
#include "hpd_functions.h"
14
 
15
#define MY_ADDR   0x01000000
16 181 lanttu
#define DCT_ADDR  0x05000000
17
#define FOO_ADDR  0x09000000
18 170 lanttu
 
19
 
20
 
21
int main()
22
{
23
 
24
  int dct_data[192]  = {0};
25
  int result_data[193] = {0};    // one word for zero detection
26
  int ref_quant_data[192] = {0};
27
  int data = 0;
28
 
29
  printf("CPU: starts\n");
30
 
31
  hpd_initialize();
32
 
33
  // reinit the channel 0
34
  hpd_rx_packet_reinit(0);
35
 
36
  // Send quant result address
37
  data = MY_ADDR;
38
  hpd_tx_send_copy((int)&data, 1, DCT_ADDR);
39
 
40
  // Send idct result address (NOT USED)
41
  data = FOO_ADDR;
42
  hpd_tx_send_copy((int)&data, 1, DCT_ADDR);
43
 
44
  // Send control
45
  data= 0x21;
46
  hpd_tx_send_copy((int)&data, 1, DCT_ADDR);
47
 
48
  // Send DCT DATA 
49
  hpd_tx_send_copy((int)dct_data, 192, DCT_ADDR);
50
  printf("DCT_data sent\n");
51
 
52
  // Waiting for data
53
  while(!(hpd_rx_packet_poll(0)));
54
 
55
  // Data received & read it to result table
56
  hpd_rx_packet_read(0, result_data);
57
  hpd_irq_packet_ack(0);
58
  hpd_rx_packet_reinit(0);
59
  printf("DATA received\n");
60
 
61
  // compare result data to reference quant results
62
 
63
 
64
 
65
  while(1); return 0;
66
}
67
 
68
 

powered by: WebSVN 2.1.0

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