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

Subversion Repositories funbase_ip_library

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 169 to Rev 170
    Reverse comparison

Rev 169 → Rev 170

/funbase_ip_library/trunk/TUT/ip.hwp.accelerator/hibi_dct/1.0/sw/dct_to_hibi_test.c
0,0 → 1,68
/*
* file dct__hibi_test.c
* date 2013-3-27
* author LM
*
*/
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
 
#include "hpd_functions.h"
 
#define MY_ADDR 0x01000000
#define DCT_ADDR 0x03000000
#define FOO_ADDR 0x05000000
 
 
 
int main()
{
 
int dct_data[192] = {0};
int result_data[193] = {0}; // one word for zero detection
int ref_quant_data[192] = {0};
int data = 0;
printf("CPU: starts\n");
hpd_initialize();
// reinit the channel 0
hpd_rx_packet_reinit(0);
 
// Send quant result address
data = MY_ADDR;
hpd_tx_send_copy((int)&data, 1, DCT_ADDR);
// Send idct result address (NOT USED)
data = FOO_ADDR;
hpd_tx_send_copy((int)&data, 1, DCT_ADDR);
// Send control
data= 0x21;
hpd_tx_send_copy((int)&data, 1, DCT_ADDR);
 
// Send DCT DATA
hpd_tx_send_copy((int)dct_data, 192, DCT_ADDR);
printf("DCT_data sent\n");
 
// Waiting for data
while(!(hpd_rx_packet_poll(0)));
// Data received & read it to result table
hpd_rx_packet_read(0, result_data);
hpd_irq_packet_ack(0);
hpd_rx_packet_reinit(0);
printf("DATA received\n");
 
// compare result data to reference quant results
 
 
 
while(1); return 0;
}
 
 

powered by: WebSVN 2.1.0

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