Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / pli / vcs_acc_user.h
CommitLineData
86530b38
AT
1/*
2 * FileName: vcs_acc_user.h
3 *
4 * Facility: Verilog Compiled Simulator (VCS)
5 *
6 * Functional Description:
7 * Defines acc-type routines that are not part of the OVI standard.
8 *
9 * Notes:
10 * Include "acc_user.h" before this file (to get type definitions.)
11 *
12 * Copyright (c) 1997-98 by Synopsys, Inc. All rights reserved.
13 */
14
15#ifndef VCS_ACC_USER_H
16#define VCS_ACC_USER_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/*------------------------------- object types ------------------------------*/
23#define accPath 206
24#define accPrimPath 232
25#define accTermPath 238
26#define accModTermPath 240
27#define accTermModPath 242
28#define accCollapsedNet 304
29#define accVlogSimPath 310
30#define accExpandedPath 312
31#define accSwXlInvisibleNet 314
32#define accAcceleratedNet 316
33#define accRemoval 378
34#define accRecrem 379
35#define accAssignmentStat 526
36#define accContAssignStat 527
37#define accNullStat 528
38#define accDelayStat 530
39#define accAssignDelayStat 532
40#define accRtlDelayStat 534
41#define accAssignEventStat 536
42#define accAssignMultiStat 537
43#define accRtlEventStat 538
44#define accRtlMultiStat 539
45#define accGenEventStat 540
46#define accDisableStat 542
47#define accAssignStat 544
48#define accDeassignStat 546
49#define accForceStat 548
50#define accReleaseStat 550
51#define accInitialStat 552
52#define accAlwaysStat 554
53#define accAtEventStat 556
54#define accUnnamedBeginStat 558
55#define accNamedBeginStat 560
56#define accUnnamedForkStat 562
57#define accNamedForkStat 564
58#define accIfStat 566
59#define accCaseStat 568
60#define accCaseZStat 570
61#define accCaseXStat 572
62#define accForeverStat 574
63#define accRepeatStat 576
64#define accWhileStat 578
65#define accForStat 580
66#define accWaitStat 582
67#define accStringVar 647
68#define accChar 650
69#define accInt 652
70#define accBitType 654
71#define accByte 656
72#define accShortInt 658
73#define accLongInt 660
74#define accLogic 662
75#define accModPathHasIfnone 715
76#define accRealWire 697
77#define accOvaUnit 698
78#define accAutomatic 802
79
80/*------------------ parameter values for acc_configure() -------------------*/
81#define accSpecitemScope 7
82#define accWarnNestedLoconn 9
83#define accWarnNestedHiconn 10
84#define accMinMultiplier 12
85#define accTypMultiplier 13
86#define accMaxMultiplier 14
87#define accAttrDelimStr 15
88#define accDelayCount 16
89#define accDelayArrays 18
90#define accUserErrorString 20
91
92/*------------------------------ product types ------------------------------*/
93#define accVerilog 5
94
95
96/*** this structure is provided to allow compilation of pli applications ***/
97/*** containing s_tfcell arrays; these arrays are not used by VCS ***/
98typedef struct t_tfcell {
99 short type;
100 short data;
101 int (*checktf)();
102 int (*sizetf)();
103 int (*calltf)();
104 int (*misctf)();
105 char *tfname;
106 char *fill1;
107 char *fill2;
108 int fill3;
109 struct t_tfcell *fill4;
110 struct t_tfcell *fill5;
111 char *fill6;
112 int fill7;
113} s_tfcell;
114
115#define usertask 1
116#define userfunction 2
117#define userrealfunction 3
118
119#define accMemory 700 /* array of registers */
120#define accMda 701 /* array of registers */
121#define accTimeMda 702 /* array of registers */
122#define accIntegerMda 703 /* array of registers */
123#define accRealMda 704 /* array of registers */
124#define accRegMda 705 /* array of registers */
125#define accMdaWor 706
126#define accMdaWand 707
127#define accMdaTri 708
128#define accMdaTri0 709
129#define accMdaTri1 710
130#define accMdaTriand 711
131#define accMdaTrior 712
132#define accMdaTrireg 713
133#define accMdaSupply0 714
134#define accMdaSupply1 715
135#define accMdaWire 716
136#define accCharMda 717
137#define accByteMda 718
138#define accBitMda 719
139#define accIntMda 720
140#define accLongIntMda 721
141#define accShortIntMda 722
142#define accLogicMda 723
143
144/* Added for Veralite and System Verilog */
145
146#define accEnum 724
147#define accRegEnum 725
148#define accCharEnum 726
149#define accByteEnum 727
150#define accBitEnum 728
151#define accIntEnum 729
152#define accIntegerEnum 730
153#define accShortIntEnum 731
154#define accLongIntEnum 732
155#define accLogicEnum 733
156#define accEnumMda 734
157#define accUnion 735
158#define accStructure 736
159#define accUnionMda 737
160#define accStructureMda 738
161#define accInterface 739
162#define accInterfaceInstance 740
163#define accMemoryWord 741
164#define accMdaWord 742
165#define accAggregateWord 743
166#define accClass 744
167#define accStringMda 745
168#define accClassMda 746
169
170/* System Science requires that acc_next_driver() return
171 behavioral drivers if this configuration parameter is true */
172#define accBehavDrivers 701
173
174
175/* Extended Location Structure */
176typedef struct t_location2 {
177 int line_no;
178 char *filename;
179 int tag;
180} s_location2, *p_location2;
181
182/* Source File Info Structure */
183typedef struct vcs_srcfile_info_t {
184 char *SourceFileName;
185 int SourceFileTag;
186 int StartLineNum;
187 int EndLineNum;
188} vcs_srcfile_info_s, *vcs_srcfile_info_p;
189
190
191/* this structure is needed to support memory callback, needed by INTEL */
192
193/*--------------- structure passed to callback routine for VCL --------------*/
194typedef struct t_mem_vc_record
195{
196 int vc_reason;
197 int vc_hightime;
198 int vc_lowtime;
199 char *user_data;
200 char* p_mem_value;
201 int mem_word_index;
202} s_mem_vc_record, *p_mem_vc_record;
203
204#define memory_value_change 6
205
206
207
208#ifndef VCS_ARGS
209#define VCS_ARGS_DEFINED_HERE
210
211#if defined(__STDC__) || defined(__cplusplus) || defined(_AIX)
212# define VCS_ARGS(p) p
213#else
214# define VCS_ARGS(p) ()
215#endif
216
217#endif /* VCS_ARGS */
218
219
220/* Source File Info Routines */
221extern vcs_srcfile_info_p acc_mod_sfi_fetch VCS_ARGS ((handle handleModule));
222
223/* Next Routines */
224extern handle acc_next_signal_driver VCS_ARGS ((handle handleObj, handle handleDriver));
225extern handle acc_next_signal_driver_i VCS_ARGS ((handle handleObj, handle handleDriver));
226extern handle acc_next_vpddriver VCS_ARGS ((handle handleObj, handle handleDriver));
227
228extern int acc_is_active_driver VCS_ARGS ((handle handleDriver));
229
230/* Line Callback Routines */
231extern int acc_mod_lcb_enabled VCS_ARGS((void));
232extern void acc_mod_lcb_add VCS_ARGS ((handle handleModule, void (*consumer)(), char *user_data));
233extern void acc_mod_lcb_del VCS_ARGS ((handle handleModule, void (*consumer)(), char *user_data));
234extern p_location acc_mod_lcb_fetch VCS_ARGS ((handle handleModule));
235extern p_location2 acc_mod_lcb_fetch2 VCS_ARGS ((handle handleModule));
236
237/* Interface to $lsi_dumpports() tasks */
238typedef enum { USE_DUMPPORTS_FORMAT_LSI, USE_DUMPPORTS_FORMAT_IEEE } lsi_dumpports_format_type;
239extern int acc_lsi_dumpports_call VCS_ARGS ((handle instance, char *filename));
240extern int acc_lsi_dumpports_close VCS_ARGS ((handle instance, char *filename));
241extern void acc_lsi_dumpports_misc VCS_ARGS ((int data, int reason));
242extern int acc_lsi_dumpports_setformat VCS_ARGS ((lsi_dumpports_format_type format));
243extern int acc_lsi_dumpports_off VCS_ARGS ((char *fname));
244extern int acc_lsi_dumpports_on VCS_ARGS ((char *fname));
245extern int acc_lsi_dumpports_limit VCS_ARGS ((unsigned long filesize, char *fname));
246extern int acc_lsi_dumpports_flush VCS_ARGS ((char *fname));
247extern int acc_lsi_dumpports_all VCS_ARGS ((char *fname));
248
249/* Co-simulation */
250extern int acci_getnextlongtime VCS_ARGS ((unsigned *lotime, unsigned *hitime));
251extern int acc_is_vhdl_scope(handle handleModule);
252extern int acc_has_vhdl_parent(handle handleModule);
253extern void* acc_fetch_vhpi_handle(handle handleModule);
254
255extern int acc_stability VCS_ARGS ((handle handleModule));
256
257/* Compaq specific routines */
258extern handle vcs_next_driver VCS_ARGS ((handle handleObj, handle handleDriver, int *driverType));
259extern unsigned int vcs_convert_string_to_strength_value VCS_ARGS ((char *value_str));
260extern char *vcs_convert_strength_value_to_string VCS_ARGS ((unsigned int value));
261extern unsigned int vcs_fetch_scalar_strength_value VCS_ARGS ((handle h));
262extern unsigned int vcs_fetch_scalar_port_strength_value VCS_ARGS ((handle h));
263
264/* Tharas specific routines */
265extern int vcs_random(void);
266extern int vcs_random_const_seed(int seed);
267extern int vcs_random_seed(int *seed);
268extern int vcs_dist_uniform(int *seed,int start,int end);
269extern int vcs_dist_normal(int *seed,int mean,int standard_deviation);
270extern int vcs_dist_exponential(int *seed,int mean);
271extern int vcs_dist_poisson(int *seed,int mean);
272
273/* debussy specific routines */
274extern void vcs_free_handle(handle phandle);
275extern void vcs_use_free( int useFree);
276
277/* other customer-specific routines */
278extern handle acc_handle_mem_by_fullname(const char *name);
279extern void acc_readmem(handle mem, const char *memfile, int frmt);
280
281
282/* ********************************************************************** */
283/* BEGIN: SUPPORT FOR RTX */
284/* ********************************************************************** */
285extern unsigned char *acc_getmem_value_pointer VCS_ARGS((handle memhand));
286extern void acc_getmem_bitstr VCS_ARGS((handle memhand,char *retBitStr,int row, int start,int len));
287extern void acc_setmem_bitstr VCS_ARGS((handle memhand,char *bitStrValue,int row,int start));
288extern void acc_getmem_hexstr VCS_ARGS((handle memhand,char *retHexStr,int row,int start,int len));
289extern void acc_setmem_hexstr VCS_ARGS((handle memhand,char *hexStrValue,int row,int start));
290extern void acc_setmem_int VCS_ARGS((handle memhand,int value,int row,int start,int len));
291extern int acc_getmem_int VCS_ARGS((handle memhand,int row, int start, int len));
292extern void acc_clearmem_int VCS_ARGS((handle));
293extern int acc_getmem_size VCS_ARGS((handle));
294extern void acc_getmem_range VCS_ARGS((handle memhand, int* p_left_index, int* p_right_index));
295extern void acc_getmem_word_range VCS_ARGS((handle memhand, int* minoflsbmsb, int* len));
296extern int acc_getmem_word_int VCS_ARGS((handle mem_handle, int row)) ;
297
298/* for MDA support */
299
300extern void acc_get_mda_range VCS_ARGS((handle mdaHandle,int* dim, int** plndx, int** prindx));
301extern void acc_get_mda_word_range VCS_ARGS((handle mdaHandle,int* size, int* msb, int* lsb));
302extern void acc_getmda_bitstr VCS_ARGS((handle mdaHandle,char *retBitStr,int* dimArray,
303 int start, int len));
304
305extern void acc_setmda_bitstr VCS_ARGS((handle mdaHandle,char *bitStrValue,
306 int* dimArray, int start));
307extern char* acc_fetch_paramval_str(handle);
308extern char *acc_fetch_lodriver_value(handle, char*);
309extern handle acc_get_parent_port_and_index(handle, int*);
310extern char *acc_vcl_check(handle, void (*consumer)());
311extern int acc_vcl_disable(handle, void (*consumer)(), char *);
312extern int acc_vcl_enable(handle, void (*consumer)(), char *);
313extern void acc_fetch_module_definition_location(p_location, handle);
314extern handle acc_handle_connected_net(handle);
315extern handle acc_get_driver_loads_fusion(handle, handle, int, int);
316extern handle acc_next_signal_driver_sub(handle, handle, int);
317extern int acc_same_dest(handle, handle);
318extern void acc_set_user_buffer_size(int);
319extern handle acc_handle_path_AH(handle, handle);
320extern handle acc_handle_path_old(handle, handle);
321
322/* this function tells if the module that you have got is actually an ova unit*/
323extern int acc_is_ova_unit(handle);
324
325
326/* ********************************************************************** */
327/* END: SUPPORT FOR RTX */
328/* ********************************************************************** */
329
330/* V2K signed support */
331extern int acc_handle_is_signed VCS_ARGS((handle handleObj));
332/* END V2K signed support */
333
334extern handle acc_handle_ccond VCS_ARGS((handle handleTchk));
335extern char *acc_decompile VCS_ARGS((handle handleObj));
336extern handle acc_handle_scond VCS_ARGS((handle handleTchk));
337
338extern void acc_mem_vcl_add VCS_ARGS((handle object_p, int (*consumer)(), char *user_data));
339extern void acc_mem_vcl_delete VCS_ARGS((handle object_p, int (*consumer)(), char *user_data));
340
341/* vcl bit flag definitions */
342#define vcl_strength_flag 1
343#define vcl_verilog_flag 2
344#define vcl_compact_flag 8
345
346/* test whether strength information is requested for vcl */
347#define vcl_setstr_m(flags_) ( flags_ |= vcl_strength_flag )
348#define vcl_clearstr_m(flags_) ( flags_ &= ~vcl_strength_flag )
349#define vcl_isstr_m(flags_) ( flags_ & vcl_strength_flag )
350
351/* test whether Verilog information is requested for vcl */
352#define vcl_setvl_m(flags_) ( flags_ |= vcl_verilog_flag )
353#define vcl_clearvl_m(flags_) ( flags_ &= ~vcl_verilog_flag )
354#define vcl_isvl_m(flags_) ( flags_ & vcl_verilog_flag )
355
356/* test whether vcl trigger is compact or normal */
357#define vcl_setcompact_m(flags_) ( flags_ |= vcl_compact_flag )
358#define vcl_clearcompact_m(flags_) ( flags_ &= ~vcl_compact_flag )
359#define vcl_iscompact_m(flags_) ( flags_ & vcl_compact_flag )
360
361
362#ifdef VCS_ARGS_DEFINED_HERE
363#undef VCS_ARGS_DEFINED_HERE
364#undef VCS_ARGS
365#endif
366
367#ifdef __cplusplus
368} /* extern "C" */
369#endif
370
371#endif /* VCS_ACC_USER_H */