qipp
2025-09-16 e7ac407a6aa40e94a34a772dee14e8d5fb55c45b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#ifndef _VIEW_INTERFACE_H__
#define _VIEW_INTERFACE_H__
 
    typedef enum{
        RESULT_SUCCESS,
        ERROR_PROC_ID_NO_FOUND,
        ERROR_EDGE_ID_NO_FOUND,
        ERROR_MEM_MALLOC,
        ERROR_NON_VALID_TOPO,
        ERROR_PARAM,
        ERROR_CONTENT_SIZE,
        ERROR_TYPE_NOT_MATCH,
        ERROR_DSP_BUFFER_OUT,
        ERROR_MODULE_TYPE_OUT,
    }error_code_t;
 
    typedef enum{
        SITE_FILE = 0x1,  //siteÀàÐͶÔÓ¦µÄ¶¥µãÄÚÈÝÊÇDesignÀàÐÍ
        DESIGN_FILE
    }DOCUMENT_TYPE;
 
 
    typedef struct{
        int x, y;
    }IPoint_t;
 
    typedef struct{
        IPoint_t l, r;
    }ILine_t;
 
 
    typedef struct{
        ILine_t line;
        unsigned short edge_id;
        unsigned int source_port;
        unsigned int dest_port;
    }IEdge_t;
 
 
    typedef struct{
        IPoint_t point;
        unsigned short vertex_id;
        unsigned short vertex_type;
 
        unsigned char chip_index;
        unsigned char in_port_num;
        unsigned char out_port_num;
    }IVertex_t;
 
 
    typedef struct {
        unsigned int topo_id;
        unsigned short topo_type;
        char pad[2];
 
        unsigned short vertex_num;
        unsigned short edges_num;
    }ITopo_t;
 
#define MAX_ADJ_EDGES_NUM 16
#define MAX_VERTEX_ERROR_NUM 16
    typedef struct{
        short vertex_id;
        short error_num;
        int error_port[MAX_VERTEX_ERROR_NUM];
    }error_ports_t, *perror_ports_t;
 
#ifdef _FRAMEWORK_DLL
#define  FW_API   _declspec(dllexport)
#else 
#define  FW_API 
#endif
    //for pc
FW_API void* open_document(void* bin, int bin_size);
FW_API void* new_document(ITopo_t* pt);
FW_API int save_document(void* pdocument, void* bin);
FW_API error_code_t close_document(void* pdocument);
FW_API int tell_document_length(void* pdocument);
 
 
FW_API error_code_t add_vertex(void* pdocument, const IVertex_t *pv);
FW_API error_code_t add_edge(void* pdocument, const IEdge_t * pe);
 
FW_API error_code_t get_document_info(void* pdocument, ITopo_t* pt);
 
FW_API error_code_t get_vertex(void* pdocument, int index, IVertex_t* pv);
FW_API error_code_t get_edge(void* pdocument,  int index, IEdge_t* pe);
FW_API void* get_vertex_content(void* pdocument, unsigned short vertex_id);
 
FW_API error_code_t set_vertex_content(void* pdocument, unsigned short vertex_id, void* pcontent, int size);
FW_API error_code_t document_assign_physical_channel_id(void* pdocument);
FW_API int check_document(void* pdocument, perror_ports_t perror, int perror_ports_size);
FW_API error_code_t set_document_addition(void* pdocument,void* paddition, unsigned short size);
FW_API void* get_document_addition(void* pdocument, unsigned short * size);
#endif